Nova host maintenance mode.

Registered by Tang Chen

When executing the following command on a KVM box:
    nova host-update XXX --maintenance enable

it returns the following error:
    ERROR (HTTPNotImplemented): Virt driver does not implement host
    maintenance mode.

The reason is: Nova compute does not provide a default host maintenance
handling process. It passes the request to driver. But libvirt driver has
not implemented host maintenance mode. So on a KVM box, it returns
HTTPNotImplemented.

This topic has been discussed since 2013 here:
https://blueprints.launchpad.net/nova/+spec/host-maintenance

After some discussion, the direction comes to this:

When "nova host-update XXX --maintenance enable" is executed, host maintenance
mode process should work as below:
1. Disable the compute service on the compute node.
2. Migrate all instances on the compute node.
It is more like two novaclient commands: "nova service-disable" and
"nova host-evacuate-live".

So this functionality should be implement like this:
1. On Nova side, host_maintenance_mode() API in Nova is not implemented. It
pass the request to driver directly. In order to keep Nova as a low level
infrastructure API, implement a default host_maintenance_mode() API to simply
enable/disable compute service, so that drivers who have not implemented one
could fall back to it.
Refer to: http://docs.openstack.org/developer/nova/project_scope.html#no-more-orchestration

2. On Nova client side, improve "host-update" command as below:
a) Disable compute service.
b) Call evacuation or migration process to migrate all instances.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Tang Chen
Direction:
Needs approval
Assignee:
Tang Chen
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
John Garbutt

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:host-maintenance-mode,n,z

Spec: https://review.openstack.org/228689
    Host maintenance mode

Gerrit topic: https://review.openstack.org/#q,topic:bp/host-maintenance-mode,n,z

Addressed by: https://review.openstack.org/233537
    Implement a migration monitor in conductor.

Addressed by: https://review.openstack.org/233538
    Define Migration object in migrate_server() in conductor.

Addressed by: https://review.openstack.org/233539
    Add host_maintenance_mode() API to conductor.

Addressed by: https://review.openstack.org/233540
    Implement default host maintenance mode handling.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.