First OpenVZ installation

  • user warning: Table 'cache' is marked as crashed and should be repaired query: SELECT data, created, headers, expire FROM cache WHERE cid = 'filter:1:022fabdf8e5ffb9089565d8773874009' in /home/dowdle/public_html/montanalinux/includes/database.mysql.inc on line 121.
  • user warning: Table 'cache' is marked as crashed and should be repaired query: UPDATE cache SET data = '<p>This weekend I finally got around to checking out <a href=\"http://openvz.org\" target=\"_new\">OpenVZ</a>. With lots of prodding from Scott, not to mention lots of help from Scott, I got this thing installed rather quickly. I pretty much followed Scott\'s latest article <a href=\"http://searchservervirtualization.techtarget.com/tip/0,289483,sid94_gci1237879,00.html\" target=\"_new\">Intro to OpenVZ: Part II</a>. I started with installing CentOS 4.4 using the custom minimalist install and updated everything. BTW this machine is an old Dell 2Ghz with 512MB RAM and 40GB drive. My plan is to actually use one of the virtual private servers (VPS) as a production backup server. Other VPS\'s would be just for fun and possibly exploration of other distributions.</p>\n<p>So in short after having my bare bones install here is my quick and dirty easy to follow steps from Scott\'s article:</p>\n<ol>\n<li>\n<pre>cd /etc/yum.repos.d</pre></li>\n<li>\n<pre>wget http://download.openvz.org/openvz.repo</pre></li>\n<li>\n<pre>yum install ovzkernel</pre></li>\n<li>\n<pre>nano -w /etc/sysctl.conf with these changes:</pre></li>\n<blockquote>\n<pre>\n# On Hardware Node we generally need\n# packet forwarding enabled and proxy arp disabled\nnet.ipv4.ip_forward = 1\nnet.ipv4.conf.default.proxy_arp = 0\n# Enables source route verification\nnet.ipv4.conf.all.rp_filter = 1\n# Enables the magic-sysrq key\nkernel.sysrq = 1\n# TCP Explict Congestion Notification\n# net.ipv4.tcp_ecn = 0\n# we do not want all our interfaces to send redirects\nnet.ipv4.conf.default.send_redirects = 1\nnet.ipv4.conf.all.send_redirects = 0\n</blockquote>\n<li><pre>Set the default kernel in grub to the new one</pre></li>\n<li>\n<pre>Reboot using the new kernel</pre></li>\n<li>\n<pre>yum install vzctl vzquota</pre></li>\n<li>\n<pre>service vz start</pre></li>\n<li>\n<pre>yum install vzpkg vzyum vzrpm43-python vzrpm44-python</pre></li>\n<li>\n<pre>yum install vztmpl-centos-4</pre></li>\n<li>\n<pre>nano -w /vz/template/centos/4/i386/config/default.list appending this:</pre></li>\n<blockquote>\n<pre>\nyum\nmc\nlinks\nsystem-config-date\nnano\n</blockquote>\n<li><pre>vzpkgcache -f centos-4</pre></li>\n<li>\n<pre>vzctl create 101 --ostemplate centos-4 --config vps.basic</pre></li>\n<li>\n<pre>vzctl set 101 --ipadd 192.168.0.101 --save</pre></li>\n<li>\n<pre>vzctl set 101 --hostname vps101 --save</pre></li>\n<li>\n<pre>vzctl set 101 --nameserver 192.168.0.1 --nameserver 192.168.0.2 --save</pre></li>\n<li>\n<pre>vzctl set 101 --userpasswd root:areallycoolpassword</pre></li>\n<li>\n<pre>vzctl set 101 --onboot yes --save</pre></li>\n<li>\n<pre>vzctl start 101</pre></li>\n<li>\n<pre>vzctl enter 101</pre></li>\n</ol>\n<p>Okay so that is it in a nutshell. Then this is where I start getting into trouble with my wild ideas. I mentioned wanting to make this my backup server and I normally use <a href=\"http://dirvish.org\" target=\"_new\">Dirvish</a>, but this time I want to try out <a href=\"http://backuppc.sourceforge.net\" target=\"_new\">BackupPC</a>. Now I also have a nice 300GB drive I have used for my backups and I planned on just mounting it inside this new VPS. Problem is I couldn\'t figure out how to give it enough diskspace quota. The most it would give was from my 40GB drive and that was a 34GB quota. So I called Scott and pretty much just decided to do LVM (logical volume management) and merge the drives together to make it look like one big drive. This however entailed starting from scratch again as I\'m pretty lazy when it comes to trying to figure out installing something like this after the fact.</p>\n<p>So I find my single CentOS CD and attempt to boot it but my crappy old Dell has an abused CD-R drive. So I borrow the one out of another Dell and off we go. So when I get back to the point I was last, I run this:</p>\n<blockquote>\n<pre>vzctl set 101 --diskspace 315621376:315621376 --save</pre></p></blockquote>\n<p>This gives me 301GB disk space to work with in my VPS. Problem is I was told by Scott there is an rpm for BackupPC but currently there are no rpm\'s for CentOS. So this brings me to another task... create another VPS with a distribution that includes rpm package management for BackupPC. I found out the hard way that these guys are yet another that uses caps in their package name and caused me a bit of headache searching for it.</p>\n<p>I picked FC-5 for the new VPS as it seems to be the latest to carry BackupPC. To do this I needed to build the template similar to building the CentOS template above.</p>\n<blockquote>\n<pre>yum install vztmpl-fedora-core-5</pre></p></blockquote>\n<p>The rest was pretty much as stated above. Of course I forgot to edit the default.list and had to later go back and update the cache after already creating the VPS with FC5. So I needed yum installed on this to fill in the blanks and Scott to the rescue again; I could install this from the host with:</p>\n<blockquote>\n<pre>vzyum 102 install yum</pre></p></blockquote>\n<p>This is it for now. I have yet to configure BackupPC. I will have to blog about it later.</p>\n<br class=\"clear\" />', created = 1411069411, expire = 1411155811, headers = '' WHERE cid = 'filter:1:022fabdf8e5ffb9089565d8773874009' in /home/dowdle/public_html/montanalinux/includes/database.mysql.inc on line 121.
|

This weekend I finally got around to checking out OpenVZ. With lots of prodding from Scott, not to mention lots of help from Scott, I got this thing installed rather quickly. I pretty much followed Scott's latest article Intro to OpenVZ: Part II. I started with installing CentOS 4.4 using the custom minimalist install and updated everything. BTW this machine is an old Dell 2Ghz with 512MB RAM and 40GB drive. My plan is to actually use one of the virtual private servers (VPS) as a production backup server. Other VPS's would be just for fun and possibly exploration of other distributions.

So in short after having my bare bones install here is my quick and dirty easy to follow steps from Scott's article:

  1. cd /etc/yum.repos.d
  2. wget http://download.openvz.org/openvz.repo
  3. yum install ovzkernel
  4. nano -w /etc/sysctl.conf with these changes:
  5. # On Hardware Node we generally need
    # packet forwarding enabled and proxy arp disabled
    net.ipv4.ip_forward = 1
    net.ipv4.conf.default.proxy_arp = 0
    # Enables source route verification
    net.ipv4.conf.all.rp_filter = 1
    # Enables the magic-sysrq key
    kernel.sysrq = 1
    # TCP Explict Congestion Notification
    # net.ipv4.tcp_ecn = 0
    # we do not want all our interfaces to send redirects
    net.ipv4.conf.default.send_redirects = 1
    net.ipv4.conf.all.send_redirects = 0
    
  6. Set the default kernel in grub to the new one
  7. Reboot using the new kernel
  8. yum install vzctl vzquota
  9. service vz start
  10. yum install vzpkg vzyum vzrpm43-python vzrpm44-python
  11. yum install vztmpl-centos-4
  12. nano -w /vz/template/centos/4/i386/config/default.list appending this:
  13. yum
    mc
    links
    system-config-date
    nano
    
  14. vzpkgcache -f centos-4
  15. vzctl create 101 --ostemplate centos-4 --config vps.basic
  16. vzctl set 101 --ipadd 192.168.0.101 --save
  17. vzctl set 101 --hostname vps101 --save
  18. vzctl set 101 --nameserver 192.168.0.1 --nameserver 192.168.0.2 --save
  19. vzctl set 101 --userpasswd root:areallycoolpassword
  20. vzctl set 101 --onboot yes --save
  21. vzctl start 101
  22. vzctl enter 101

Okay so that is it in a nutshell. Then this is where I start getting into trouble with my wild ideas. I mentioned wanting to make this my backup server and I normally use Dirvish, but this time I want to try out BackupPC. Now I also have a nice 300GB drive I have used for my backups and I planned on just mounting it inside this new VPS. Problem is I couldn't figure out how to give it enough diskspace quota. The most it would give was from my 40GB drive and that was a 34GB quota. So I called Scott and pretty much just decided to do LVM (logical volume management) and merge the drives together to make it look like one big drive. This however entailed starting from scratch again as I'm pretty lazy when it comes to trying to figure out installing something like this after the fact.

So I find my single CentOS CD and attempt to boot it but my crappy old Dell has an abused CD-R drive. So I borrow the one out of another Dell and off we go. So when I get back to the point I was last, I run this:

vzctl set 101 --diskspace  315621376:315621376 --save

This gives me 301GB disk space to work with in my VPS. Problem is I was told by Scott there is an rpm for BackupPC but currently there are no rpm's for CentOS. So this brings me to another task... create another VPS with a distribution that includes rpm package management for BackupPC. I found out the hard way that these guys are yet another that uses caps in their package name and caused me a bit of headache searching for it.

I picked FC-5 for the new VPS as it seems to be the latest to carry BackupPC. To do this I needed to build the template similar to building the CentOS template above.

yum install vztmpl-fedora-core-5

The rest was pretty much as stated above. Of course I forgot to edit the default.list and had to later go back and update the cache after already creating the VPS with FC5. So I needed yum installed on this to fill in the blanks and Scott to the rescue again; I could install this from the host with:

vzyum 102 install yum

This is it for now. I have yet to configure BackupPC. I will have to blog about it later.