Red Hat Linux 8 Template or Metadata? [message #2175] |
Thu, 23 March 2006 20:30 ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
wnpaul
Messages: 15 Registered: March 2006 Location: Vienna, Austria
|
Junior Member |
|
|
I need to keep some apps running in a RHL8 environment and thought of moving them to a VPS -- does anyone have what it takes to build a RHL8 VPS?
Thanks,
Wolf
Wolf N. Paul - Doulos Communications
Vienna, Austria
|
|
|
Re: Red Hat Linux 8 Template or Metadata? [message #2178 is a reply to message #2175] |
Thu, 23 March 2006 22:14 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
|
That could be done.
You have two options -- moving your existing physical server into a VPS (a.k.a. P2V migration), or creating a template of RHL8, then creating a VPS, and finally installing your application into that VPS.
P2V is easier than you think. Basically, you need to rsync your whole server into a directory.
(1) Do stop all the sensible applications on your physical server before that (like a database), so data will be consistent. It is actually recommended to stop everything but ssh, in case you are not sure.
(2) Rsync the entire server into a directory on your OpenVZ box, like /vz/private/456/
(3) Modify a few files under /vz/private/456 so it will suit a virtual environment. First is /etc/fstab -- comment out all the mount entries which deals with real devices (such as /dev/hd* and /dev/sd*). Second is /etc/inittab -- comment out *getty entries, as there are no consoles in a VPS. For RHL8 this should be sufficient, or probably there is something else I forget about...
(4) Create a VPS config, like this:
vzctl set 456 --applyconfig vps.basic
Then, assign an IP for the VPS (vzctl set 456 --ipadd x.x.x.x).
(5) Try to start your VPS:
vzctl start 456
(6) Enter a VPS and troubleshoot for the problems. Most probably, you need to increase some UBC parameters (if failcnt>0 for some entries in /proc/user_beancounters). Search this forum for the detailed info of how to tune UBCs.
Kir Kolyshkin
|
|
|
Re: Red Hat Linux 8 Template or Metadata? [message #2185 is a reply to message #2178] |
Fri, 24 March 2006 08:08 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
wnpaul
Messages: 15 Registered: March 2006 Location: Vienna, Austria
|
Junior Member |
|
|
Do I gather from this that it should be possible to create a VPS of ANY Linux distro by doing a minimal install for example in a VMware (sorry to mention the competition), and then rsyncing or otherwise copying it into $VZROOT/private/SOMEID?
Can one create a template from such a VPS? How?
Is there some document which describes how one creates the metadata for a distro?
BTW, so far I am very impressed both with the product and with the quality of the responses I see in the forum.
Wolf N. Paul - Doulos Communications
Vienna, Austria
[Updated on: Fri, 24 March 2006 08:11] Report message to a moderator
|
|
|
Re: Red Hat Linux 8 Template or Metadata? [message #2186 is a reply to message #2185] |
Fri, 24 March 2006 08:27 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
|
Yes, it is possible to create a template or a VPS from any Linux distro. Basically, the only requirements are it should be compatible with kernel 2.6, and boot scripts should work without console (say, in SUSE you have to comment out one line in /sbin/rc script). Some distros (SUSE again) also require sysfs support (networking won't start without /sys); as sysfs is quite resource hungry, it is currently only turned on for suse unconditionally.
A template can be created from a VPS by just tarring its private area, like that:
vzctl stop 456
cd /vz/private/456
tar czf /vz/template/distroname-version-arch.tar.gz .
Note that vzctl has a number of configs scripts to support different distros (in /etc/sysconfig/vz-scripts/dists) -- this is mostly for networking configuration inside a VPS. Thus, vzctl has to know what distro it is; so you should name your template cache file (the tarball) accordingly (say, "slackware-..."). In case you use a distro with quite a different networking setup inside, you have to create your own script (or file a bug).
Speaking of metadata, now it can be created only for distros that have yum-enabled repository of packages. So, you are unlucky with RHL8; still if you put all the packages to some place and run createrepo on that, you already have a repository and thus can try to create metadata for RHL8. There is no much documentation on it -- so just look at the metadata for some other distro and use it as a template/example. It is not that complex as it seems to be, if you know yum a bit and some shell scripting (there a a few small scripts in metadata, to do some little pre- and post-install tricks).
Kir Kolyshkin
|
|
|
|
|
Re: Red Hat Linux 8 Template or Metadata? [message #2190 is a reply to message #2189] |
Fri, 24 March 2006 13:40 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) |
wnpaul
Messages: 15 Registered: March 2006 Location: Vienna, Austria
|
Junior Member |
|
|
Thank you for the link.
Since they carefully tell you how to upgrade your RPM and how
to install the freshrpms yum, I think it probably is compatible
with modern yum and vzyum ![Smile](images/smiley_icons/icon_smile.gif)
But I will create my own. Thanks again.
Wolf N. Paul - Doulos Communications
Vienna, Austria
|
|
|