Rebuildforvms


 * Launchpad Entry: NovaSpec:rebuild-for-ha
 * Created: 2011-Nov-30
 * Contributors: Jason Kim

Summary
Support HA for vms from the failed host.

Release Note
When this is implemented, VMs will be rebuilt from failed host to the other hosts.

Rationale
If the host is failed, we can't run the current vms on the host. That is to say, we can't HA for vms. I solved the HA using the rebuild means.

Below steps will be added.

1) get the information of instances on the failed host. - we can know the state of host by using monitoring system or using the service state (nova-compute, nova-network)

2) get a list of dictionaries of network data of an instance.

3) update the volume db and instance db.

4) setup volumes for block device mapping

5) spawn the instance.

6) associate the floating ip which is used existing the instances.  - set up the iptables and so on.

7) update the instance db.

User stories

 * User doesn't know the vm is rebuilt.
 * Operator gets the list of failed host from monitoring system or nova network/compute state.
 * Operator gets the lists of the instances on the failed hosts.
 * Operator should rebuild the instances by using this operation.

Assumptions
The instances were created with volumes attached.


 * auto-create-boot-volumes

Implementation

 * Scheduler should call the compute manager to rebuild the instance.
 * Compute Manager should get a list of dictionaries of network data of an instance.
 * Compute Manager should update the volume db and instance db.
 * Compute Manager should setup volumes for block device mapping by using the volume manager.
 * Compute Manager should spawn the instance by using the virt driver.
 * Compute Manager should associate the floating ip by using the network manager.
 * Compute Manager should update the instance db.
 * Compute Manager should restart the network module.

Code Changes

 * /usr/bin/nova-manage
 * /nova/compute/api.py, vm_states.py, task_state.py, manager.py
 * /nova/api/openstack/common.py
 * /nova/network/api.py, manager.py

Test/Demo Plan
This need not be added or completed until the specification is nearing beta.

Unresolved issues
TBD

BoF agenda and discussion
Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected.