HOWTO: OpenVZ and Sabayon, a perfect match
Sabayon OpenVZ templates are being added to our build server and will be generated nightly based on DAILY SpinBase ISO images.
But what is OpenVZ?
“In short, OpenVZ is the only highly scalable virtualization technology with near-zero overhead, strong isolation and rapid customer provisioning that’s ready for production use right now. Deployment of OpenVZ improves efficiency, flexibility and quality of service in the enterprise environment.” [from: http://wiki.openvz.org/FAQ]
How does it work?
How do I install all the fancy stuff on Sabayon?
equo install sys-kernel/linux-openvz vzctl vzquota vzdump rc-update add vz default
You may want to turn NetworkManager off and switch to plain /etc/conf.d/net configuration (replace net.eth0 with your NIC id)
rc-update del NetworkManager default && rc-update add net.eth0 default nano -w /etc/sysctl.conf # and set net.ipv4.ip_forward=1 reboot
Remove the Sabayon standard kernel and drop all the proprietary/external_driver stuff
equo remove sys-kernel/linux-sabayon
OpenVZ will read configuration defaults from /etc/vz/conf/*-sample files [ve-light.conf.sample, ve-unlimited.conf-sample, ve-vps.basic.conf-sample], make sure to edit the desired file and tweak DISKSPACE and DISKINODES parameters to make your Sabayon OpenVZ template to fit (I advice to set DISKSPACE to at least 4194304:4612096 and DISKINODES to 800000:880000).
Now download, for example, the amd64 OpenVZ template from our mirrors: Sabayon_Linux_SpinBase_DAILY_amd64_openvz.tar.gz and place it into /vz/template/cache.
Now you’re ready to install the template!
vzctl create 101 --ostemplate Sabayon_Linux_SpinBase_DAILY_amd64_openvz \ --config vps.basic
NOTE: 101 is the so called “veid” that will be used to identify your virtual machine (it’s a virtual machine ID). You can omit the –config parameter or set it to “unlimited” (for unlimited virtual machine resources) or to “light“. But really make sure that the disk quota assigned to the veid is enough to make the .tar.gz content to fit.
You’re done! Just start the virtual machine with: “vzctl start 101” and enter it with “vzctl enter 101“. The newly created virtual machine will start at boot. If you want to change its settings (adding more RAM or disk space), you can either use “vzctl” or edit /etc/vz/conf/101.conf.
Have fun!