One of our clients had been running OVM 2.2 for several months after we set them up. They are running a database VM and a couple of application VMs.
After they heard of the release of OVM 3.0 they were really keen on getting that installed. I put them off for as long as I could to ensure stability, but I couldn’t hold them off any longer, and I have just completed the migration.
http://www.davemalpass.com/words/?p=154 was a great help, but this is what I did:
I grabbed a large external USB hard drive, shutdown all the VMs on 2.2 and copied all the OVS repositories on to this hard drive, I figured if it all went bad, I could always just reinstall OVM 2.2 and copy the repositories back on.
I then installed OVS 3.0.3, hoping I would still have access to the USB drive; I didn’t. I did a little debugging but wasn’t able to figure it out with in a short time, so I just moved it to another machine.
With OVS installed, I then proceeded to install OVM . I did this on another VM server and used the Oracle 11G database template upgraded to OL 5 latest as Oracle is yet to release a VM template for OVM 3. With OVM talking to OVS, I proceed to import the VMs from OVM 2.2. I proceed to tar-gzip up the vm.cfg and disk images within their own directory under running_pool:
# tar -zcf 02_myvm.tar.gz 02_myvm
I then used the basic python HTTP server to serve them up and import them as templates:
# python -m SimpleHTTPServer
For VMs that had very large data (non-root) disks, I edited the vm.cfg removing the reference to it and then moved the large disk image out of the directory before creating the tar-gzip archive.
I would then import the VM and then the disk image and put them back together within OVM 3.0.3.
Once you import the VM you have to clone from a template to a new Virtual Machine. This is OK, since you can do a ‘sparse’ copy. I deleted the template after the clone was complete.
So I have all the old VMs up and running, except the manager is not back on this server as a VM. To put this back on I basically did a baremetal Linux migration.
I created a blank VM and booted into rescue mode from an Oracle Linux 5 install disk. A created the disk layout and file-systems and started a rsync server.
After this I shutdown OVM and the DB and did an rsync for each filesystem on to the new VM still booted in rescue mode. Installed grub fixed up a few config files and rebooted.
The last item to migrate was the ASM devices, and I did that like so:
On the new VM run netcat:
# nc -l 4444 | gunzip -c | dd of=/dev/xvdb3
And on the original machine:
# time dd if=/dev/xvdb3 bs=4M | pv | gzip | nc 192.168.1.56 4444
Once the ASM devices were across I started up the database and OVM, success!
The last piece of the whole puzzle, is to get the OVM virtual machine to start automatically. Basically you can create a link in /etc/xen/auto:
# cd /etc/xen/auto/ # ln -s /OVS/Repositories/0004fb0000030000a1fdac7503adca25/VirtualMachines/0004fb0000060000c61ad649d9abf9ea/vm.cfg virt-01-manager