'Vmotion' type migration of VMs
Posted: 2. Nov 2009, 08:32
I'm looking into the possibility of migrating VMs from one machine to another. The hardware is the same (both running Linux) and I have 3 local gig-e interfaces bonded together to provide a fast link between the boxes.
I've been writing some perl cgi that will allow a point a click migration of a VM between the hosts. The basic concept is:
(1) Save the state of the VM
(2) Use rsync to copy over the VM's 'Machines' subdirectory structure.
(2) Use rsync to copy over any DVD images and hard disk images used by the VM.
(3) Register the DVD and hard disk images on the remote machine (the one not currently hosting the VM)
(3) Edit the machine's XML file replacing the UUIDs of the DVD and hard disk images so that they match the UUIDs on the remote machine
(4) Rgisted the VMs XML file on the remote machine
(4) Start the VM
I've been testing with a Linux liveCD session to keep things fairly simple for now.
After step 3 I'm noticing that even once the DVD/CD image has been copied to the remote machine and registered in Virtualbox the DVD shows as 'not mounted'. I can actually start the live CD VM session and have it come up on the remote machine at the place where I saved it on the original host. The session does not work properly though as it expects to see the DVD/CD in order to be able to run properly. It doesn't take long beore somethign I do wants to access the DVD/CD and the session starts to deteriorate.
Any suggestions as to why the DVD/CD does not show as connected in the GUI of 'VBoxManage showvminfo' after I've edited the XML file to ensure the UUID matches a media entry in the virtual media manager? Is there another file that I perhaps need to edit to connect a particular virtual media entry to a VM? It seems editing a VMs XML file to have the UUID of the DVD/CD included in the appropriate section is not enough to update the Virtual Media Manager to show that that virtual media is connected to a particular VM.
Thanks in advance.
I've been writing some perl cgi that will allow a point a click migration of a VM between the hosts. The basic concept is:
(1) Save the state of the VM
(2) Use rsync to copy over the VM's 'Machines' subdirectory structure.
(2) Use rsync to copy over any DVD images and hard disk images used by the VM.
(3) Register the DVD and hard disk images on the remote machine (the one not currently hosting the VM)
(3) Edit the machine's XML file replacing the UUIDs of the DVD and hard disk images so that they match the UUIDs on the remote machine
(4) Rgisted the VMs XML file on the remote machine
(4) Start the VM
I've been testing with a Linux liveCD session to keep things fairly simple for now.
After step 3 I'm noticing that even once the DVD/CD image has been copied to the remote machine and registered in Virtualbox the DVD shows as 'not mounted'. I can actually start the live CD VM session and have it come up on the remote machine at the place where I saved it on the original host. The session does not work properly though as it expects to see the DVD/CD in order to be able to run properly. It doesn't take long beore somethign I do wants to access the DVD/CD and the session starts to deteriorate.
Any suggestions as to why the DVD/CD does not show as connected in the GUI of 'VBoxManage showvminfo' after I've edited the XML file to ensure the UUID matches a media entry in the virtual media manager? Is there another file that I perhaps need to edit to connect a particular virtual media entry to a VM? It seems editing a VMs XML file to have the UUID of the DVD/CD included in the appropriate section is not enough to update the Virtual Media Manager to show that that virtual media is connected to a particular VM.
Thanks in advance.