Managing OpenVZ With HyperVM On CentOS 5.2 - Page 3
4 Installing A HyperVM Slave
Now we want to install a HyperVM slave on our server2.example.com and control it from the HyperVM control panel on our master (server1.example.com). This is how we do it:
First we need to disable SELinux. Open /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
Afterwards we install the HyperVM slave as follows:
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:
Executing Update Cleanup... Will take a long time to finish....
Congratuations. hyperVM has been installed succesfully on your server as slave
You should open the port 8889 on this server, since this is used for the communication between master and slave
To access this slave, go admin->slaves->add slave, give the ip/machine name of this server. The password is 'admin'. The slave will appear in the list of slaves, and you can access it just like you access localhost
***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
Next we open /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.13.el5.028stab059.6PAE) root (hd0,0) kernel /vmlinuz-2.6.18-92.1.13.el5.028stab059.6PAE ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-92.1.13.el5.028stab059.6PAE.img title CentOS (2.6.18-53.1.4.el5) root (hd0,0) kernel /vmlinuz-2.6.18-53.1.4.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-53.1.4.el5.img title CentOS (2.6.18-53.el5) root (hd0,0) kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-53.el5.img
Then we reboot the system:
That's it for the installation.
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: