Spread Linux

Categories


Recent Comments:



FeedWind
FeedWind
Get Linux

Baudizm at Blogged

July 30, 2008

Quick way to start Xen virtual machines on bootup

Filed under: Linux, Tips and Tricks - baudizm @ 5:38 pm

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

mybox:~ # cd /etc/xen/vm

2. 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_config

Make sure that you have a backup of the exported config before editing.

mybox:~ # cp yourVM_config yourVM_config.backup

Edit your VM config using vi and look for the following parameters:


(on_xend_start ignore)
(on_xend_stop ignore)

and change them to


(on_xend_start start)
(on_xend_stop shutdown)

Save your file, then let’s export it back to our Xen server using the following command:

mybox:~ # xm new -F yourVM_config

That’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!

Technorati Technorati , , , , , ,
Site Search Tags: , , , , , ,


1 Comment »

The URI to TrackBack this entry is: http://baudizm.blogsome.com/2008/07/30/quick-way-to-start-xen-virtual-machines-on-bootup/trackback/

  1. I tried the second version but the “new” command doesn’t exist in xm on Ubuntu.

    Thank you for publishing and best regards

    Comment by Jean Paris — September 30, 2008 @ 8:09 pm

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Get free blog up and running in minutes with Blogsome | Theme designs available here