From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Sat 13 Aug 2005 - 11:46:09 BST
On Sat, Aug 13, 2005 at 09:47:42AM +0200, Dirk Ruediger wrote:
> Hi Andreas,
>
> Andreas John schrieb:
> > Hello!
> >
> > Did anyone already create a sript that copies an existing guest to a new
> > name and changes ip/context/name etc. within (for debian in my case)?
>
> I'm using /usr/sbin/dupvserver from the "vserver-debiantools" package.
> Works very well. It should be in "stable".
the 'copy' part (for the configuration) from
vserver-debiantools 0.1.10 shows clearly that
it _only_ supports legacy config (which is
older than a year now and deprecated) ...
| if [ ! -r /etc/vservers/$TO.conf -o "$FORCE" = "yes" ] ; then
| cp /etc/vservers/$FROM.conf /etc/vservers/$TO.conf
| perl -pi -e "s#$FROM#$TO#g;" \
| /etc/vservers/$TO.conf
| if [ "$FROMIP" != "$TOIP" ] ; then
| perl -pi -e "s#$FROMIP#$TOIP#g;" \
| /etc/vservers/$TO.conf
| fi
| if [ "$FROMDEV" != "$TODEV" -a -n "$TODEV" ] ; then
| perl -pi -e "s#$FROMDEV#$TODEV#g;" \
| /etc/vservers/$TO.conf
| fi
| fi
also it seems to assume that you use a single
IP with a very specific network setup, otherwise
I would not see how it could work correctly ...
| FROMNAME=$S_HOSTNAME
| FROMIP=$IPROOT
| FROMDEV=$IPROOTDEV
| ;;
- it doesn't handle IPROOTMASK or IPROOTBCAST
- it doesn't handle more complex IPROOT setups
correctly like
eth0:192.168.0.1/255.255.255.0
and probably a bunch of other issues if you dig
into it ...
until a 'proper' solution is presented by Enrico
the 'best' way to copy a vserver guest is to do
it like this:
vserver <new> build -m skeleton ...options...
rm -rf /path/to/new
cp -va /path/to/old /path/to/new
unfortunately this will destroy external package
management and might have other unwanted sideeffects
and I really hope that there will be a proper
solution soon ...
best,
Herbert
> HTH
> Dirk
> _______________________________________________
> Vserver mailing list
> Vserver_at_list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver