progetti:cloud-areapd:operations:live_migration_of_virtual_machines
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| progetti:cloud-areapd:operations:live_migration_of_virtual_machines [2014/10/08 07:03] – created dorigoa@infn.it | progetti:cloud-areapd:operations:live_migration_of_virtual_machines [2015/08/04 15:00] (current) – fantinel@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Live Migration howto ===== | ||
| + | |||
| + | Live migration of a virtual machine allow a VM executed by a certain compute node (which is going to fail or to be shutoff for maintenance), | ||
| + | |||
| + | By default this operation can be performed only by the OpenStack admin user, which is the only one who has access to the mapping of virtual machines to the physical hypervisors (in fact admin can even force the creation of a virtual machine on a certain compute node; a normal user can' | ||
| + | |||
| + | Other info are reported in the [[http:// | ||
| + | |||
| + | ==== Assumptions ==== | ||
| + | It is assumed that the nova instance lib directory (usually ''/ | ||
| + | |||
| + | ==== The command ==== | ||
| + | The command to live migrate a virtual machines from a hypervisor to another one is: | ||
| + | |||
| + | <code bash> | ||
| + | nova live-migration < | ||
| + | </ | ||
| + | |||
| + | * Note 1: ''< | ||
| + | * Note 2: the virtual instance files (''/ | ||
| + | * Note 3: the status of the VM must be ACTIVE | ||
| + | * Note 4: it is strongly reccommended that both hypervisors have the same OS and libvirt version. It's possible to update an old libvirt with yum, but then you have to restart manually libvirtd, then the openstack-nova-compute service | ||
| + | * Note 5: it is possible to overcome the openstack " | ||
| + | |||
| + | |||
| + | If the migration fails, before retrying the migration command, reset the state of the VM | ||
| + | |||
| + | <code bash> | ||
| + | nova reset-state --active | ||
| + | </ | ||
| + | |||
| + | If a VM is in SHOUTOFF status the command to be used is different and doesn' | ||
| + | |||
| + | <code bash> | ||
| + | nova migrate e14e276d-4594-481d-8cd1-c92831f06632 | ||
| + | </ | ||
| + | |||
| + | If the VM is in the VERIFY_RESIZE status, you must confirm through the dashboard the resize request; the VM now is ready to be migrated as a SHOUTOFF VM. | ||
| + | |||
| + | If the VM is PAUSED, the migration IS NOT POSSIBLE: the VM must be terminated or resumed via dashboard, then migrated; it is strongly recommended to contact the user and sync with him. | ||
| + | |||
| + | If the hypervisor of the VM is dead, use the command: | ||
| + | |||
| + | <code bash> | ||
| + | nova evacuate --on-shared-storage e14e276d-4594-481d-8cd1-c92831f06632 cld-nl-03.cloud.pd.infn.it | ||
| + | </ | ||
| + | |||
| + | ==== Helpful commands ==== | ||
| + | Pre-source code: | ||
| + | <code bash> | ||
| + | . keystone_admin.sh | ||
| + | </ | ||
| + | |||
| + | Close a Compute Node: | ||
| + | <code bash> | ||
| + | nova-manage service disable cld-nl-02.cloud.pd.infn.it nova-compute | ||
| + | nova-manage service list | grep cld-nl | ||
| + | </ | ||
| + | |||
| + | |||
| + | Compute Node VM list (Live Migration Helper Script): | ||
| + | <code bash> | ||
| + | [root@cld-ctrl-01 ~]# bin/ | ||
| + | </ | ||
| + | |||
| + | Compute Node VM list: | ||
| + | <code bash> | ||
| + | nova list --host cld-nl-02.cloud.pd.infn.it --all-tenants | ||
| + | </ | ||
| + | |||
| + | Compute Node resources: | ||
| + | <code bash> | ||
| + | nova host-describe cld-nl-02.cloud.pd.infn.it | ||
| + | </ | ||
| + | |||
| + | VM details: | ||
| + | <code bash> | ||
| + | nova show 2ac6ec4b-eaf4-440a-aac4-46d3cdf6e19b | ||
| + | </ | ||
| + | <code bash> | ||
| + | nova diagnostics < | ||
| + | </ | ||
| + | |||
