doing evacuate automatically

Registered by chejun

In openstack, when a host is not work (power-off eg) , instances on the host will be unuseable. Only one way to recover this instances by executing CLI command manually: “nova evacuate …” or “nova host-evacuate…”

In order to increase the reliability of the system, it can be done automatically to rebuild instances at other hosts while the original host is not work.

We add nova-monitor.service at control node, the service call ironic interface to obtain the power status of each host periodically. If find a host is power-off or unplugged ,the service will rebuild it’s instances at other hosts.
called api:
    scheduler.rpcapi.select_destinations() -- select a host to do rebuild
    compute.api.evacuate() -- rebuild instance at selected host

After the power-off host power on and it's nova-compute.service start, the evacuated instances will be deleted by the function:compute.manager.init_host._destroy_evacuated_instances(). The instance directory will be deleted too, network and volume resource will be free and return to system.

If an instance boot from image, the changed data in the instance will lose after rebuilding, so there has a restrictions: only instance boot from volume and it’s data disk is volume too, the instance can be do rebuild automatically.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
chejun
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.