Bare metal instances available with machine series such as C3 and X4 use Infrastructure Data Path Function (IDPF), which is a standardized, multi-vendor PCIe network data plane function device. IDPF is a physical device. The IDPF driver is included in the kernel of Linux operating system (OS) images.
Before you begin
-
If you haven't already, set up authentication.
Authentication verifies your identity for access to Google Cloud services and APIs. To run
code or samples from a local development environment, you can authenticate to
Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
gcloud
-
Install the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud initIf you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
- Set a default region and zone.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
-
Supported features with IDPF
Similar to gVNIC, the following features are supported with IDPF:
- Per VM Tier_1 networking performance
- Large MTU support (Jumbo Frames)
- VPC network features:
- Cloud Next Generation Firewall
- Packet mirroring
- VPC Flow Logs
- IPv6 support
- VPC Network Peering
- Network Connectivity Center
Limitations of IDPF network interfaces
When using IDPF network interfaces (vNICs), note the following limitations:
- For most bare metal machine types, only a single vNIC is supported for the
instance, meaning you can't create a bare metal instance with multiple
IDPF network interfaces. The exceptions are as follows:
- A5X and A4X Max bare metal: Up to 2 IDPF network interfaces, plus the MRDMA network interfaces for GPU networking
- (Preview) C4D bare metal: Up to 10 IDPF network interfaces
- Z4D bare metal: Up to 2 IDPF network interfaces
- Z4M bare metal: Up to 2 IDPF network interfaces, and up to 2 IRDMA network interfaces
- IDPF supports a default queue allocation of 16
receive and transmit queues (RX/TX)
per NIC, with the following exceptions:
- A5X and A4X Max bare metal: 64 queues per IDPF NIC by default
- Z4D and Z4M bare metal: Up to 64 queues per IDPF NIC
- If you use DPDK with a bare metal instance that supports only one vNIC, then DPDK replaces the IDPF as the driver for the physical NIC. The DPDK application must forward packets to the kernel, such as through a TAP interface.
Overview of using IDPF with bare metal instances
To create a bare metal instance that uses IDPF, complete the following steps:
- Choose a public OS image that supports IDPF, or create a custom OS image that is tagged to use IDPF.
- Create a bare metal instance using the public or custom OS image. During instance creation, configure the network interface to use IDPF.
- Verify that IDPF is enabled.
Operating system support
On Compute Engine, IDPF is available with a limited number of supported public OS images.
For information about which operating systems are supported with IDPF, see the Interfaces tab for an operating system.
Use on non-supported operating systems
For OS images that don't support IDPF, check with the operating system distributor about including the IDPF driver. You can manually configure and install the latest version of the IDPF driver as documented in https://github.com/intel/ethernet-linux-idpf/blob/main/README.
After you create a compute instance with an operating system image that supports IDPF, create a custom OS image. You can then use the custom OS image to create bare metal instances that use IDPF on that operating system.
Create a custom OS image that supports IDPF
If you require a different OS image or version for your bare metal instance than those provided by Google Cloud, you can create the OS image using either the Google Cloud CLI or REST. For detailed information and best practices for creating custom OS images, see Create custom OS images.
gcloud
When creating the custom image, either from a Google Cloud provided image
or an imported OS image, you must tag the OS image with IDPF. Use the
gcloud compute images create command
as shown in the following example:
gcloud compute images create IMAGE_NAME \
--source-image=SOURCE_IMAGE \
--source-image-project=SOURCE_IMAGE_PROJECT \
--guest-os-features=IDPF
Replace the following:
IMAGE_NAME: a name for the custom image.SOURCE_IMAGE: a specific OS image that supports IDPF, for example:sles-sap-15-sp7-v20261014-x86-64.If you want to use the latest OS image in an image family, replace the
--source-imageflag with the--source-image-familyflag and set its value to an image family that supports IDPF, for example:--source-image-family=sles-sap-15-sp7.SOURCE_IMAGE_PROJECT: the name of the project that contains the source OS image or image family.Example
To create a SUSE Linux Enterprise Server (SLES) OS image using the latest OS image from the Compute Engine
sles-sap-15-sp7image family, run the following command:gcloud compute images create my-sles15sp7-metal-os \ --source-image-family=sles-sap-15-sp7 \ --source-image-project=suse-sap-cloud \ --guest-os-features=IDPF
For more information about when to use image families, see Image family best practices.
REST
When creating the custom image, either from a Google Cloud provided image
or an imported OS image, you must tag the OS image with IDPF. Complete
the following steps:
Select an OS image or image family that supports IDPF For more information, see Operating system details.
Using the OS image or image family selected in the previous step, create an OS image and tag this OS image with
IDPF. To create the OS image, use theimages.insertmethod.POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/images { "name":"IMAGE_NAME", "sourceImage":"SOURCE_IMAGE_URI", "guestOsFeatures":[ { "type":"IDPF" } ] }Replace the following:
IMAGE_NAME: a name for the custom image that you are creating.SOURCE_IMAGE_URI: the URI for the specific OS image or image family that you want to use.For example:
- Specific OS image:
"sourceImage": "projects/suse-sap-cloud/global/images/sles-sap-15-sp7-v20261014-x86-64" - Image family:
"sourceImage": "projects/suse-sap-cloud/global/images/family/sles-sap-15-sp7".
When you specify an image family, Compute Engine creates a VM from the most recent, non-deprecated OS image in that family. For more information about when to use image families, see Image family best practices.
- Specific OS image:
Manually configure SR-IOV for C4D on Linux OS images
C4D bare metal machine types support multiple vNICs. These additional vNICs are exposed as virtual functions (VFs) on the network card. These VFs use the same IDPF network driver as other bare metal machine types.
To use these VFs in a custom Linux OS image, you must do the following:
- Query the number of VFs assigned to or supported by each network card.
- Activate the VFs either manually or by configuring
udevrules.
Before configuring these VFs, note the following:
- Network assignment uses a round-robin approach.
- No traffic control is performed between VFs mapped to the same physical NIC. If traffic control is required for your workloads, then you must configure it yourself.
Prerequisites
To complete the steps documented in this section, you must have first completed the following tasks:
- Created a bare metal instance that has SR-IOV enabled and multiple vNICs configured.
- The IDPF kernel module is loaded in the Linux OS of the bare metal instance.
- The guest OS must have the
pciutilspackage installed to use thelspcicommand.
Activate the VFs
You can use one of the following methods to activate the VFs:
- Configure
udevrules. - Activate the VFs manually.
Configure udev rules for IDPF VFs
To configure SR-IOV using udev rules, complete the following steps:
Add the following lines to the file
/etc/udev/rules.d/75-gce-network.rules(or/lib/udev/rules.d/75-gce-network.rules):# Enable max number of VFs for Intel IDPF PF (8086:1452) FIRST SUBSYSTEM=="net", ACTION=="add", DRIVERS=="idpf", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x1452", ATTR{device/sriov_numvfs}=="0", ATTR{device/sriov_numvfs}="$attr{device/sriov_totalvfs}"To immediately trigger the new
udevrules, use the following commands:sudo udevadm control --reload-rules sudo udevadm triggerVerify the configuration by reading
sriov_totalvfsto get the number of VFs supported by the primary NIC.The guest OS must have the
pciutilspackage installed to use thelspcicommand.# Get the PCI address of the primary NIC lspci -D | grep -i eth # Use the PCI address (for example, 0000:3f:00.0) to read the number of VFs cat /sys/bus/pci/devices/0000:3f:00.0/sriov_totalvfs # Verify IP allocation for the VFs completed successfully ip a
Manually activate the SR-IOV VFs
You can manually activate all the supported SR-IOV VFs for your bare metal instance by completing the following steps:
Identify the IDPF physical function (PF) by running the following command:
lspci -D | grep -i eth
The output from this command includes the PCI's
bus:device.functionaddress and the 4-digit domain prefix, for example0000:3f:00.0as shown in the following example output:0000:3f:00.0 Ethernet controller: Intel Corporation Infrastructure Data Path Function (rev 21)
To enable all supported VFs, run the following command, replacing PCI_ADDRESS with the value from the previous step:
cat /sys/bus/pci/devices/PCI_ADDRESS/sriov_totalvfs | sudo tee /sys/bus/pci/devices/PCI_ADDRESS/sriov_numvfs
Verify that the new network PCI devices appear when you run the
lspcicommand again. In addition, run theip acommand to verify that the IP allocation completed successfully for the VFs.
The network PCI devices are automatically configured by the OS's network management stack.
Create a bare metal instance with IDPF support
You can create a bare metal instance by using one of the public OS images that supports IDPF or by using a custom OS image that you created using the steps in Create a custom OS image that supports IDPF.
Create a bare metal instance using a public OS image
To create a bare metal instance using a public OS image that supports IDPF, follow the instructions at Create a bare metal instance.
Create a bare metal instance using a custom OS image
If you aren't using a public OS image that supports IDPF, you must first create a custom OS image that supports IDPF. You then use that custom OS image to create a bare metal instance by using the Google Cloud CLI or REST.
When creating the bare metal instance that supports more than one vNIC, you must specify all network interfaces during creation; you can't add an IDPF network interface to an existing instance. To add a vNIC to the command examples in the following tabs, do one of the following:
- gcloud: add a
--network-interfaceflag for each vNIC. REST: add a
networkInterfacesobject for each vNIC.
gcloud
Create the bare metal instance by using the
gcloud compute instances createcommand. For the boot disk image, specify the custom OS image that you created earlier. For the network interface, set the value of thenic-typeflag toIDPF.gcloud compute instances create INSTANCE_NAME \ --zone=ZONE \ --image=IMAGE_NAME \ --image-project=YOUR_IMAGE_PROJECT \ --network-interface=nic-type=IDPFReplace the following:
INSTANCE_NAME: a name for the new instance.ZONE: the zone to create the instance in.IMAGE_NAME: the custom OS image that was created previously.YOUR_IMAGE_PROJECT: the name of the project that contains the custom OS image.
Optional: Verify that Compute Engine created the instance and that the
nicTypeis set toIDPF.gcloud compute instances describe INSTANCE_NAME \ --zone=ZONE
Replace the following:
INSTANCE_NAME: the name of the instance.ZONE: the zone that you created the instance in.
Example
To create a bare metal instance in zone
europe-west4-busing a customized SLES 15 SP7 for SAP OS image namedmy-sles15sp7-metal-osthat's in projectmy-project-12345, run the following command:gcloud compute instances create test-x4-metal-custom-os \ --zone=europe-west4-b \ --machine-type=x4-1440-24t-metal \ --image=my-sles15sp7-metal-os \ --image-project=my-project-12345 \ --network-interface=nic-type=IDPFThings to consider
The
--network-interfaceflag has sub-level flags such as the following:--address: Assign an IP address to the instance--network: The network the interface is to be a part of--network-tier: The network tier of the interface--subnet: The subnet that the interface is to be part of. If--networkis also specified, the subnet must be a part of the specified network.--private-network-ip: Specify the RFC 1918 IP to assign to the instance.
For a full list see, the
--network-interfaceflag.If the machine type for the instance supports more than one IDPF network interface, then you can configure the additional interfaces by specifying another
--network-interfaceflag.
REST
Create the bare metal instance by using the
instances.insert method.
- For the boot disk image, specify the custom OS image that you created earlier.
- For the network interface, set the value of the
nicTypefield toIDPF.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances
{
"name":"INSTANCE_NAME",
"networkInterfaces":[
{
"nicType":"IDPF",
"network":"NETWORK",
"subnetwork":"SUBNET_NAME"
}
],
"disks":[
{
"initializeParams":{
"sourceImage":"projects/YOUR_IMAGE_PROJECT/global/images/IMAGE_NAME"
},
"boot":true
}
]
}
If the machine type of the instance supports more than one IDPF network
interface, then you can configure the additional interfaces by specifying
another networkInterfaces object.
Replace the following:
PROJECT_ID: the ID of the project to create the instance in.ZONE: the zone to create the instance in.INSTANCE_NAME: a name for the new instance.NETWORK: the URL of the network resource for this instance. If neither the network nor the subnetwork is specified, the default networkglobal/networks/defaultis used.SUBNET_NAME: name of the subnet. The network is inferred from the specified subnet. This is an optional field.YOUR_IMAGE_PROJECT: the name of your project that contains the OS image.IMAGE_NAME: the name of the custom OS image that was created in the previous step.
Verify that IDPF is enabled
You can use the lshw tool to extract detailed information about the
hardware configuration of the bare metal instance.
To install the lshw tool on your Linux instance, open an SSH connection
to the guest OS, and then run the following command:
sudo apt-get install lshw -y
To determine whether the instance is using the IDPF network interface, run the following command:
sudo lshw -class network
The following shows an example of the output:
*-network
description: Ethernet interface
product: Intel Corporation
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:3f:00.0
logical name: enp5s0f0
version: 11
serial: 42:01:0a:96:00:02
width: 64 bits
clock: 33MHz
capabilities: pm msi msix pciexpress bus_master cap_list ethernet physical
configuration: autonegotiation=off broadcast=yes driver=idpf driverversion=6.5.0-1023-gcp duplex=full ip=10.150.0.2 latency=0 link=yes multicast=yes
resources: iomemory:21ff0-21fef iomemory:21ff0-21fef irq:16 memory:21ffe0000000-21ffefffffff memory:21fff2000000-21fff203ffff
Manage SR-IOV VF-backed network interfaces on bare metal instances
If you create a bare metal instance using a machine type that supports multiple IDPF network interfaces with SR-IOV, then you can use the following tasks to manage the network interfaces that use SR-IOV virtual functions (VFs).
Find the PCI Address of the primary NIC
To view the PCI address of the IDPF LAN device, use the lspci command.
lspci -nn | grep -E 1452
The previous command displays the PCI address in the format
bus:device.function, for example, 3f:00.0, as shown in the following example
output:
3f:00.0 Ethernet controller [0200]: Intel Corporation Infrastructure Data Path Function [8086:1452] (rev 21)
Check if SR-IOV is supported by the LAN PF
To check if the SR-IOV PCIe capability is advertised by the LAN PF, use the
lspci command. SR-IOV should be supported on all C4D bare metal instances.
In the following command, replace PCI_ADDRESS with the PCI
address of your LAN PF (the primary NIC).
sudo lspci -vvv -s PCI_ADDRESS
The output is similar to the following:
3f:00.0 Ethernet controller: Intel Corporation Infrastructure Data Path Function (rev 21)
...
Capabilities: [210 v1] Single Root I/O Virtualization (SR-IOV)
IOVCap: Migration- 10BitTagReq+ Interrupt Message Number: 000
IOVCtl: Enable- Migration- Interrupt- MSE- ARIHierarchy+ 10BitTagReq-
IOVSta: Migration-
Initial VFs: 768, Total VFs: 768, Number of VFs: 0, Function Dependency Link: 00
VF offset: 256, stride: 1, Device ID: 145c
Supported Page Size: 00000553, System Page Size: 00000001
Region 0: Memory at 0000018d94c00000 (64-bit, prefetchable)
Region 2: Memory at 0000018e75d10000 (64-bit, prefetchable)
VF Migration: offset: 00000000, BIR: 0
...
View the number of LAN VFs supported by the primary NIC
The sriov_totalvfs value in the PCIe SR-IOV capability exposes the maximum
number of VFs that the hardware supports. The number of VFs that can be
enabled depends on the number of IDPF network interfaces that you configured
when you created the bare metal instance.
Identify the IDPF physical function (PF) by running the following command:
lspci -D | grep -i eth
The output from this command includes the PCI's
bus:device.functionaddress and the 4-digit domain prefix, for example0000:3f:00.0as shown in the following example output:0000:3f:00.0 Ethernet controller: Intel Corporation Infrastructure Data Path Function (rev 21)
To check the maximum number of SR-IOV VFs that can be enabled for your bare metal instance, run the following command, replacing PCI_ADDRESS with the domain and PCI address of your IDPF PF:
cat /sys/bus/pci/devices/PCI_ADDRESS/sriov_totalvfs
If you created a C4D bare metal instance with three IDPF network interfaces, then you should see the following output:
2
The primary IDPF network interface uses the PF, and the remaining two network interfaces use VFs.
View the number of enabled LAN VFs
Get the PCI address with the domain prefix for the LAN physical function (PF) by running the following command:
lspci -D | grep -i eth
To check how many VFs are enabled for your bare metal instance, run the following command, replacing PCI_ADDRESS with the PCI address (for example,
0000:3f:00.0) of your LAN PF:cat /sys/bus/pci/devices/PCI_ADDRESS/sriov_numvfs
If there are no enabled VFs, then the output of the command is 0.
VFs are not enabled until the guest operating system enables them. For information about how to enable the VFs, see Activate the VFs.
List the enabled LAN VFs
After enabling the virtual functions (VFs), the VF devices appear on the PCI bus
with device ID 8086:145c. To list the enabled VF devices, run the following
command:
lspci -nnk -d 8086:145c
The following example shows the output for a bare metal instance with two
enabled VFs. It also shows that the idpf driver initialized successfully on
each VF:
02:00.0 Ethernet controller [0200]: Intel Corporation Infrastructure Data Path Function [8086:145c] (rev 21)
Subsystem: Google, Inc. Device [1ae0:00c3]
Kernel driver in use: idpf
02:00.1 Ethernet controller [0200]: Intel Corporation Infrastructure Data Path Function [8086:145c] (rev 21)
Subsystem: Google, Inc. Device [1ae0:00c3]
Kernel driver in use: idpf
Check if the IDPF driver initialized successfully on VFs
Check the dmesg log to ensure that the IDPF driver initialized without errors
on the VFs:
sudo dmesg | grep idpf
The output should be similar to the following:
[ 3.944639] idpf 0000:01:00.0: Device HW Reset initiated [ 4.089101] idpf 0000:01:00.0: Minimum RX descriptor support not provided, using the default [ 4.089631] idpf 0000:01:00.0: Minimum TX descriptor support not provided, using the default [ 1408.197480] idpf 0000:02:00.0: enabling device (0000 -> 0002) [ 1408.198223] idpf 0000:02:00.0: Device HW Reset initiated [ 1408.199411] idpf 0000:02:00.1: enabling device (0000 -> 0002) [ 1408.210608] idpf 0000:02:00.1: Device HW Reset initiated [ 1408.480583] idpf 0000:02:00.1: PTP init failed, err=-EOPNOTSUPP [ 1408.482380] idpf 0000:02:00.0: PTP init failed, err=-EOPNOTSUPP [ 1408.495497] idpf 0000:02:00.0: Minimum RX descriptor support not provided, using the default [ 1408.495500] idpf 0000:02:00.0: Minimum TX descriptor support not provided, using the default [ 1408.495798] idpf 0000:02:00.1: Minimum RX descriptor support not provided, using the default [ 1408.495802] idpf 0000:02:00.1: Minimum TX descriptor support not provided, using the default [ 1408.907888] idpf 0000:02:00.0 enp1s0f0v0: renamed from eth1 [ 1408.948371] idpf 0000:02:00.1 enp1s0f0v1: renamed from eth2
View the IDPF network interfaces
If the IDPF driver initialized successfully, then the driver creates network interfaces which automatically obtain their IP address from the Virtual Private Cloud (VPC) network configuration.
ip a
This following example output shows that the network interfaces are ready for use:
... 3: enp1s0f0v0:mtu 1460 qdisc mq state UP group default qlen 1000 link/ether 42:01:0a:00:02:03 brd ff:ff:ff:ff:ff:ff inet 10.0.2.3/32 metric 100 scope global dynamic enp1s0f0v0 valid_lft 86144sec preferred_lft 86144sec inet6 fe80::4001:aff:fe00:203/64 scope link valid_lft forever preferred_lft forever 4: enp1s0f0v1: mtu 1460 qdisc mq state UP group default qlen 1000 link/ether 42:01:0a:00:03:03 brd ff:ff:ff:ff:ff:ff inet 10.0.3.3/32 metric 100 scope global dynamic enp1s0f0v1 valid_lft 86144sec preferred_lft 86144sec inet6 fe80::4001:aff:fe00:303/64 scope link valid_lft forever preferred_lft forever
Disabling LAN VFs
To disable VFs, you write 0 to the sriov_numvfs sysfs file. This removes
all the VF devices from the specified PCI bus. However, this doesn't remove the
network interfaces configured for the bare metal instance.
To disable VFs for the bare metal instance, in the following command, replace
PCI_ADDRESS with the PCI address of your LAN PF, for example
0000:3f:00.0:
echo 0 | sudo tee /sys/bus/pci/devices/PCI_ADDRESS/sriov_numvfs
What's next
- Learn more about IDPF.
- Learn how to connect to your instance.
- Learn about jumbo frames.
- Learn how to change the MTU setting of a VPC network.