LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 02-05-2008, 03:45 PM   #1
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
Clone/duplicate a Xen VM / domU?


Hi,

I've googled around endlessly, and can't find anything - even in the Xen or OpenSuSE docs.

I'm running OpenSuSE 10.3 and Xen3.

Is there any way to clone or duplicate a virtual machine? And what would need to be done in terms of reconfiguration?

I'm looking to test a bunch of network monitoring applications, and compare them to each other. So I figured, given that I have a spare box with Xen on it, the easy way would be to install OpenSuSE 10.3 as a new Xen VM - a default installation for the "base" machine - and then make a copy of that for each package that I want to comparatively test. That would allow me to have a relatively level playing field for all of them (run one at a time with no other system load), as well as pause and restart them as needed. Most importantly, when I pick one of the four I'm looking at, I could just trash the other VMs and use the one I want.

Thanks,
Jason
 
Old 02-08-2008, 02:45 PM   #2
Pyrrhic
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Rep: Reputation: 0
Dear Jason:

I know it is a long time since you posted but this is still mysterious to many people. Xen no longer allows the simple copying of a disk image or other location of a guest domain (domU), followed by editing an existing config file or creating a new one in the - now legacy - standard location of:

/etc/xen/guestconfigfoo.sxp

As of 3.0.4 Xen configuration files are of the name config.sxp and are dynamically managed. Thus, hand-editing a config of this type is contra-indicated as it will be written over.

New tools to manage Xen Guest domains include:

virt-viewer
virt-install
virt-image

...and, yes, "virt-clone."

These tools are evolving and it is best to get the latest versions at:

http://virt-manager.et.redhat.com/index.html

virt-clone the tool that you are interested in is installed with 'virt-install' - I strongly suspect that your system already has these tools installed. virt-clone can run interactively or you can feed it command line parameters - and they are pretty simple. It deals with sticky little details like unique MAC address, UUID etc. Nice...

There should also be a man page on your system...well I hope...and you can find it on the internet as well it will be something similar too:

virtinst/man/en/virt-clone.1


Currently, I am having a problem with virt-clone, alas, but when it is working right it is a great boon, especially with the changes in the way configs are managed in Xen.

I hope that this helps a little, Jason or at least someone else!

Best,

Pyrrhic
 
Old 02-08-2008, 03:39 PM   #3
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Original Poster
Rep: Reputation: 31
Thanks for the info!

I'm running Xen 3.1.0 under OpenSuSE 10.3, but the only virt-* tool that I see installed is virt-manager. I'll look into finding a RPM.
 
Old 02-09-2008, 12:39 PM   #4
Pyrrhic
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Rep: Reputation: 0
More on Xen Cloning - post 3.0.4

Dear Jason:

If your system created its domU (..or domU's_) with virt-install, you will find the config.sxp at:

/var/lib/xend/domains/ ...your DomU's UUID #/config.sxp

...this is the new default location for .sxp (ie Xen config) files. IF you open the file you will note that it is no longer in Python format. Again, not a file to edit directly.

I continue to have trouble with virt-clone and if you find that you have trouble, as well, on your system, just write, I am under great pressure to update my Xen cloning knowledge and will know more, I hope, in the next several days. It looks as if I should post a 'how to' on cloning DomU's post-3.0.4, as soon as I have answers to my virt-clone bug problem!

Best,

P.

P.S. - don't know about an rpm but what about YaST, if you are using SuSE?
 
Old 04-08-2008, 02:16 PM   #5
Pyrrhic
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Rep: Reputation: 0
Dear Jason:

Sorry for the long wait for a further post - events (...and illness...) overtook me. virt-clone is now working properly, slip-stream fixes have been done. If your version does not work, get a new one, as per previous post. Now it is working I am able to clone a 10gig domU in a matter of a few minutes and the new guest is, immediately, ready to go!

Best,

Pyrrhic
 
Old 06-23-2008, 02:05 PM   #6
Boris.Grinac
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
Cloning XEN VM on OpenSUSE

Yes, Jason, documents are not available, but cloning a XEN VM is easy, trivial.

To clone a XEM VM:
1. Look into /var/lib/xen/images and find the directory where your original OS is installed. It is a good idea to have images directory on a separate partition, so that you can do the usual wonders with it, like mount, umount ...
2. Create a directory under images with the name of your clone VM.
3. Copy the template VM disk image or images is your original system have more virtual disk drives to the clone directory.
3. Now use the Create Virtual Machines tool and edit the default options for memory, processors and disks. Your new machine should have the same number of virtual processors as the original. Memory is not critical, so you can enter any good number. When you come to disks, you will see there is one disk already there, this is the one you copied.
4. Press Finish and your clone will start up. The problem with your clone is, specially with Windows, that it has the same machine name as the original, so change the computer name and maybe domain and reboot.
5. Enjoy


Quote:
Originally Posted by jantman View Post
Hi,

I've googled around endlessly, and can't find anything - even in the Xen or OpenSuSE docs.

I'm running OpenSuSE 10.3 and Xen3.

Is there any way to clone or duplicate a virtual machine? And what would need to be done in terms of reconfiguration?

I'm looking to test a bunch of network monitoring applications, and compare them to each other. So I figured, given that I have a spare box with Xen on it, the easy way would be to install OpenSuSE 10.3 as a new Xen VM - a default installation for the "base" machine - and then make a copy of that for each package that I want to comparatively test. That would allow me to have a relatively level playing field for all of them (run one at a time with no other system load), as well as pause and restart them as needed. Most importantly, when I pick one of the four I'm looking at, I could just trash the other VMs and use the one I want.

Thanks,
Jason
 
Old 01-13-2010, 03:07 AM   #7
ericzqma
LQ Newbie
 
Registered: Jan 2010
Location: Hong Kong
Distribution: Fedora
Posts: 15
Blog Entries: 1

Rep: Reputation: 1
I manage the VMs in our small cluster. I usually duplicate the DomU VMs by copying the virtual disk and change the config files. And I usually create and start DomUs by "xm create". I know this is the old method. But it runs very well in our platform (kernel 2.6.29, xen 3.4.1). I find the method in this post is different. So I post my method here: http://fclose.com/b/linux/605/how-to...tual-machines/. Hope it is helpful.

Last edited by ericzqma; 03-10-2011 at 01:21 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install Fedora as DomU of Xen treotan Ubuntu 1 02-08-2008 02:57 PM
powering off Xen dom0 domain: not working after starting domU Pearlseattle Linux - Server 0 11-12-2007 12:37 PM
LXer: Install Xen 3.1 Solaris domU (64 bit) under CentOS 5 dom0 (64 bit) LXer Syndicated Linux News 0 09-21-2007 12:00 AM
Xen domU and Lvm flamy Linux - General 3 11-25-2006 11:16 AM
SuSE 10.1 / Xen / no network connection in DOMU zeichensatz SUSE / openSUSE 0 07-26-2006 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration