VMware: redundant VC call after VM creation

Bug #1275822 reported by Radoslav Gerganov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Radoslav Gerganov

Bug Description

We have the following code in the spawn() method in vmops.py:

def spawn(...):
    ...
    def _execute_create_vm():
        vm_create_task = self._session._call_method(...)
        self._session._wait_for_task(instance['uuid'], vm_create_task)

    _execute_create_vm()
    vm_ref = vm_util.get_vm_ref_from_name(self._session, instance_name)
    ...

get_vm_ref_from_name() is making remote call which is redundant because we can obtain a reference to the created VM from the CreateVM task itself. From the the vSphere documentation:

"This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the newly created VirtualMachine upon success."

We should fix _execute_create_vm() to get the VM from the task and return it.

Tags: vmware
Michael Still (mikal)
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Changed in nova:
assignee: nobody → Radoslav Gerganov (rgerganov)
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/71581

Changed in nova:
status: Triaged → In Progress
Revision history for this message
Radoslav Gerganov (rgerganov) wrote :

This was fixed as part of the phase1 refactoring of spawn()

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.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.