Thursday, March 19, 2015

OpenVZ Web Panel: Managing OpenVZ Containers Graphically

http://www.unixmen.com/openvz-web-panel-managing-openvz-containers-graphically

Install OpenVZ Web panel

In our previous tutorials, We have seen,
In this tutorial, let us see how to manage OpenVZ using OpenVZ web panel.

Why OpenVZ Web panel?

Very simple, just to make the OpenVZ management more easier. Working on command line might be tedious to new and intermediate users. Using openVZ Web panel, anyone can easily create, delete, manage VMs via a web browser in minutes without having to know all OpenVZ commands.

Installing OpenVZ Web panel

Well, let us install the Web panel.
Run the following command under root user to install OpenVZ Web Panel:
wget -O - http://ovz-web-panel.googlecode.com/svn/installer/ai.sh | sh
The above command will work on almost all Linux operating systems.
Sample output:
 Removing downloaded archive: rm -f /opt/ovz-web-panel//ovz-web-panel-2.4.tgz
 Installation finished.
 Product was installed into: /opt/ovz-web-panel/
 [...]
 Starting services...
 Starting OpenVZ Web Panel...
 Starting watchdog daemon...
 [OK] Watchdog daemon was started.
 Starting web server webrick on 0.0.0.0:3000...
 [OK] Web server was started.
 Starting hardware node daemon...
 [OK] Hardware node daemon was started.
 Syncing hardware nodes states...
 [OK] Hardware nodes information was synced.
 Adding localhost to the list of controlled servers...
 Panel should be available at:
 hostname: Unknown host

http://:3000

 Default credentials: admin/admin
 -----------------------------------
That’s it. OpenVZ Web panel has been installed now.

Adjust IPTABLES for RPM based distributions

If you’re accessing the URL from a remote system, you should allow the web panel default port 3000 through your firewall/router.
To do that edit:
vi /etc/sysconfig/iptables
Add the following line:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
Save and exit. Restart iptables service.
service iptables restart

Accessing OpenVZ Web panel

Open up your web browser and enter the following URL in the address bar.
http://:3000
Default administrator’s credentials are: admin/admin. Don’t forget to change default password.
Login - OpenVZ Web Panel 2.4 - Mozilla Firefox_001
Now, you’ll be redirected to the OpenVZ web panel dashboard:
Dashboard - OpenVZ Web Panel 2.4 - Mozilla Firefox_002
The Dashboard will have the information about logged user and statistics of panel usage. By default, the physical server is localhost itself. Also, it is possible to many physical servers without having to install Web panel on every physical server.

Changing Default Admin user password

As I mentioned before, the default user name and password to login to Wen panel is admin/admin. It is hightly recommended to change the admin user password to something different and stronger.
To do that, Click on the My Profile on the left pane of the Dash board. Enter the new password twice and click the Save button.
IP Addresses - OpenVZ Web Panel 2.4 - Mozilla Firefox_007
Now, let us see how to create Virtual machines, Virtual servers, and users etc.

Download And Install OS Templates

Before creating Virtual machines or VPS, the first step is to install OS templates.
To do that, click on the Physical server (localhost) on the left pane of the Dashboard. Then, click on the OS Templates button on the right side.
Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_003
The installed OS templates will be listed here. As you see above I have already installed a CentOS 7 template. To create a new Template, click on the Install New OS Template button.
OS Templates on Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_004
The list of available OS templates will be shown in the next window. Select the OS template of your choice and click Install button. In my case, I selected Ubuntu 14.04 minimal template.
OS Templates on Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_005
The installing process will be scheduled and new templates will be appeared soon.
OS Templates on Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_006
After few minutes(depending upon the size of the template), refresh the OS templates list. You’ll, there, see the newly installed OS templates.
OS Templates on Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_008
As you see above, the Ubuntu 14.04 OS template has been installed now.

Creating Virtual Servers

We have installed the OS templates in our previous steps. Now, we will create new Virtual servers using the OS templates.
Go back to the localhost (Just click on the localhost button under the Physical Servers section) window. Click Create New Virtual Server button.
Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_009
Enter the Server ID, select the OS template, enter IP address and hostname, enter the root password etc. Also, you can define the disk space size, RAM, Swap, DNS server etc,, in the Additional Settings. I go with default values. Finally, click Create button.
Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_011
Hurray! We have created a new Virtual server.
Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_012
If you don’t want the Virtual server, select the Virtual server, and click Remove Virtual server button.
Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_013
Also, you can change the settings of the Virtual server by clicking on the Change Settings button next to the Remove Virtual Server button. And, you also can start/stop/restart the virtual server using the Change state button next to the Change Settings button..

Creating Server Templates

Server templates are used as a source of quality of service limits during virtual server creation. They could be used to simplify new virtual servers creation for different purposes. You can create, edit and remove templates, but, you can’t remove the default template for the physical server.
Click on the localhost button under the Physical Servers section on the left pane of the Dashboard. Then, click Server Templates on the right side.
Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_014
The list of available Server Templates will be shown. Select the template of your Choice and Click Add Template button.
Server Templates on Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_015

Adding more Physical servers

As I mentioned before, the localhost itself is the default Physical server. You can add more physical server if you want. You don’t have to install OpenVZ web panel on extra physical servers.
To add an extra physical server, click on the Physical Servers button on the left pane of the Dashboard. Then, click Connect new server button.
Physical Servers - OpenVZ Web Panel 2.4 - Mozilla Firefox_016
Enter the hostname, and root password of the new OpenVZ server. Then, click Connect.
Physical Servers - OpenVZ Web Panel 2.4 - Mozilla Firefox_017
New virtual servers or OS templates can be installed directly on the server using command line tools. In such case need to select physical server and click “Synchronization” button to perform synchronization between panel’s database and actual state of the server.

Creating Users

By default, there will be two users automatically created while installing OpenVZ. One is admin, the infrastructure administrator, and the another is virtual server owner. If you want new users, you can add them too. Also, you can assign any user as a owner to any VPS. The owners can manage, edit the particular VPS details.
To create a new user, Click on the Users button on the left. Then, click Add user.
Users - OpenVZ Web Panel 2.4 - Mozilla Firefox_019
Fill up the user details, and select the role of the new user(infrastructure owner or Virtual server owner). Finally, click Create.
Users - OpenVZ Web Panel 2.4 - Mozilla Firefox_020
Now, we can assign the new user to any VPS.
Physical Server localhost - OpenVZ Web Panel 2.4 - Mozilla Firefox_021

Viewing Event logs

Event logs will give you the recent activities of the OpenVZ server.
Events Log - OpenVZ Web Panel 2.4 - Mozilla Firefox_022

Conclusion

In this series of tutorials, we have seen how to install and configure OpenVZ on CentOS and Ubuntu systems. Also, we have seen how to create and manage VMS both in text and graphical mode methods. As far as I know, OpenVZ will be very useful in development environments and other R&D departments that are using multiple and different kind of Virtual machines. You can easily create, edit, delete VM in minutes using OpenVZ within minutes. Hope this tutorial series will give you a basic usage and ideas about OpenVZ. For more details, refer the OpenVZ official website.
OpenVZ Web Panel Home page:

No comments:

Post a Comment