Ask Your Question
0

How can I migrate a VM running in a KVM hypervisor to another KVM hypervisor?

asked 2014-04-04 04:42:41 -0500

owachari gravatar image

updated 2015-04-03 17:04:00 -0500

sgordon gravatar image

I have a VM running in a region server in SmartCloud Orchestrator 2.2 and I want to use it in the SmartCloud Orchestrator 2.3.

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
2

answered 2015-04-03 05:27:11 -0500

RHK gravatar image

Live migration of an openstack virtual machine is possible. But for that you need to implement shared storahe (ex in my case NFS)

adding the following to the /etc/nova/nova.conf file:

live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_TUNNELLED

On the NFS server/controller node, take the following steps:

1.  Install the NFS server.

2.  To share /var/lib/nova/instances, add the following to /etc/exports:
vim /etc/exports
/var/lib/nova/instances 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)

3.  Set the ‘execute’ bit on your shared directory as follows, so that qemu can use the images within the directories when exported to the compute nodes.
chmod o+x /var/lib/nova/instances

4.  Restart the services.
service nfs-kernel-server restart

On each of the compute nodes, take the following steps:

1.Install the NFS client services.

2. Mount the shared file system from the NFS server.
        mount 192.168.1.75:/var/lib/nova/instances /var/lib/nova/instances

3.  To save from retyping this after every reboot, add the following line to /etc/fstab:
192.168.1.75:/var/lib/nova/instances /var/lib/nova/instances nfs auto 0 0

4.  Check on all the compute nodes and ensure the permissions are set as listed below. This indicates that the correct permissions are set on the controller node with the chmod +x command above.

ls -ld /var/lib/nova/instances/

[Note: if user & group is other than nova nova or uid / gid of controller node please run below cmd chown nova:nova /var/lib/nova/instances ]

5.  Ensure that the exported directory can be mounted and check that it’s mounted.
df -k

Live migration of an OpenStack virtual machine

1.  Check the running instances to determine their IDs.

    nova list

+--------------+--------+--------+------------+-------------+---------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------+--------+--------+------------+-------------+---------------------+
| a1564ec8-... | dstest | ACTIVE | - | Running | testnet=192.168.1.2 |
+--------------+--------+--------+------------+-------------+---------------------+

2.  Check to see the compute nodes where the instances are running.
nova-manage vm list

3. nova live-migration dstest node10

4.  Verify that migration has been performed by running:
nova-manage vm list

Regards,
RHK

edit flag offensive delete link more
1

answered 2015-04-03 03:46:30 -0500

Do you mean a live migration or a simple one (implying a shutdown of the VM). If the latter is OK:

  • shutdown your VM
  • create a snapshot
  • copy the glance image related to that snapshot in your new SmartCloud Orchestrator 2.3
  • start a new VM from that glance image
edit flag offensive delete link more

Comments

I was going to say the same thing - NFS is just another layer of complexity I'd rather not deal with... Taking a snapshot not only gives you a backup on volume storage in case migration has issues, but is the easiest solution for a novice end user

ethode gravatar imageethode ( 2015-04-03 20:09:25 -0500 )edit
0

answered 2015-04-03 06:26:48 -0500

For live migration: You need shared storage, like Ceph. Configure according to the docs and you may need to use 'nova live-migrate' command.

For offline migration: You can use 'nova migrate'. You may need to setup password less ssh between your compute nodes to do this.

Also when a compute node went down entirely and shared storage is used , you can use 'nova evacuate'.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-04-04 04:42:41 -0500

Seen: 668 times

Last updated: Apr 03 '15