The Compute Engine virtual network interface (also known as gVNIC) is specifically designed for use on Compute Engine. Compute Engine virtual network interface provides a more efficient delivery network for sending traffic to and from your VM instances. Previously, virtual machine (VM) instances that run on Compute Engine use a virtual network interface based on the virtIO specification.
The Compute Engine virtual network interface is required to support higher network bandwidths such as the 50-100 Gbps speeds that can be used for distributed workloads on instances that have attached GPUs.
To create VM instances that use the Compute Engine virtual network interface, you can complete one of the following steps:
- Create your VM instances using an image from
the
gvnic-vm-image-prod
image family. - Manually install the Compute Engine virtual network driver on any Linux image of your choice and then use the image to create a VM instance.
Before you begin
- If you want to use the command-line examples in this guide:
- Install or update to the latest version of the gcloud command-line tool.
- Set a default region and zone.
- If you want to use the API examples in this guide, set up API access.
Limitations
The Compute Engine virtual network interface is not supported on VM instances that use memory-optimized machine types.
Operating system support
For information about which images belong to the gvnic-vm-image-prod
image
project and are configured to use the Compute Engine virtual network
interface, see Operating system details.
You can use any of these images to create a VM instance that, by default, uses the Compute Engine virtual network interface.
Creating a VM instance using pre-configured images
To create a VM instance using an image from the
gvnic-vm-image-prod
image project, follow the steps to
create a VM instance and
provide the image project and image family.
Debian
To create a Debian instance, run the following command:
gcloud beta compute instances create instance-name \ --image-project=gvnic-vm-image-prod \ --image-family=debian-9-gvnic
Replace instance-name
with the
name of your instance.
Windows
To create a Windows 2019 instance, run the following command:
gcloud beta compute instances create instance-name \ --image-project=gvnic-vm-image-prod \ --image-family=windows-2019-gvnic
To create a Windows 2016 instance, run the following command:
gcloud beta compute instances create instance-name \ --image-project=gvnic-vm-image-prod \ --image-family=windows-2016-gvnic
To create a Windows 2012-r2 instance, run the following command:
gcloud beta compute instances create instance-name \ --image-project=gvnic-vm-image-prod \ --image-family=windows-2012-r2-gvnic
Replace
instance-name
with the name of your instance.
Manually installing the Compute Engine virtual network driver
To create a VM instance from an image that does not have the Compute Engine virtual network driver installed, you need to:
- Install the Compute Engine virtual network driver on the image.
- Use the image, that now has the Compute Engine virtual network driver installed, to create a VM instance.
Linux
Before you can install the Compute Engine virtual network driver, you must install the latest versions of the kernel driver and header for your operating system. An instance that uses a Compute Engine virtual network interface without a kernel driver will not have internal or external network connectivity, including SSH and RDP.
To build and install the kernel driver from source you must have a supported kernel with headers installed. The Compute Engine virtual network driver supports building against mainline and major distribution kernels for versions 3.10 and later.
Install or update kernel and headers to version 3.10 or later. To complete this step, review the documentation for your operating system. Source code and driver packages can be obtained from GitHub, see GoogleCloudPlatform/compute-virtual-ethernet-linux.
Use your image to create and start a VM instance.
On this VM instance, load the kernel driver. To load the driver run the following command:
modprobe gve
This command loads the driver until you either reboot the system or remove the driver with the
rmmod
command.(Optional) To ensure that the driver loads automatically when the system boots, run one of the following commands:
For operating systems that use systemd, run the following command:
echo gve > /etc/modules-load.d/gve.conf
For Debian systems, run the following command:
echo gve >> /etc/modules
Stop the VM instance.
Create an image from the disk that is attached to the VM instance that you just stopped.
gcloud beta compute images create image-name\ --source-disk disk-name \ --guest-os-features=GVNIC
Replace the following:
image-name
: The name of the image that you want to create. This image has the Compute Engine virtual network driver installed.disk-name
: The name of the boot disk on the VM instance that you just stopped.
Use the image, which has the Compute Engine virtual network driver installed, to create and start a VM instance.
Windows
Use your image to create and start a VM instance.
On this VM instance, install GooGet. To install GooGet, see Download and install GooGet.
Install the gVNIC driver. To install the driver, run the following command in an elevated PowerShell prompt:
googet install google-compute-engine-driver-gvnic
Stop the VM instance.
Create an image from the disk that is attached to the VM instance that you just stopped.
gcloud beta compute images create image-name\ --source-disk disk-name \ --guest-os-features=GVNIC
Replace the following:
image-name
: The name of the image that you want to create. This image now has the Compute Engine virtual network driver installed.disk-name
: The name of the boot disk on the VM instance that you just stopped.
Use the image, which has the Compute Engine virtual network driver installed, to create and start a VM instance.
Verifying that the Compute Engine virtual network interface is enabled
Linux
Method 1
On your Linux VM instance, run the following commands:
sudo apt install pciutils lspci
The output should resemble the following:
00:04.0 Ethernet controller: Google, XXX. Device 0042
Method 2
Follow the instruction for your operating system to download the
ethtool
networking utility tool.Run the following command:
sudo ethtool -i network-interface
Replace
network-interface
with the name of your network interface. For example,eth0
.The output should resemble the following:
driver: gve version: 1.0.0 firmware-version: expansion-rom-version: bus-info: 0000:00:04.0 supports-statistics: yes supports-test: no supports-eeprom-access: no supports-register-dump: no supports-priv-flags: no
Windows
- On your Windows VM Instance, open the Device Manager.
- Under Network Adapters, you should see:
"Google Ethernet Adapter"
What's next
- Connect to your instance.
- Add persistent disks to your new instance.
- Troubleshoot gVNIC.