OpenVZ Forum


Home » General » Support » *SOLVED* Create FC6 Template
*SOLVED* Create FC6 Template [message #11062] Mon, 12 March 2007 21:20 Go to next message
Olate is currently offline  Olate
Messages: 5
Registered: March 2007
Junior Member
If I wanted to create my own Fedora Core 6 template, what would be the best way of going about it?

[Updated on: Mon, 19 March 2007 07:50] by Moderator

Report message to a moderator

Re: Create FC6 Template [message #11074 is a reply to message #11062] Tue, 13 March 2007 08:35 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
I think, you can install fc-5 template and update it to fc-6 as while usual node upgrade: fc-5 -> fc-6

HTH,
Vasily.k
Re: Create FC6 Template [message #11153 is a reply to message #11062] Wed, 14 March 2007 12:40 Go to previous messageGo to next message
Alexandr Andreev is currently offline  Alexandr Andreev
Messages: 35
Registered: October 2006
Member
You can also read http://wiki.openvz.org/Debian_template_creation
and http://wiki.openvz.org/Slackware_template_creation to understand how to create a template from __any__ Linux distributive.

The main problem is to create FC6 rootfs image. If you have a rootfs image, you have everything to make your own template.

To create any rootfs you can:

1. Install vmware (or get a real host/new HW disc);
2. Install any linux distributive on it. Use minimal installation!
3. Make tgz image of root filesystem on your target PC (vmware) (tar czf /rootfs.tgz --exclude /rootfs.tgz /)
4. Copy this image to a host, where openvz is installed. (You can copy it by network or flash and so on...)
5. Choose some VEID, to use (assume 777)
6. Untar your rootfs image on a host with OpenVZ:
# cd /vz/private/777
# gunzip -dc rootfs.tgz |tar -xvf -
# rm /vz/private/777/rootfs.tgz
7. Make config for this VE
# vzctl set 777 --applyconfig vps.basic --save
8. ...
Read wiki pages above to see all next steps required

[Updated on: Wed, 14 March 2007 12:41]

Report message to a moderator

Re: Create FC6 Template [message #11160 is a reply to message #11062] Wed, 14 March 2007 13:55 Go to previous messageGo to next message
rward is currently offline  rward
Messages: 2
Registered: March 2007
Location: CapeTown, South Africa
Junior Member
I've installed Centos 4.4 on my machine.
I then try follow the instructions above and get an error doing the
tar czf /rootfs.tgz --exclude /rootfs.tgz /

It ends with:
tar: /proc/8207/exe: Cannot readlink: No such file or directory
tar: /proc/10461/task/10461/fd/3: Cannot stat: No such file or directory
tar: /proc/10461/fd/3: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

If I continue anyway then when I untar the file it doesn;t have the /etc or /usr or a couple other directories.

Whats the correct way to run the tar?
Re: Create FC6 Template [message #11167 is a reply to message #11160] Wed, 14 March 2007 14:31 Go to previous messageGo to next message
Alexandr Andreev is currently offline  Alexandr Andreev
Messages: 35
Registered: October 2006
Member
First of all, I forget to mention, that it's better to use runlevel 1 while making rootfs tar image. In the runlevel 1 all daemons are stopped and not so much processes are executed. This let us be sure, there are no any temporary files, such as lock's for example.

Startup from /bin/bash instead of /sbin/init is even better! In this case, your machine will be as 'clean' as possible. To start /bin/bash as initial process, do the followings:

1. reboot your host, add init=/bin/bash command line to the kernel (if you use grub, press 'e', 'e' again, add 'init=/bin/bash' to the command line, press 'b' to boot your image with this command line). With lilo just press 'TAB', type 'init=/bin/bash' and press ENTER.

2. When you boot your host, NO any process are executed at all, except /bin/bash and few kernel threads. /proc filesystem is also not mounted.

3. you have to remount your / partition read/write:
# mount -o rw,remount /

4. Now you can just use:
tar czf /rootfs.tgz --exclude /rootfs.tgz /

----------------------------------------------------

You may also just skip /proc directory when making tar image, so actual command will be in your case:

tar czf /rootfs.tgz --exclude "/rootfs.tgz" --exclude "/proc" /
Re: Create FC6 Template [message #11257 is a reply to message #11062] Fri, 16 March 2007 10:17 Go to previous messageGo to next message
multik is currently offline  multik
Messages: 6
Registered: February 2007
Junior Member
http://bugzilla.openvz.org/show_bug.cgi?id=463
Re: Create FC6 Template [message #11262 is a reply to message #11257] Fri, 16 March 2007 11:29 Go to previous message
rward is currently offline  rward
Messages: 2
Registered: March 2007
Location: CapeTown, South Africa
Junior Member
managed to get round it - thanks for the help.
My tar command ended up:

tar cvf rootfs.tar --exclude "/rootfs.tar" --exclude "/proc" --exclude "/sys" --exclude "/vz"

I ran that after doing an init 1.

Later, when I extracted the tar file into the /vz/private/xxx/ directory I had to "touch /dev/*/*" else it complains about files being "ahead of time" and doesn't work properly.

I'm still al ittle stuck with a config file problem but should be solving that soon.
Previous Topic: *SOLVED* env_create error: Resource temporarily unavailable
Next Topic: *SOLVED* new kernel-smp-2.6.18-ovz028stab021.1.x86_64
Goto Forum:
  


Current Time: Sat May 25 21:15:00 GMT 2024

Total time taken to generate the page: 0.00468 seconds