|
|
|
|
|
|
|
|
|
|
xen-users
Re: [Xen-users] Templates or cloning domUs
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
|
|
|
|
|