nova/nova/compute
Phil Day b32d01d44c Stop, Rescue, and Delete should give guest a chance to shutdown
Currently in libvirt stop, shelve, rescue, and delete simply
destroy the underlying VM. Some GuestOS's do not react well to this
type of power failure, and so it would be better if these operations
followed the same approach as soft_reboot and give the guest as
chance to shutdown gracefully.  Even where VM is being deleted,
it may be booted from a volume which will be reused on another
server.

The change is implemented by adding a clean_shutdown parameter
to the relevant methods from the compute/api layer downwards
and into the virt drivers.  The implementation in the libvirt
driver is also provided.  Other drivers are modified just to
expect the additional parameter.

The timer configuration value previous used by soft_reboot in
libvirt is moved up to virt/driver so it can be used by other drivers.

The timer logic itself is changed from simple loop counting with one
second sleeps to a more precise approach, since testing showed that
other calls in the loop could introduce a difference of up to +50% on
the expected duration. This can extent the default two minute to
three minutes, which would not be acceptable in some environments
and breaks some of the tempest tests.

A separate config value defines what the default shutdown
behaviour for delete should be (default False to keep compatibility
with current behaviour).

This code is structured to enable a subsequent API change to add
clean/forced options to the stop and delete methods

Also as a minor tidy-up moved the repeated definition of
FakeLoopingCall in test_libvirt be common across tests

Partially-Implements: blueprint user-defined-shutdown
Closes-Bug: #1196924

DocImpact

Change-Id: Ie69aa2621cb52d6fefdc19f664247b069d6782ee
2013-12-15 16:20:50 +00:00
..
monitors Make compute support monitors and store metrics 2013-12-05 13:54:59 +08:00
__init__.py Remove the monkey patching of _ into the builtins 2013-07-26 07:31:17 -07:00
api.py Stop, Rescue, and Delete should give guest a chance to shutdown 2013-12-15 16:20:50 +00:00
cells_api.py Stop, Rescue, and Delete should give guest a chance to shutdown 2013-12-15 16:20:50 +00:00
claims.py Add PCI device tracker to compute resource tracker 2013-08-29 16:55:56 +08:00
fakevirtinstance.xml update copyrights 2010-07-15 01:28:51 -04:00
flavors.py Merge "Enable non-ascii characters in flavor names" 2013-11-26 01:33:23 +00:00
instance_actions.py Shelve/unshelve an instance 2013-07-16 13:56:16 -04:00
manager.py Stop, Rescue, and Delete should give guest a chance to shutdown 2013-12-15 16:20:50 +00:00
power_state.py cleanup power state (partially implements bp task-management) 2012-05-29 10:16:59 -04:00
resource_tracker.py Merge "Let resource_tracker report right migration status" 2013-12-06 07:52:17 +00:00
rpcapi.py Stop, Rescue, and Delete should give guest a chance to shutdown 2013-12-15 16:20:50 +00:00
stats.py Update OpenStack LLC to Foundation 2013-02-26 19:15:29 -05:00
task_states.py Recover from IMAGE-* state on compute manager start-up 2013-12-03 14:08:38 +00:00
utils.py Add notification for host operation 2013-10-31 12:19:50 +08:00
vm_mode.py Tiny typo 2013-03-06 20:42:40 -05:00
vm_states.py Shelve/unshelve an instance 2013-07-16 13:56:16 -04:00