This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


RE: [Xen-users] Making system templates

To: "xen-users@xxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-users] Making system templates
From: Tait Clarridge <Tait.Clarridge@xxxxxxxxxxxx>
Date: Mon, 8 Jun 2009 16:34:15 -0400
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Mon, 08 Jun 2009 13:35:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <76BB7F270C366D47AA79851BB0B39D810299D43F@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <4A2D2246.2070607@xxxxxxxxxxxxxx> <76BB7F270C366D47AA79851BB0B39D810299D43F@xxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcnoRseLoYXiRII4QPeI7bEgzunIiQALx59gAABjCQA=
Thread-topic: [Xen-users] Making system templates
For my templates here (Windows XP/2003 Server/Linux/Solaris etc.) I make a copy 
of the disk image (not using LVMs so migration between servers is easier) once 
I have it configured to a "base" setting and have them sitting on an NFS share.

I created a script to be run on the Xen host that will ask for the amount of 
RAM/CPU, the name and which directory to copy it into. The script then copies 
the disk files and base config file, edits the config file to include the path 
to the disk file as well as how much RAM/CPUs the machine needs.

This makes for a 30 minute rollout for a new server from when I start the copy 
to renaming and handing over to the end user who requires it. I realize this 
doesn't help for you if you are using LVMS (which I think you are), but if you 
can agree on a uniform size for all your VMs you could DD the LVM partition 
into a file then DD it onto a new partition of the exact same size when you 
want to provision a new VM.

For example, our Windows Server 2003 VMs are 20GB in size, Linux is 20GB, XP is 

Then if you want to have more disk space, carve out another LVM and attach it 
to the domU in the config file. It tends to work really well here.


> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-users-
> bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of David Morris
> Sent: Monday, June 08, 2009 4:21 PM
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: RE: [Xen-users] Making system templates
> For linux templates (W/pvm), I use tar+gzip/bzip to preserve the
> contents of the drive. The script that provisions new VMs creates a new
> drive using lvm and untars the desired initialization contents. Size is
> determined before the untar operation so as long as the new lv is at
> least as large as the original volume, no problem. In this case the lv
> is a partition, not a drive so lvresize will work fine. No partition
> tables either. The LV just mounts on the Dom0 for setup.
> -----Original Message-----
> From: Jeff Williams [mailto:jeffw@xxxxxxxxxxxxxx]
> Sent: Monday, June 08, 2009 7:38 AM
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-users] Making system templates
> Hi,
> I am wanting to set up a bunch of system templates for my Xen servers,
> to save me from running some standard package installs and
> configuration. I can see 4 alternatives, but all seem to have issues
> and
> I'm wondering what works in practice:
> 1) LVM snapshot
> Problem with this is that I don't see any way to change the disk size
> of
> the new disk ever. Fast though.
> 2) New device and block level copy (dd)
> Seems to work fine, but the disk needs to be repartitioned and
> filesystem resized for bigger disks on the new guest. Takes a while.
> 3) New device and file level copy (cpio)
> Can completely change the partition scheme and filesystem. Complex to
> do
> from dom0. Slow.
> 4) virt-clone?
> I couldn't get this to work at all. Either the domU was running and I
> got "ERROR    Domain status must be SHUTOFF" or the domU was shutdown
> and I got "ERROR    Domain test is not found".
> Regards,
> Jeff
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users

Xen-users mailing list