RE: [Vserver] Building vserver from skeleton

From: <smagnuson_at_forzani.com>
Date: Thu 18 May 2006 - 17:43:41 BST
Message-ID: <511A30B014A7DF42902B680EA85C07DC089E5136@CALMAIL01.fglcorporate.net>

If you are trying to take a physical server and make it a vserver here
are the steps I used. In this case the physical host was a redhat
advanced server 3.0 update 4.

Hope it helps
Sig

Creating a vserver from a non-vserver host

    * Clone host1 (non-vserver) to host2:vserver1

calcrs03 --> calvunix02:rhas3template01

ssh calvunix02
sudo /etc/rc.d/rsyncd start
sudo vserver vrhas3template01 build -m skeleton -n vrhas3template01
--context 30 --hostname vrhas3template01.corporate.net --interface
172.27.10.206 --netdev eth0 --netmask 255.255.248.0 --initstyle plain

ssh calcrs03
cat /home/sig/rsync-exclude.txt
/u01/
/u02/
/u03/
/u04/
/u05/
/u06/
/u07/
/u08/
/u09/
/u10/
/u11/
/u99/
/unix_data/
/proc/
/dev/
/boot/

sudo rsync -avz -e ssh --exclude-from=/home/sig/rsync-exclude.txt /
calvunix02:/vservers/vrhas3template01

ssh calvunix02
sudo vi /vservers/vrhas3template01/etc/resolv.conf
sudo vi /vservers/vrhas3template01/etc/fstab
sudo vi /vservers/vrhas3template01/etc/hosts
sudo vi /vservers/vrhas3template01/etc/ssh/sshd_config
X11UseLocalhost no - Needed for vserver x forwarding
sudo vi /vservers/vrhas3template01/etc/sysconfig/network
set hostname
sudo vi /vservers/vrhas3template01/etc/rc.sysinit
remove mtab references
remove tty references
sudo vi /vservers/vrhas3template01/etc/inittab
remove tty references
check over /usr/local/etc/vservers/vrhas3template01/..

sudo vserver vrhas3template01 start
sudo vserver-stat
sudo vserver vrhas3template01 enter

-----Original Message-----
From: vserver-bounces@list.linux-vserver.org
[mailto:vserver-bounces@list.linux-vserver.org] On Behalf Of Fareha
Shafique
Sent: Thursday, May 18, 2006 9:43 AM
To: vserver@list.linux-vserver.org
Subject: Re: [Vserver] Building vserver from skeleton

Xavier Montagutelli wrote:

>On Wednesday 17 May 2006 16:20, Fareha Shafique wrote:
>
>
>>Hi,
>>
>>I want to try to build a few vservers from a host template and then
>>unify these vservers. I'm not sure what files I need to include in the
>>template. I tried to create one vserver like this but I cannot start
it.
>>I get the following error:
>>-------------------------
>># vserver sk start
>>No command given; use '--help' for more information.
>>
>>An error occured while executing the vserver startup sequence; when
>>there are no other messages, it is very likely that the init-script
>>() failed.
>>
>>Common causes are:
>>* /etc/rc.d/rc on Fedora Core 1 and RH9 fails always; the 'apt-rpm'
build
>> method knows how to deal with this, but on existing installations,
>> appending 'true' to this file will help.
>>
>>Failed to start vserver 'sk'
>>---------------------
>>
>>
>
>What is "sk" ? Your "host template" or the first vserver based on the
>template ?
>
>Could you tell us more precisely how you created the vserver you call
your
>"host template" (I suppose it is a normal vserver that you won't run) ?
I
>think this one should be constructed as a normal vserver, for example
with
>standard methods (vserver my_template build -m <your_method> ....)
>
>How do you create the actual vservers from the template : do you use
>vserver-copy, something like http://www.micropp.se/vserver/vcopy ?
>
>
Well I found a thread in the mailing list archive that said:
"- reserve space on your /vservers partition for a template
- dump/restore or cp -va or whatever, your existing host system there
- cleanup the template with simple chroot, i.e. remove packages and
stuff you won't need in a guest, adjust the startup/shutdown scripts to
avoid hardware stuff
- clear out /proc and /dev inside the template
now this is only required once, and will save you a lot of space later
...
to create a new guest, use the 'skeleton' method with all the desired
config options, then copy over the template into the skeleton guest dir"

So what I did was copied my host system into a directory (called it
template). I used the skeleton method to build a guest called sk (with
appropriate interface and hostname given). Then I copied the template
into the guest. I think where I went wrong is the cleanup of the
template, I'm not sure what I should clean out and what I should leave.
I think I have either left some scripts that are not needed or deleted
something that is needed, but I don't understand what.
Any help would be appreciated.

Thanks,
-FS

>
>
>>I'm using Fedora Core 4 (2.6). I have been able to successfully build
a
>>vserver using the yum method previously and starts fine.
>>Any help will be appreciated.
>>
>>Thanks,
>>-FS
>>
>>
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver

_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Thu May 18 17:47:28 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 18 May 2006 - 17:47:34 BST by hypermail 2.1.8