|
|
|
|
|
|
|
|
|
|
xen-users
Re: [Xen-users] Clone self-contained domU's
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
|
|
|
|
|