← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1445858] [NEW] [VMware]Using ShutdownGuest instead of PowerOffVM_Task, if vmtools was installed.

 

Public bug reported:

PowerOffVM_Task is a dangerous operation, while ShutdownGuest are more secure.
Using ShutdownGuest instead of PowerOffVM_Task, if vmtools was installed.

now:
def power_off_instance(session, instance, vm_ref=None):
    """Power off the specified instance."""

    if vm_ref is None:
        vm_ref = get_vm_ref(session, instance)

    LOG.debug("Powering off the VM", instance=instance)
    try:
        poweroff_task = session._call_method(session.vim,
                                         "PowerOffVM_Task", vm_ref)
        session._wait_for_task(poweroff_task)
        LOG.debug("Powered off the VM", instance=instance)
    except vexc.InvalidPowerStateException:
        LOG.debug("VM already powered off", instance=instance)

** Affects: nova
     Importance: Undecided
     Assignee: javeme (javaloveme)
         Status: New


** Tags: vmware

-- 
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/1445858

Title:
  [VMware]Using ShutdownGuest instead of PowerOffVM_Task, if vmtools was
  installed.

Status in OpenStack Compute (Nova):
  New

Bug description:
  PowerOffVM_Task is a dangerous operation, while ShutdownGuest are more secure.
  Using ShutdownGuest instead of PowerOffVM_Task, if vmtools was installed.

  now:
  def power_off_instance(session, instance, vm_ref=None):
      """Power off the specified instance."""

      if vm_ref is None:
          vm_ref = get_vm_ref(session, instance)

      LOG.debug("Powering off the VM", instance=instance)
      try:
          poweroff_task = session._call_method(session.vim,
                                           "PowerOffVM_Task", vm_ref)
          session._wait_for_task(poweroff_task)
          LOG.debug("Powered off the VM", instance=instance)
      except vexc.InvalidPowerStateException:
          LOG.debug("VM already powered off", instance=instance)

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


Follow ups

References