Bug 1798126

Summary: Nic port ordering is not respected when ports are of different vnic binding type (normal vs. direct)
Product: Red Hat OpenStack Reporter: t.stanley
Component: openstack-novaAssignee: smooney
Status: CLOSED NOTABUG QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 13.0 (Queens)CC: dasmith, dhill, eglynn, jhakimra, kchamart, sbauza, sgordon, stephenfin, vromanso
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Other   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-06 17:56:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description t.stanley 2020-02-04 15:50:33 UTC
Description of problem:

Nics are attached to the VM in an order different from the one expected to the user. 

Example:
We create an instance with a given order of ports, please note that ports are of different vnic types (port: 1. normal, 2. direct, 3. direct, 4.normal, 5. normal) also we are using config-drive. 

openstack server create --image BIGIP --flavor large --nic port-id=vlan1(vnic_type=normal) --nic port-id=vlan2(vnic_type=direct)  --nic port-id=vlan3(vnic_type=direct)  --nic port-id=vlan4(vnic_type=normal) --nic port-id=vlan5(vnic_type=normal)  bigip --config-drive True

This results in the NICs being attached to VM in the following order: --nic port-id=vlan1(vnic_type=normal) --nic port-id=vlan4(vnic_type=normal) --nic port-id=vlan5(vnic_type=normal) --nic port-id=vlan2(vnic_type=direct)  --nic port-id=vlan3(vnic_type=direct)  


Version-Release number of selected component (if applicable):

rpm -q openstack-nova-common
openstack-nova-common-17.0.9-9.el7ost.noarch


How reproducible:

Everytime

Steps to Reproduce:
1. Create a VM with mixed vnic types of normal and direct.
2. Allow to create nics and VM
3.

Actual results:

nics are not connected to the VM in the order specified. Instead, priority is always given to "normal" and THEN "direct".  This results in the OS seeing the NIC's out of order when booting.  Onboarding scripts that are looking to configure these NIC's on boot are unable to configure them correctly.

Expected results:

NIC's are connected to the VM in the sepecified order.

Additional info:
We are asking if this is a BUG, or if this is expected behavior, if this expected behavior we will need to create a work around.  I suspect others have or will run into this?

Comment 1 smooney 2020-02-06 17:56:23 UTC
openstack makes no gurantess about nic or any ordering period.
the device role tagging feature https://specs.openstack.org/openstack/nova-specs/specs/mitaka/approved/virt-device-role-tagging.html#use-cases
was develop specifcly becasue to provider a way to discover tag to device mapping programatically.

onboard sctips should be using the metadata service to determine the device role and configure them accordingly.