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

Bug #1799557 reported by Matt Riedemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Triaged
Low
Unassigned

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.

Revision history for this message
Matt Riedemann (mriedem) wrote :
summary: - stopped instance resize fails, vm_state change to active
+ stopped instance resize (migrate_disk_and_power_off) fails, vm_state
+ changed to active
Matt Riedemann (mriedem)
tags: added: low-hanging-fruit
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.