WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Templates or cloning domUs

To: Jeff Lane <sundowner225@xxxxxxxxx>
Subject: Re: [Xen-users] Templates or cloning domUs
From: Steve Kemp <steve@xxxxxxxxxxxx>
Date: Tue, 27 Jun 2006 20:43:44 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 27 Jun 2006 12:43:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <6025df6b0606271047u55d52128m92ceac994479e0d9@xxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <6025df6b0606271047u55d52128m92ceac994479e0d9@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Tue, Jun 27, 2006 at 01:47:49PM -0400, Jeff Lane wrote:

> Anyway, I have a machine that I want to be able to create a LOT of
> domUs.  The problem is, I cant just clone them...  its a SLES10 system
> and the domUs are being created (right now at least) through YaST.

  I don't see why the use of SLES10/YaST precludes copying them.

> I have seen only a little bit of documentation about templating, but
> nothing that really helps out in this.  I have also read a bunch of
> sites and threads about how to build them by hand using bootstrap or
> some other means...  that doesnt work.

  There isn't anything by definitive, but I think there are a lot
 of people with a similar need, albeit on a smaller scale.

> What I want to be able to do is build ONE domU and then create at
> least 20 - 30 copies of it.  I cant just copy the domU's filesystem
> and config file as they all end up with the same MAC address for the
> NIC.  Even changing that in the config file does not help as when I
> boot the copy with a config that has a MAC ending in 99:9f, it STILL
> shows the MAC of the original copy...

  Right.  What I do is this:

    1.  Create one perfect installation on a loopback file, or
       in an LVM partition.

    2.  Create the matching Xen configuration file ensuring that
       a MAC address is specified in the networking setup.

  Then for each copy I wish to make I run:

    1.  Mount the pristine image (read-only!)

    2.  Create a new loopback image/LVM partition.

    3.  Copy recursively from source -> dest.

    4.  Copy Xen configuration file to a new name, update the IP
       adddress + MAC address.

    5.  Invoke a script to setup the new copy of the pristine systems
       networking details.

    6.  Unmount both images.

  This is completely automated, unfortunately sharing the script to
 update the Debian networking wouldn't be useful since it just trashes
 /etc/network/interfaces - and that wouldn't apply to your SuSE system.

  If you sit down and thinkg about the things that need to change
 in your copies I'm sure you could automate it similarly.  I think
 that if you remember to give each instance a new MAC address in the
 *xen* configuration file you shouldn't have any issues - indeed if
 you setup your master image to fetch its networking details via
 DHCP you might not even have to modify them at all, except to
 setup a hostname.


Steve
-- 

    

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

<Prev in Thread] Current Thread [Next in Thread>