[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Clone self-contained domU's


  • From: Thomas Goirand <thomas@xxxxxxxxxx>
  • Date: Fri, 23 Jan 2009 00:57:27 +0800
  • Cc: xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 22 Jan 2009 08:59:01 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=goirand.fr; h=message-id:date:from:mime-version:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=postfix; b= U4N3xWJwS4C6wfZCKxIRPi0Z6i3MXfxwgd1zfe9RRwEx0f44q0CnS2sW0tYonJkW 0inUwoHUO1FVIbb/v57wOdffXWWZ+JRY1dNRQ+0/9QZ88fx11b0EwovQZUkuAcR3 zOBy0b/I3u8TPKPVeBPFPfZt08yMe0qtxlY7Z7yreSw=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>
  • Openpgp: id=98EF9A49

Ferreira, N. L. (Nuno) wrote:
> Dear *, again
> 
> My goal:
> install a PV self-contained guest (i.e. kernel on domU with guest config
> file using pygrub as bootloader) inside LVM logical volumes on dom0, and
> use it as a pristine template for other VM's
> 
> What I did till now, just for reference (LVM already in place as well as
> needed LV's) :
>      domU installation
> 1 - virt-install -n vm1 --nographics -p -f  /dev/vgxen/vm1 -l
> http://..... -r 1024
> 2 - xm create -c vm1 [runs ok]
> 
>    domU tweekings (with Fajar's help)
> 1 - xm shutdown vm1
> 2 - kpartx -av /dev/vgxen/vm1
> 3 - mount /dev/mapper/vm1p1 /mnt/vgxen/vm1
> 4 - cd /mnt/vgxen/vm1; and tweek things here
> 5 - cd; umount /mnt/vgxen/vm1
> 6 - kpartx -dv /dev/vgxen/vm1
> 
> 
> So far so good.
> And now here's my naive question.
> What's the best way to clone this self-contained domU, and populate
> another, say, logical volume?

# This creates a new VPS with space for 25G
# note that your template vm1 should be smaller
# than the target vm2
lvcreate -L25G -nvm2 vgxen
cat </dev/vgxen/vm1 >/dev/vgxen/vm2
fsck.ext3 -f -y /dev/vgxen/vm2
resize2fs /dev/vgxen/vm2
mkdir -p /mnt/vgxen/vm2
mount -t ext3 /dev/vgxen/vm2 /mnt/vgxen/vm2
<tweaks (change IP adddress, hostnames, etc.)>
umount /mnt/vgxen/vm2

then create the xen startup file in /etc/xen and xm create...

Thomas

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.