Quick way to start Xen virtual machines on bootup
Posted 08-01-2008 at 11:25 PM by hardwyrd
Just a quick tip.
You’re using SuSE Linux Enterprise Server 10 and you are using virtualization with Xen with a couple of virtual machines (DomU) and you are quite happy with how everything turned out. SLES10 is running ok, Xen works fine, DomU’s are healthy and serving as they should. Then again, you need to do a maintenance task and will need to reboot your machine. Then suddenly you found out that you need to manually start all your virtual machines manually! ACK!
Here are some quick steps to follow to make sure that your VMs go up and running as soon as your host OS gets up and running too.
1. On SLES10 terminal, go to /etc/xen/vm
Using xm, we will first export our existing (and running) config for one of our DomU (virtual machine) to a text config.
What I did is I combined the former step (using /etc/xen/auto) with the latter steps. So far, my VMs are all up and about when the host SLES10 finishes loading.
Regards and safe journey. Enjoy!
Originally posted at http://baudizm.blogsome.com .
You’re using SuSE Linux Enterprise Server 10 and you are using virtualization with Xen with a couple of virtual machines (DomU) and you are quite happy with how everything turned out. SLES10 is running ok, Xen works fine, DomU’s are healthy and serving as they should. Then again, you need to do a maintenance task and will need to reboot your machine. Then suddenly you found out that you need to manually start all your virtual machines manually! ACK!
Here are some quick steps to follow to make sure that your VMs go up and running as soon as your host OS gets up and running too.
1. On SLES10 terminal, go to /etc/xen/vm
mybox:~ # cd /etc/xen/vm2. All the definition files for your virtual machines are located there. You can then just copy all the files to /etc/xen/auto
mybox:/etc/xen/vm # cp * /etc/xen/auto/This is the old way of making your virtual machines start up automatically. Novell experts recommend using the xm command to make your virtual machine automatically start up. Though it’s a bit tedious but it works on the latest SLES10 builds. And you have to repeat the steps for every virtual machine that you want to automatically start up.
Using xm, we will first export our existing (and running) config for one of our DomU (virtual machine) to a text config.
mybox:~ # xm list -l yourVM > yourVM_configMake sure that you have a backup of the exported config before editing.
mybox:~ # cp yourVM_config yourVM_config.backupEdit your VM config using vi and look for the following parameters:
and change them to
(on_xend_start ignore)
(on_xend_stop ignore)
Save your file, then let’s export it back to our Xen server using the following command:
(on_xend_start start)
(on_xend_stop shutdown)
mybox:~ # xm new -F yourVM_configThat’s all there is to it. However, if you have 5 other virtual machines running, you will need to repeat these steps for each.
What I did is I combined the former step (using /etc/xen/auto) with the latter steps. So far, my VMs are all up and about when the host SLES10 finishes loading.
Regards and safe journey. Enjoy!
Originally posted at http://baudizm.blogsome.com .