VMware VC Driver does not honor hw_vif_model from glance

Bug #1183192 reported by Jacob Cherkas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Yaguang Tang
Grizzly
Fix Released
Critical
Yaguang Tang

Bug Description

Running nova 2013.1 from ubuntu packages...

In grizzly we have the ability to set glance metadata for an image but the VC driver does not honor hw_vif_model.

See http://bugs.launchpad.net/openstack-manuals/+bug/1153470

example:
# glance image-update \
--property hw_disk_bus=ide \
--property hw_cdrom_bus=ide \
--property hw_vif_model=e1000 \
f16-x86_64-openstack-sda

Created an image in glance and set hw_vif_model=e1000.

glance image-show 0545467e-b4e8-4161-88f4-f8042c092d10
+-------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------+--------------------------------------+
| Property 'hw_vif_model' | e1000 |
| Property 'hypervisor_type' | vmware |
| Property 'vmware_adaptertype' | lsiLogic |
| Property 'vmware_disktype' | preallocated |
| Property 'vmware_ostype' | ubuntu64Guest |
| checksum | 6a8dfdd18bb2d6dfcac8c3dd7ced9971 |
| container_format | ovf |
| created_at | 2013-05-09T00:41:47 |
| deleted | False |
| disk_format | vmdk |
| id | 0545467e-b4e8-4161-88f4-f8042c092d10 |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | ESXi5.0 |
| owner | 26af345b8c5b4cf881a68eb3151febd9 |
| protected | False |
| size | 17179869184 |
| status | active |
| updated_at | 2013-05-16T21:02:02 |
+-------------------------------+--------------------------------------+

Deploy an instance of this image and set nova-compute to debug.

In nova-compute.log:

, {u'instance_uuid': u'72
58c294-f72b-4374-a70b-6e71733618b3', u'deleted': 0, u'created_at': u'2013-05-22T22:49:28.000000', u'updated_at': None, u'value': u'vmware', u'key': u'image_hypervisor_typ
e', u'deleted_at': None, u'id': 18692}, {u'instance_uuid': u'7258c294-f72b-4374-a70b-6e71733618b3', u'deleted': 0, u'created_at': u'2013-05-22T22:49:28.000000', u'updated_at': None, u'value': u'e1000', u'key': u'image_hw_vif_model',

We can see that the metadata is passed to nova-compute as expected.

Looking on ESX host that the instance gets deployed on, the Adapter Type is always set to Flexible.

Tags: vmware
Revision history for this message
Sidharth Surana (ssurana) wrote :

Looking at the code for the vmware driver, I think the issue is in the way the VirtualMachineConfigSpec is created.
The networking part of the spec only creates a "VirtualPCNet32" type network adapter and does not look at the adapter type configuration in this case the "e1000" type. So this means every time a VM is created on an ESXi it will be done with the nic of type "VirtualPCNet32"

https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vm_util.py#L121 - method responsible for creating the network related spec

https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vm_util.py#L130 - Code that always create the "VirtualPCNet32" type of adapter.

Can you confirm if for the VMs created on the ESXi they all have the adapter type set as "VirtualPCNet32" for the NIC?

Yaguang Tang (heut2008)
Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/30384

Changed in nova:
assignee: nobody → Yaguang Tang (heut2008)
status: Confirmed → In Progress
Revision history for this message
Jacob Cherkas (jcherkas) wrote :
Download full text (3.2 KiB)

Looking at the vmx file that gets generated the ethernet type actually doesnt even get set.

What we need to see in the vmx file is ethernet0.virtualDev = "e1000". If virtualDev is never set then the default adapter type is
set to Flexible and running lspci in the guest we can see that its

02:00.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10).

Here is the Nova generated vmx file.

.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "9"
pciBridge0.present = "true"
pciBridge4.present = "true"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "true"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "true"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "true"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
vmci0.present = "true"
hpet0.present = "true"
nvram = "instance-00000dd8.nvram"
virtualHW.productCompatibility = "hosted"
powerType.powerOff = "soft"
powerType.powerOn = "hard"
powerType.suspend = "hard"
powerType.reset = "soft"
displayName = "instance-00000dd8"
extendedConfigFile = "instance-00000dd8.vmxf"
memsize = "2048"
ethernet0.present = "true"
ethernet0.dvs.switchId = "f1 0d 08 50 c3 85 76 d8-5b b8 4c 28 7c 2c 35 98"
ethernet0.dvs.portId = "258"
ethernet0.dvs.portgroupId = "dvportgroup-38"
ethernet0.dvs.connectionId = "1973291629"
ethernet0.addressType = "static"
ethernet0.address = "fa:16:3e:b7:6d:ca"
ethernet1.present = "true"
ethernet1.dvs.switchId = "f1 0d 08 50 c3 85 76 d8-5b b8 4c 28 7c 2c 35 98"
ethernet1.dvs.portId = "257"
ethernet1.dvs.portgroupId = "dvportgroup-38"
ethernet1.dvs.connectionId = "1973298296"
ethernet1.addressType = "static"
ethernet1.address = "fa:16:3e:49:6c:57"
guestOS = "other"
uuid.bios = "42 08 ab 2a b4 73 9d 97-fd 4d 89 be ee 34 55 27"
vc.uuid = "50 08 29 08 f9 df 64 af-3a 4f 38 c2 fc 0a ed 6f"
nvp.vm-uuid = "09a16348-9fba-40b9-9c46-5c4a258f8977"
nvp.iface-id.0 = "9a1b7c53-73e8-4f17-af92-ac97a97a26c0"
nvp.iface-id.1 = "291f2cf7-61e6-49fa-9c4f-8c7f715abb0c"
RemoteDisplay.vnc.enabled = "true"
RemoteDisplay.vnc.port = "5989"
RemoteDisplay.vnc.password = "nicira"
scsi0.present = "TRUE"
scsi0.sharedBus = "none"
scsi0.virtualDev = "lsilogic"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "instance-00000dd8.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
RemoteDisplay.vnc.key = "CjskCREyAwwLLAwjMzoAITwdCQIHOA0hFwcBAh4iCBUHGycABR8oBBMYJCQrLgEGNDs8AA8pARIfIxIQOiUFEzUzEAIiFywAKRsgMDwMOAAzNCghHh0gChojOCA5GQIjOSYZGiU3AAMuDhEQNCwIDTYkBRAXFhIMLykIJRUTMCQ="
floppy0.present = "FALSE"
scsi0.pciSlotNumber = "16"
ethernet0.pciSlotNumber = "32"
ethernet1.pciSlotNumber = "33"
vmci0.id = "-298560217"
vmci0.pciSlotNumber = "34"
uuid.location = "56 4d 1b ff 93 c3 1f f0-16 2a f2 e3 23 30 16 55"
cleanShutdown = "FALSE"
replay.supported = "FALSE"
sched.swap.derivedName = "/vmfs/volumes/73cb9e0e-73f74c4b/instance-00000dd8/instance-00000dd8-420a3fbd.vswp"
replay.filename = ""
scsi0:0.redo = ""
pciBridge0.pciSlotNumber = "17"
pciBridge4.pciSlotNumber = "21"
pciBridge5.pciSlotNumber = "22"
pciBridge6.pciSlotNumber = "23"
pciBridge7.pciSlotNumber = "24"
vmotion.checkpo...

Read more...

Changed in nova:
importance: Undecided → High
importance: High → Critical
Changed in nova:
milestone: none → havana-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/30384
Committed: http://github.com/openstack/nova/commit/088995fc2c792d6d029abd0e45d5c0cf09a5125a
Submitter: Jenkins
Branch: master

commit 088995fc2c792d6d029abd0e45d5c0cf09a5125a
Author: Yaguang Tang <email address hidden>
Date: Fri May 24 11:50:43 2013 +0800

    Fix VMware Hyper can't honor hw_vif_model image property.

    Support setting instance vif model through image property,
    change default vif model to e1000. Available vif model options
    for VMware Hyperv is "VirtualE1000, VirtualPCNet32, VirtualVmxnet".

    DocImpact
    Fix bug #1183192

    Change-Id: I3a98bc26df7e2252bf043a71acbba2a158e213b8

Changed in nova:
status: In Progress → Fix Committed
tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/33679

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/grizzly)

Reviewed: https://review.openstack.org/33679
Committed: http://github.com/openstack/nova/commit/19c443bc58f5cdc9623bc6f7e41d9c4cf588a4aa
Submitter: Jenkins
Branch: stable/grizzly

commit 19c443bc58f5cdc9623bc6f7e41d9c4cf588a4aa
Author: Yaguang Tang <email address hidden>
Date: Fri May 24 11:50:43 2013 +0800

    Fix VMware Hyper can't honor hw_vif_model image property.

    Support setting instance vif model through image property,
    change default vif model to e1000. Available vif model options
    for VMware Hyperv is "VirtualE1000, VirtualPCNet32, VirtualVmxnet".
    Also this patch removes the unused list_interface method and tests.

    DocImpact
    Fix bug #1183192
    Fix bug #1187251

    Change-Id: I3a98bc26df7e2252bf043a71acbba2a158e213b8
    (cherry picked from commit 088995fc2c792d6d029abd0e45d5c0cf09a5125a)

tags: added: in-stable-grizzly
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential in-stable-grizzly
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.