Managing OpenVZ With HyperVM On CentOS 5.2

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Tue, 2009-02-03 19:02. :: CentOS | OpenVZ | Virtualization

Managing OpenVZ With HyperVM On CentOS 5.2

Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited 01/23/2009

HyperVM is a multi-platform, multi-tiered, multi-server, multi-virtualization web based application that will allow you to create and manage different virtual machines each based on different technologies across machines and platforms. Currently it supports OpenVZ and Xen virtualization and is available for RHEL 4/5 as well as CentOS 4 and CentOS 5. This tutorial shows how to install it on a CentOS 5.2 server to control OpenVZ containers. I will also explain how to manage OpenVZ containers with HyperVM on a remote CentOS 5.2 server ("slave").

I do not issue any guarantee that this will work for you!

 

1 Preliminary Note

I'm using two empty CentOS 5.2 servers in this tutorial (empty because HyperVM will also install OpenVZ, so OpenVZ does not need to be installed right now):

  • server1.example.com (IP 192.168.0.100): master
  • server2.example.com (IP 192.168.0.102): slave

The slave is needed only if you want to control OpenVZ containers on remote servers with HyperVM (explained in an extra chapter).

I couldn't find out anything about HyperVM's license, neither on the HyperVM web site nor in the sources. It seems to be free, at least for a certain amount of controlled OpenVZ containers (according to http://lxlabs.com/store/). If you find out about its license and whether it's free or not, please let me know.

 

2 Installing A HyperVM Master

server1:

(The HyperVM master allows you to control OpenVZ containers on the master itself and on slave machines. Even if you don't want to run slave machines, you need a master!)

First we need to disable SELinux. Open /etc/sysconfig/selinux...

vi /etc/sysconfig/selinux

... and set SELINUX to disabled:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

Run

setenforce 0

afterwards.

Afterwards we install HyperVM as follows:

wget http://download.lxlabs.com/download/hypervm/production/hypervm-install-master.sh
sh ./hypervm-install-master.sh --virtualization-type=openvz

This will take quite some time as this also installs OpenVZ and some OpenVZ templates, so be patient. At the end, you should see something like this:

Downloaded: 7 files, 1.4G in 51m 21s (485 KB/s)
Executing Update Cleanup... Will take a long time to finish....
Congratuations. hyperVM has been installed succesfully on your server as master
You can connect to the server at https://<ip-address>:8887 or http://<ip-address>:8888
Please note that first is secure ssl connection, while the second is normal one.
The login and password are 'admin' 'admin'. After Logging in, you will have to change your password to something more secure
Thanks for choosing hyperVM to manage your Server, and allowing us to be of service

***There is one more step you have to do to make this complete. Open /etc/grub.conf, and change the 'default=1' line to 'default=0', and reboot this machine. You will be rebooted into the openvz kernel and will able to manage vpses from the hyperVM interface
You have mail in /var/spool/mail/root
[root@server1 ~]#

Next we open /etc/grub.conf...

vi /etc/grub.conf

... and change default=1 to default=0 so that the OpenVZ kernel is the default kernel:

# 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 CentOS (2.6.18-92.1.18.el5.028stab060.2PAE)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-92.1.18.el5.028stab060.2PAE ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-92.1.18.el5.028stab060.2PAE.img
title CentOS (2.6.18-92.1.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-92.1.1.el5 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-92.1.1.el5.img
title CentOS (2.6.18-92.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-92.el5.img

Then we reboot the system:

reboot

That's it for the installation.

 

3 Using HyperVM

Now open a browser and go to https://192.168.0.100:8887 or http://192.168.0.100:8888.

If you're using Firefox 3 and use HTTPS, Firefox will complain about the self-signed certificate, therefore you must tell Firefox to accept the certificate - to do this, click on the Or you can add an exception... link:

Click on Add Exception...:

The Add Security Exception window opens. In that window, click on the Get Certificate button first and then on the Confirm Security Exception button:

Afterwards, you will see the HyperVM login form. Log in with the user admin and the password admin:

The first thing you are asked to do after the first login is to change the default password for admin:


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Kamik (not registered) on Thu, 2009-02-05 00:30.

Licensing information can be found at http://www.i4wifi.cz/?cls=stoitem&stiid=747 In short it says that you can use 2 VMs after installation and up to 5 VMs after you register on their system. Up to 9 VMs you are paying only for those that  are over your 5 free VMs. So if you have 7 VMs running it will charge you money for 2 licences. When you register 10 VMs with your license all free licences are GONE and you start paying for all of them.

Submitted by Kamik (not registered) on Sat, 2009-02-14 17:30.
Iam sorry I have pasted wrong URL, licensing informations are here on lxlabs WiKi
Submitted by Adam (not registered) on Thu, 2009-02-05 06:21.

If you start running 5 vms++ then you will be better of with xen. It is better performance wise in a multiple vm environment, it comes with CentOS and you dont have to pay a dime.

 -Adam

Submitted by Kamik (not registered) on Sat, 2009-02-14 17:23.
So for clarify you are not paying for use of OpenVZ, but you pay here for management system (hyperVM) licences.
Submitted by bilety lotnicze (not registered) on Wed, 2009-02-04 08:02.
Very interesting article. Thanks