← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1275822] Re: VMware: redundant VC call after VM creation

 

** Changed in: nova
       Status: Fix Committed => Fix Released

** Changed in: nova
    Milestone: None => juno-1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1275822

Title:
  VMware: redundant VC call after VM creation

Status in OpenStack Compute (Nova):
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1275822/+subscriptions


References