← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1799557] [NEW] stopped instance resize (migrate_disk_and_power_off) fails, vm_state changed to active

 

Public bug reported:

This is based on code inspection, but I was wondering what would happen
if a user tried to resize a baremetal instance, which isn't supported by
the ironic virt driver.

It is possible to resize a stopped instance. If a user tried to resize a
stopped baremetal instance, I think what would happen is they'd get to
the driver.migrate_disk_and_power_off() method call here:

https://github.com/openstack/nova/blob/297de7fb9fbabe74b5305ef0aa82e196d5f48d5e/nova/compute/manager.py#L4431

Which would raise NotImplementedError, which would be handled here:

https://github.com/openstack/nova/blob/297de7fb9fbabe74b5305ef0aa82e196d5f48d5e/nova/compute/manager.py#L4404

With the _error_out_instance_on_exception() context manager. The problem
then is that context manager will reset the vm_state to 'active' by
default:

https://github.com/openstack/nova/blob/297de7fb9fbabe74b5305ef0aa82e196d5f48d5e/nova/compute/manager.py#L7984

Even though the instance is still stopped on the hypervisor (ironic in
this case).

This is low priority since (1) baremetal server users likely know not to
try and resize by now and/or (2) baremetal cloud providers probably
disable resize by policy in the API, and/or (3) the _sync_power_states
periodic task in the compute service would eventually see that the power
state for the instance from ironic does not match the 'active' vm_state
and stop the instance to sync up the nova database.

** Affects: nova
     Importance: Low
         Status: Triaged


** Tags: compute ironic resize

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

Title:
  stopped instance resize (migrate_disk_and_power_off) fails, vm_state
  changed to active

Status in OpenStack Compute (nova):
  Triaged

Bug description:
  This is based on code inspection, but I was wondering what would
  happen if a user tried to resize a baremetal instance, which isn't
  supported by the ironic virt driver.

  It is possible to resize a stopped instance. If a user tried to resize
  a stopped baremetal instance, I think what would happen is they'd get
  to the driver.migrate_disk_and_power_off() method call here:

  https://github.com/openstack/nova/blob/297de7fb9fbabe74b5305ef0aa82e196d5f48d5e/nova/compute/manager.py#L4431

  Which would raise NotImplementedError, which would be handled here:

  https://github.com/openstack/nova/blob/297de7fb9fbabe74b5305ef0aa82e196d5f48d5e/nova/compute/manager.py#L4404

  With the _error_out_instance_on_exception() context manager. The
  problem then is that context manager will reset the vm_state to
  'active' by default:

  https://github.com/openstack/nova/blob/297de7fb9fbabe74b5305ef0aa82e196d5f48d5e/nova/compute/manager.py#L7984

  Even though the instance is still stopped on the hypervisor (ironic in
  this case).

  This is low priority since (1) baremetal server users likely know not
  to try and resize by now and/or (2) baremetal cloud providers probably
  disable resize by policy in the API, and/or (3) the _sync_power_states
  periodic task in the compute service would eventually see that the
  power state for the instance from ironic does not match the 'active'
  vm_state and stop the instance to sync up the nova database.

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