You can configure flavor and image metadata to allow SR-IOV or DirectPath I/O passthrough and then create OpenStack instances that use physical hardware interfaces.

This procedure uses OpenStack Nova to enable passthrough for non-networking devices. For networking devices, see Configuring Passthrough for Networking Devices.

Prerequisites

  • Verify that your OpenStack deployment is using VDS or NSX-V networking. Deployments with NSX-T do not support passthrough.

  • Enable SR-IOV or DirectPath I/O in vSphere:

  • Create a dedicated compute cluster called vmnics for SR-IOV devices. DRS rules do not apply to these devices.

  • To persist the MAC address of a physical device, add its cluster as a compute node before enabling direct passthrough on the device. If direct passthrough has already been enabled, you can disable it, restart the cluster, and enable direct passthrough again.

Procedure

  1. Log in to the OpenStack Management Server.
  2. If your deployment is not using a custom.yml file, copy the template custom.yml file to the /opt/vmware/vio/custom directory.
    sudo mkdir -p /opt/vmware/vio/custom
    cp /var/lib/vio/ansible/custom/custom.yml.sample /opt/vmware/vio/custom/custom.yml
  3. Open the custom.yml file in a text editor and uncomment the nova_pci_alias parameter.
  4. Modify the value of nova_pci_alias to match your device.
    nova_pci_alias: [{"device_type": "type-VF", "name": "virtual-device-name"}, {"vendor_id":"vid", "product_id":"pid", "device_type": "type-PF", "name":"physical-device-name"}]

    where:

    • name (first occurrence) is the alias of the virtual device

    • vendor_id is the four-digit identifier of the physical device vendor

    • device_id is the four-digit identifier of the physical device

    • name (second occurrence) is the alias of the physical device

  5. Save custom.yml and deploy the updated configuration.
    sudo viocli deployment configure --tags nova_api_config

    This action will briefly interrupt OpenStack services.

  6. Log in to the VMware Integrated OpenStack dashboard as a cloud administrator and select the admin project from the drop-down menu in the title bar.
  7. Create a flavor with passthrough enabled.
    1. Select Admin > Compute > Flavors.
    2. Create a new flavor or choose an existing flavor to use for passthrough.
    3. Select Update Metadata next to the flavor that you want to use.
    4. In the Available Metadata pane, expand VMware Driver Options for Flavors and click the Add (plus sign) icon next to PCI Passthrough alias.
    5. Set the value of pci_passthrough:alias to virtual-device-name:device-count and click Save.

      Option

      Description

      virtual-device-name

      The virtual device name that you specified in Step 4 of this procedure.

      device-count

      The number of virtual functions that can be called in one request.

      This value can range from 1 to 10.

  8. Create an image with passthrough enabled.
    1. Select Admin > Compute > Images.
    2. Create a new image or choose an existing image to use for passthrough.
    3. Click the down arrow next to the flavor that you want to use and select Update Metadata.
    4. In the Available Metadata pane, expand VMware Driver Options and click the Add (plus sign) icon next to Virtual Network Interface.
    5. Select your device from the drop-down list next to the hw_vif_model parameter and click Save.

Results

You can now deploy passthrough-enabled virtual machines by configuring them with the flavor and image that you modified during this procedure.