Hi all, I'm getting started with openvz, it looks very interesting. I have the 2.6.16 vz kernel compiled and booted on my HN, and I also installed vzctl, from source. I have a small custom built distro in a tar.gz. It has no RPMS or package management, only directories and files. I have no idea how to construct an install template from it. I want to unpack it into a /vz directory, and then boot it as a VPS. Is that possible, without templates? Or maybe a null template?
you just need to extract your .tar.gz to /vz/private/<VPSID> and create a config for it (for example, copy the existing one). after that just check that you have /vz/private/<VPSID>/bin/init, i.e. you extracted correctly and try to start your new VPS. I suppose there will be some problems with networking if your distro is too much different from FC/RHEL/Debian etc. but it can be fixed with creation of custom vzctl scripts.
dev wrote on Tue, 09 May 2006 11:01 you just need to extract your .tar.gz to /vz/private/<VPSID> and create a config for it (for example, copy the existing one). after that just check that you have /vz/private/<VPSID>/bin/init, i.e. you extracted correctly and try to start your new VPS. OK, I will try that later. For now, I installed FC4 to see how everything fits together. Looks nice. This will be great for application testing! I don't understand the /vz/root mount though. I see where the files get installed to /vz/private, and when the VPS starts, the files also appear in /vz/root. But in the HN, "mount" does not show it. It's a mystery to me. Can anyone explain it?
it's quite easy. /vz/private contains private VPS files. /vz/root contains directory tree as VPS see it. e.g. you can construct /vz/root/VPSID with private VPS tree and mount some external trees there (e.g. NFS etc.). /vz/root/VPSID is mounted with simfs filesystem, which works on top of ext3/others and provides correct disk space information.
also note, there is no any magic, just 'mount' command doesn't show dirs which are not in /etc/mtab. you can check _all_ the real mounts with: # cat /proc/mounts
The mount is not shown in "mount" command output since "-n" option is used while mounting, thus the mount is not written to /etc/mtab. If you will look into /proc/mounts you will find that mount there.