VMware driver can not retrieve vm_ref according to instance['name']

Bug #1314034 reported by Kai Tong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

VMware driver always uses a method "_get_vm_ref_from_name(session, instance['name']" in nova.virt.vmwareapi.vm_util to retrieve the vm_ref from vCenter (SDK). Actually the instance['name'] is the name assigned by openstack instead of the name assigned by VMware. The instance name is such as "instance-00000002". It will return 'Instance xxxxxxxxxxxxxxxxxxxxx could not be found' when _get_vm_ref_from_name use instance['name'] as its parameter.

It should use instance['display_name'] which is the name VMware used.

Tags: vmware
Kai Tong (tongkai)
Changed in nova:
assignee: nobody → Kai Tong (tongkai)
Kai Tong (tongkai)
information type: Public → Public Security
Kai Tong (tongkai)
information type: Public Security → Public
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote :

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

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote :

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

Revision history for this message
Tracy Jones (tjones-i) wrote :

Since havana the instance['name'] is the uuid of the instance. Are you having issues with grizzly?? Please attach logs

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by John Garbutt (<email address hidden>) on branch: master
Review: https://review.openstack.org/91215
Reason: This seems to have been abandoned, apologies if not, feel free to restore the patch.

Revision history for this message
Tracy Jones (tjones-i) wrote :

this has not been touched in a long time and the patches are abandoned. Please set back to in progress if you start to work on it

Changed in nova:
status: In Progress → Incomplete
Revision history for this message
Kai Tong (tongkai) wrote :

Hi all:
I was assigned to do some urgent work in the last few months. Let me explain this bug:

For a VM it has UUID and name, for example:

In openstack:
VM --------> UUID: 84f763a5-45cd-496a-8d49-b035118d60da
                     Name: vm_in_vcenter
In vCenter:
VM--------->UUID: 84f763a5-45cd-496a-8d49-b035118d60da
                    Name: 84f763a5-45cd-496a-8d49-b035118d60da

In vmware driver, it uses two method:
_get_vm_ref_from_uuid(session, instance['uuid']) or _get_vm_ref_from_name(session, instance['name'])

Please note the second method, it trace VM through instance['name']. But the instance['name'] is actually like "instance-00000002".
Usually the first method will work but it will go wrong if the first method didn't return a value.

As Tracy Jones said, in vCenter the vm_name==vm_uuid, if we expect that the first method always work then the second method is unnecessary.
If we expect the second method works in case the first go error, it should be modified.

Revision history for this message
Sean Dague (sdague) wrote :

In the future if you get different work please remove your name from the bug so that others know that you aren't working on it.

tags: added: vmware
Changed in nova:
assignee: Kai Tong (tongkai) → nobody
Sean Dague (sdague)
Changed in nova:
status: Incomplete → Invalid
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.