Monday, October 19, 2009

First openVZ installation with yum

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:

______________________
# 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

_____________________

5. Set the default kernel in grub to the new one
6. Reboot using the new kernel
7. yum install vzctl vzquota
8. service vz start
9. yum install vzpkg vzyum vzrpm43-python vzrpm44-python
10. yum install vztmpl-centos-4
11. nano -w /vz/template/centos/4/i386/config/default.list appending this:
yum
mc
links
system-config-date
nano
12. vzpkgcache -f centos-4
13. vzctl create 101 --ostemplate centos-4 --config vps.basic
14. vzctl set 101 --ipadd 192.168.0.101 --save
15. vzctl set 101 --hostname vps101 --save
16. vzctl set 101 --nameserver 192.168.0.1 --nameserver 192.168.0.2 --save
17. vzctl set 101 --userpasswd root:areallycoolpassword
18. vzctl set 101 --onboot yes --save
19. vzctl start 101
20. 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
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.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.