OPENVZ on Centos 5.5 Final


Berikut adalah langkah-langkahnya:

[root@ecentrixfinal yum.repos.d]# pwd
/etc/yum.repos.d
[root@ecentrixfinal yum.repos.d]# vim openvz.repo

Tambahakan
[openvz-kernel-rhel5]
name=OpenVZ RHEL5-based kernel
#baseurl=http://download.openvz.org/kernel/branches/rhel5-2.6.18/current/
mirrorlist=http://download.openvz.org/kernel/mirrors-rhel5-2.6.18
enabled=1
gpgcheck=1
gpgkey=http://download.openvz.org/RPM-GPG-Key-OpenVZ

[root@ecentrixfinal yum.repos.d]# yum clean all
[root@ecentrixfinal yum.repos.d]# yum install vzkernel vzquota vzctl

Check apakash sudah terinstall or not
[root@ecentrixfinal yum.repos.d]# rpm -aq | grep vzkernel
ovzkernel-2.6.18-274.el5.028stab093.2
[root@ecentrixfinal yum.repos.d]# rpm -aq | grep vzquota
vzquota-3.0.12-1
[root@ecentrixfinal yum.repos.d]# rpm -aq | grep vzctl
vzctl-lib-3.0.28.3-1
vzctl-3.0.28.3-1

Check apakah di menu.list sudah terinstall kernel baru
[root@ecentrixfinal yum.repos.d]# cat /boot/grub/menu.lst

[root@ecentrixfinal yum.repos.d]# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title OpenVZ (2.6.18-274.el5.028stab093.2)
root (hd0,0)
kernel /vmlinuz-2.6.18-274.el5.028stab093.2 ro root=/dev/VolGroup00/LogVol00 rhgb quiet selinux=0
initrd /initrd-2.6.18-274.el5.028stab093.2.img
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-194.el5.img
[root@ecentrixfinal yum.repos.d]#

Default ke kernel 1 (OPENVZ)

[root@ecentrixfinal yum.repos.d]# vim /etc/vz/vz.conf

NEIGHBOUR_DEVS=all

Change systctl.conf
Sesuikan, jika belum ada tambahkan sendiri
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.default.forwarding = 1
net.ipv4.ip_forward = 1
save (wq!)
[root@ecentrixfinal openvz]# sysctl -p
reboot

check versi kernel harusnya yang di load sudah kernel OPENVZ
[root@ecentrixfinal ~]# uname -a
Linux ecentrixfinal 2.6.18-274.el5.028stab093.2 #1 SMP Tue Aug 23 17:13:34 MSD 2011 i686 i686 i386 GNU/Linux

Install Guest Baru dengan menguplaod template yang ingin di install
upload ke dir via scp or winscp
ex: ubuntu-10.04-minimal_10.04_i386.tar.gz

[root@ecentrixfinal openvz]# ls -l
total 85604
-rw-r–r– 1 root root 87107384 May 5 2010 ubuntu-10.04-minimal_10.04_i386.tar.gz
-rw-r–r– 1 root root 165401 Jun 16 23:56 vzctl-3.0.28.3-1.i386.rpm
-rw-r–r– 1 root root 190511 Jun 16 23:56 vzctl-lib-3.0.28.3-1.i386.rpm
-rw-r–r– 1 root root 83539 Nov 11 2008 vzquota-3.0.12-1.i386.rpm

[root@ecentrixfinal openvz]# vzctl create 100 –ipadd 192.168.137.201 –ostemplate ubuntu-10.04-minimal_10.04_i386 –hostname ubuntuminimal –onboot yes –save

Start guest ubuntu

[root@ecentrixfinal openvz]# vzctl start 100
Starting container …
Container is mounted
Adding IP address(es): 192.168.137.201
Setting CPU units: 1000
Set hostname: ubuntu-minimal
File resolv.conf was modified
Container start in progress…

Masuk ke Guest
[root@ecentrixfinal openvz]# vzctl enter 100
entered into CT 100
root@ubuntu-minimal:/#

Install paket dari host pada Guest
[root@ecentrixfinal openvz]# vzctl exec 100 apt-get install rcconf
Reading package lists…
Building dependency tree…
Reading state information…
The following extra packages will be installed:
libfribidi0 libgdbm3 libnewt0.52 libpopt0 make perl perl-modules whiptail
Suggested packages:
make-doc perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl
The following NEW packages will be installed:
libfribidi0 libgdbm3 libnewt0.52 libpopt0 make perl perl-modules rcconf
whiptail
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 7579kB of archives.
After this operation, 32.9MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main libfribidi0 0.19.2-1 [41.7kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main libgdbm3 1.8.3-9 [45.2kB]

Stop Guest
[root@ecentrixfinal openvz]# vzctl stop 100
Stopping container …
Container was stopped
Container is unmounted
[root@ecentrixfinal openvz]#

Command line explore sendiri dengan menggunakan command vzctrl –help
vzcalc vzcpucheck vzdqcheck vzdqload vzifup-post vzmemcheck vznetaddbr vzpid vzsplit
vzcfgvalidate vzctl vzdqdump vzeventd vzlist vzmigrate vznetcfg vzquota vzubc

Finish

Thanks

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: