OpenStack  SR-IOV – configure an instance

Hits: 123

SR-IOV is single root input/output virtualization. In Openstack we use it for Network Functions

Assuming that you have configured the Compute nodes properly with SR-IOV , you will need to configure networks and flavors slightly differently than a regular OpenStack installation.

 

6.5.1. Procedure – be sure to create aggregates

  1. Ensure that the AggregateInstanceExtraSpecFilter value is added to the scheduler_default_filters parameter in the nova.confconfiguration file. If you add AggregateInstanceExtraSpecFilter to satisfy this requirement, restart the nova container.
  2. Create an aggregate group for SR-IOV, and add relevant hosts. Define metadata, for example, sriov=true, that matches defined flavor metadata.

    # openstack aggregate create sriov_group
    # openstack aggregate add host sriov_group compute-sriov-0.localdomain
    #  openstack aggregate set --property  sriov=true sriov_group
  3. Create a flavor.

    # openstack flavor create <flavor> --ram <MB> --disk <GB> --vcpus <#>
  4. Set additional flavor properties. Note that the defined metadata, sriov=true, matches the defined metadata on the SR-IOV aggregate.

    openstack flavor set --property sriov=true --property hw:cpu_policy=dedicated --property hw:mem_page_size=1GB <flavor>

 

Launching instances with SR-IOV ports

Once configuration is complete, you can launch instances with SR-IOV ports.

  1. Get the id of the network where you want the SR-IOV port to be created:

    $ net_id=`neutron net-show net04 | grep "\ id\ " | awk '{ print $4 }'`
    
  2. Create the SR-IOV port. vnic_type=direct is used here, but other options include normaldirect-physical, and macvtap:

    $ port_id=`neutron port-create $net_id --name sriov_port --binding:vnic_type direct | grep "\ id\ " | awk '{ print $4 }'`
    
  3. Create the instance. Specify the SR-IOV port created in step two for the NIC:

    $ openstack server create --flavor m1.large --image ubuntu_14.04 --nic port-id=$port_id test-sriov

 

Launching instances with SR-IOV ports¶ Once configuration is complete, you can launch instances with SR-IOV ports. Get the id of the network where you want the SR-IOV port to be created: $ net_id=`neutron net-show net04 | grep “\ id\ ” | awk ‘{ print $4 }’` Create the SR-IOV port. vnic_type=direct is used here, but other options include normal, direct-physical, and macvtap: $ port_id=`neutron port-create $net_id –name sriov_port –binding:vnic_type direct | grep “\ id\ ” | awk ‘{ print $4 }’` Create the

Source: OpenStack Docs: SR-IOV

%d bloggers like this: