[xen-tools-discuss] Question about cloning a VM using the --tar and --copy options
Yuvraj Agarwal
yuvraj at cs.ucsd.edu
Thu Jun 28 20:28:16 CEST 2012
Hi Axel,
Thank you for the response. Some more questions inline.
>
> 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 am using Precise Pangolin - Ubuntu 12.04 (64bit) as the dom0. Will the
PPA eventually have precise (12.04) packages too? I tried to follow the
instructions on your Launchpad/ppa website,
https://launchpad.net/~xtaran/+archive/xen-tools and add the repo "*
ppa:xtaran/xen-tools"*. However when I do an "apt-get update" to get the
updates it throws an error. That is probably because there are no 12.04
packages yet? Also, it seems like the xen-tools package builds failed?
Could I just get the source or the .deb from the xen-tools website and
install it? It will clobber the current Ubuntu installed version of
xen-tools (4.2.1) and not sure if that has any issues later...
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.
>
This is not a problem. I can also dd testvm2/disk.img (although dd will
expand the sparse disk image which is not ideal) to create a new VM testvm3
for example. But as you mention, I would still need to modify all the files
that make the two distinct. These include, /etc/hosts, /etc/hostname,
/etc/network/interfaces, and I am sure what other files also need to be
installed/edited. The OpenSSH generated keys for example also need to be
changed? I was hoping that the "copy" or the "tar" methods of install could
take of these things...
>
>
> 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.
>
> So, is the following the right way to do it then? I should probably remove
the /proc/ and /sys/ directories from the tar in Step (b) below?
(a) mount /home/xen/domains/testvm2/disk.img /mnt/baseimage -i loop
(b) tar cvf /mnt/baseimage.tar /mnt/baseimage
(c) 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=/mnt/baseimage.tar
> > 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.)
>
> Yes, I think the feature would be useful!
> 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)
> _______________________________________________
> xen-tools-discuss mailing list
> xen-tools-discuss at xen-tools.org
> https://xen-tools.org/mailman/listinfo/xen-tools-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://xen-tools.org/pipermail/xen-tools-discuss/attachments/20120628/02b9cd9e/attachment.html>
More information about the xen-tools-discuss
mailing list