Allow Users to specify Guest shutdown behavior for Stop, Rescue, and Delete (partial?)

Registered by Phil Day

Currently in libvirt stop, rescue, and delete operations 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.

This change exposed a clean / forced option to the users for those operations, mirroring soft and hard reboot

The BP will be implemented as a sequence of changes:

1) Make compute manager perform a controlled stop by default, including ability to provide per image timing configuration via image metadata and livirt implementation

2) Extend the "force shutdown" parameter back through the rpcapi

3) Extend the V2 API to expose force shutdown as a user option

4) Add force shutdown to the V3 API

Step 1 delivers value in its own right (it prevents a potential data corruption issue) and so can be reviewed and merged without waiting for the subsequent steps.

Blueprint information

Status:
Complete
Approver:
John Garbutt
Priority:
Low
Drafter:
Phil Day
Direction:
Approved
Assignee:
Phil Day
Definition:
Approved
Series goal:
Accepted for juno
Implementation:
Implemented
Milestone target:
milestone icon 2014.2
Started by
Russell Bryant
Completed by
John Garbutt

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/user-defined-shutdown,n,z

Nova Spec: https://review.openstack.org/#/c/89650/

Implement basic mechanism for libvirt and controlled shutdown for stop in compute manager
https://review.openstack.org/#/c/68942/

Implement resize operation in compute manager
https://review.openstack.org/#/c/109692/

Addressed by: https://review.openstack.org/112065
    Rescue should give guests a chance to shutdown

Addressed by: https://review.openstack.org/68942
    Power off commands should give guests a chance to shutdown

Addressed by: https://review.openstack.org/109692
    Resize should give guests a chance to shutdown

Addressed by: https://review.openstack.org/112988
    Shelve should give guests a chance to shutdown

Addressed by: https://review.openstack.org/111291
    Adds Hyper-V soft shutdown implementation

The key libvirt bits seem merged now. Remaining hyper-v patch has one +2, so stay in juno for now --johnthetubaguy 2nd September 2014

Addressed by: https://review.openstack.org/130338
    Extend clean_shutdown to the compute api layer

Gerrit topic: https://review.openstack.org/#q,topic:bug/1384637,n,z

Addressed by: https://review.openstack.org/130548
    Shelve_offload() should give guests a chance to shutdown

Addressed by: https://review.openstack.org/134634
    Add support for clean_shutdown to stop in compute api layer

Addressed by: https://review.openstack.org/135098
    Add support for clean_shutdown to shelve in compute api layer

Addressed by: https://review.openstack.org/135756
    Add support for clean_shutdown to rescue in compute api layer

Addressed by: https://review.openstack.org/143214
    Add support for clean_shutdown to resize in compute api layer

Addressed by: https://review.openstack.org/147965
    Add API support for forced shutdown

Addressed by: https://review.openstack.org/150607
    Revert "Add support for clean_shutdown to resize in compute api layer"

Addressed by: https://review.openstack.org/151515
    Power off commands should give guests a chance to shutdown

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.