[xen-tools-discuss] Question about cloning a VM using the --tar and --copy options
Axel Beckert
abe at deuxchevaux.org
Thu Jun 28 10:55:53 CEST 2012
Hi Yuvraj,
On Wed, Jun 27, 2012 at 06:32:56PM -0700, Yuvraj Agarwal wrote:
> I am new to this list, so please let me know if there is a better place to
> post this question. I have been using xen-tools often and have just updated
> our Xen installation to Xen 4.1.2 and the xen-tools that comes with the
> Ubuntu 12.04 (64bit) distro - which i think are v 4.2.1.
The 4.3 .deb for the PPA is still missing. I may release have to
release a 4.3.1 which fixes some testsuite issues, this time with 32
bit architectures. And since Ubuntu builds their .debs for the PPAs on
32 bit...
The 4.3 .deb is also available from
http://xen-tools.org/software/xen-tools/releases.html so anyone who
needs to install Precise DomUs should consider using that one. I'll
(try to :-) update the PPA as soon as I got the next release out.
> I was trying to find out examples of cloning an existing VM to create a new
> VM, but was unable to find it.
I must admit, I always did this manually before, either with dd or
lvcreate -s for the image and cp for the config file. But I do see
that you may want to have the whole machinery running which modifies
the installation.
> For example, I have a VM image created (testvm2) that has a disk image
> (file backed: disk.img) and a swap file (file backed: swap.img) using
> xen-create-image. This image uses pygrub and also runs Ubuntu 12.04 (32
> bit) in the domU. I have customized it in various ways and next I want to
> create a clone of this VM image quickly, lets say "testvm3" and make
> whatever changes I need to it so that the two images are distinct and can
> both run *simultaneously*. It seems like I should be able to do the
> following:
>
> 1. I tarred up the disk.img file and named it:
> /home/xen/testvm2-disk.img.tar
That doesn't work. The tar file xen-tools expects should contain the
contents of an installed system (i.e. files like /bin/ls, /bin/cp,
etc.), not an block device image as file.
> 2. xen-create-image --hostname=testvm3 --size=2G --swap=128M
> --ip=10.16.17.67 --netmask=255.255.255.0
> --gateway=10.16.17.1 --force --bridge=eth0-br --dir=/home/xen --memory=64M
> --install-method=tar --install-source=/home/xen/testvm2-disk.img.tar
>
> That does not seem to work and fails with the following error. Any thoughts
> on how to fix this will be appreciated.
You are not the first one asking for or expecting such a feature, see
http://bugs.debian.org/377984 (I think installing from an image and
duplicating a DomU is quite similar.)
I will think about I can best implement such a feature, but I can't
promise anything. I'm open for suggestions (and patches :-) though!
Kind regards, Axel
--
/~\ Plain Text Ribbon Campaign | Axel Beckert
\ / Say No to HTML in E-Mail and News | abe at deuxchevaux.org (Mail)
X See http://www.asciiribbon.org/ | abe at noone.org (Mail+Jabber)
/ \ I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)
More information about the xen-tools-discuss
mailing list