OpenVZ is an Operating System-level server virtualization solution, built on Linux. OpenVZ creates isolated, secure virtual environments VEs (otherwise known as virtual private servers, or VPS) on a single physical server enabling better server utilization and ensuring that applications do not conflict.
Each VE performs and executes exactly like a stand-alone server; VEs can be rebooted independently and have root access, users, IP addresses, memory, processes, files, applications, system libraries and configuration files.
Using premier VPS technology, several isolated VPS systems are installed on a single physical server. Users share systems resources, such as the CPU and memory, but unlike shared hosting the file system is fully partitioned so they are not affected by other activities on the server. This means that up-time is more consistent, while root access to the server provides the flexibility to add and change modules and install your own software.
File System
It is recommended to use a separate partition for VEs private directories (by default /vz/private/veid). The reason why you should do so is that if you wish to use OpenVZ per-VE disk quota, you wont be able to use usual Linux disk quotas on the same partition.OpenVZ per-VE disk quota is supported only for ext2/ext3 file systems. So use one of these file systems (ext3 is recommended) if you need per-VE disk quota.
Yum Pre-setup
If you want to use yum, you should set up OpenVZ yum repository first.
# cd /etc/yum.repos.d
# wget http://download.openvz.org/openvz.repo
# rpm import http://download.openvz.org/RPM-GPG-Key-OpenVZ Install Kernal using yum
# yum install ovzkernel[-flavor] Using rpm
# rpm -ihv ovzkernel[-flavor]*.rpm Configuring the bootloader
In case GRUB is used as the boot loader, it will be configured automatically: lines similar to these will be added to the /boot/grub/grub.conf file:
title Fedora Core (2.6.8-022stab029.1)
root (hd0,0)
kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5 quiet rhgb vga=031B
initrd /initrd-2.6.8-022stab029.1.img
title OpenVZ (2.6.8-022stab029.1)
root (hd0,0)
kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5
initrd /initrd-2.6.8-022stab029.1.img
Installing the utilities
OpenVZ needs some user-level tools installed. Those are:
vzctl
A utility to control OpenVZ VPSs (create, destroy, start, stop, set parameters etc.)
vzquota
A utility to manage quotas for VPSs. Mostly used indirectly (by vzctl).
Using yum :
# yum install vzctl vzquota Using rpm:
# rpm -Uhv vzctl*.rpm vzquota*.rpm Starting OpenVZ :
# /sbin/service vz start Creating an OS template cache
An OS template cache is an OS template installed into a VE and then packed into a gzipped tarball. Using such a cache, a new VE can be created in a matter of minutes, if not seconds. OS template cache can either be created from OS template metadata using vzpkg tools, or by other means.
You have to install a few packages in order to be able to create/update OS template cache
 Using yum
# yum install vzpkg vzyum vzrpm43-python vzrpm44-python
 Using rpm
# rpm -ihv vzpkg*.rpm vzyum*.rpm vzrpm44*.rpm Installing OS template metadata
As an alternative to creating a cache using template metadata, you can use precreated template cache taken from Downloads Templates Precreated, or directly from download.openvz.org/template/precreated, However, this option is not recommended for production systems since without installing template metadata you will not be able to update your template cache. In order to use precreated template cache files, download files for chosen OS distributions and place them as-is (no unpacking needed) to the /vz/template/cache directory.
VE Creation
# vzctl create VEID ostemplate osname
# vzctl set VEID ipadd a.b.c.d save
# vzctl start VEID Here VEID is the numeric ID for the VE; osname is the name of the OS template for the VE, and a.b.c.d is the IP address to be assigned to the VE.
Example:
# vzctl create 101 ostemplate fedora-core-5-minimal
# vzctl set 101 ipadd 10.1.2.3 save
# vzctl start 101 VE should be up and running now; you can see its processes
# vzctl exec VEID ps ax To provide VEID password
# vzctl exec VEID passwd username To enter VE give the following command:
# vzctl enter VEID
entered into VPS VEID
[ve]# To exit from VE, just type exit and press enter:
[ve]# exit
exited from VPS VEID
# To stop VE
# vzctl stop VEID
Stopping VPS – VPS was stopped – VPS is unmounted
To destroy VE
# vzctl destroy VEID Destroying VPS private area: /vz/private/VEID
VPS private area was destroyed
The Vps configuration file
# vi /etc/vz/conf/XXX.conf FAQ Section
- What is OpenVZ?
OpenVZ is an operating system-level virtualization technology that allows multiple isolated VPS containers to run on a single Linux server.
- How is OpenVZ different from traditional virtualization?
OpenVZ uses container-based virtualization, sharing the same Linux kernel, which makes it more lightweight and efficient compared to full virtualization.
- What is a VE in OpenVZ?
A VE (Virtual Environment) is an isolated container that acts like an independent server with its own processes, users, and configurations.
- What is the role of OS templates in OpenVZ?
OS templates are pre-configured environments used to quickly create VPS containers, reducing setup time significantly.
- How do you manage OpenVZ containers?
You can manage containers using tools like vzctl for creating, starting, stopping, and configuring VPS instances.
If you require help, contact SupportPRO Server Admin
Partner with SupportPRO for 24/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.
