Академический Документы
Профессиональный Документы
Культура Документы
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):
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.
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!)
vi /etc/sysconfig/selinux
... and set SELINUX to disabled:
Run
setenforce 0
afterwards.
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:
***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 ~]#
vi /etc/grub.conf
... and change default=1 to default=0 so that the OpenVZ kernel is the default kernel:
reboot
3 Using HyperVM
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:
The next thing you are asked to do is configure LXguard. LXguard is a tool like fail2ban
or DenyHosts that blocks remote IP addresses from which too many logins originated
(this is to prevent brute-force attacks).
Fill in the max. number of failed login attempts that are allowed before LXguard kicks in
and blocks the IP:
You should then go to the Whitelist tab and whitelist your own IP (so that you don't get
locked out if you use a wrong login too often):
This is how the HyperVM Home looks. You should browse all the icons to make yourself
a little bit more familiar with the software.
Before we can create our first OpenVZ container, we need to define an IP pool from
which new containers can take an IP address. Go to Ip Pools. On the Ip Pools page, click
on the Add Ip Pool tab:
Fill in a name for the pool, a start and an end IP address, at least one name server (if you
fill in more than one, separate them with a space), and the gateway IP address. Then
select the server (localhost) that this pool is applicable to:
Afterwards you should see the new pool on the Ip Pools overview page:
Besides creating an IP pool, we must also define at least one resource plan before we can
create our first OpenVZ container. On the HyperVM Home, click on Resource Plans, and
then on the Add Resource Plan tab:
Fill in a name and description and then specify the resources for each OpenVZ container
that will use this resource plan:
Now we can create our first OpenVZ container. Click on the Virtual Machines icon in the
Resources section of the HyperVM Home; on the page that loads, click on the Add
Openvz tab:
Provide a name for that new OpenVZ container and fill in a root password. Type in a free
IP address from the IP pool that you've created before,...
... provide a hostname, select the resource plan you've just created and an OS template for
the container, then click on Add:
After a few moments, you should see your new container on the Virtual Machines
overview page. You can start and stop the container by clicking on the bulb in the S
column, but you can as well control it from its own control panel that you can reach by
clicking on the container's name in the VM Name column:
This is how the container's control panel looks:
Congratulations, you've just created your first OpenVZ container with HyperVM!
server2:
vi /etc/sysconfig/selinux
Run
setenforce 0
afterwards.
wget http://download.lxlabs.com/download/hypervm/production/hypervm-install-slave.sh
sh ./hypervm-install-slave.sh --virtualization-type=openvz
The installation won't take long because no container templates need to be downloaded
(the templates are stored on the master). At the end, you should see something like this:
***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
[root@server2 ~]#
vi /etc/grub.conf
... and change default=1 to default=0 so that the OpenVZ kernel is the default kernel:
reboot
Now we can add our new HyperVM slave to the HyperVM control panel. Click on the
Servers icon on the HyperVM Home:
Click on the Add Server tab:
Fill in the IP address of the slave (192.168.0.102) and its HyperVM password (the default
password is admin). Then click on Add:
You should now see the slave on the Servers overview page (in addition to localhost):
Before we can create an OpenVZ container on the slave, we need to define a second IP
pool that we can use on the slave:
(We don't have to define another resource plan - we can use the one we've created
before.)
Now go to Virtual Machines > Add Openvz to create a new container on the slave. Fill in
a name and IP address for the container as well as a hostname, then select the slave in the
Server drop-down menu and finally an OS template:
Afterwards, you should find the new container on the Virtual Machines overview page.
You can start/stop it by clicking on the bulb in the S column:
5 Links
HyperVM: http://lxlabs.com/software/hypervm/
OpenVZ: http://wiki.openvz.org/
CentOS: http://www.centos.org/