OpenVZ Virtual Machine (VPS) Management

by on August 6, 2006 · 2 comments· LAST UPDATED February 20, 2011

in , ,

Now, my VPS is up and running. How do I manage my hardware node and VPS? How do I see a list of all running VPSes? How do I see memory usage and other stuff?

This FAQ covers various containers utilities which may be used to solve many problems and tune overall hardware as per your setup.

How Do I List All Running VPSs?

The command vzlist is used for listing containers and their parameters. The -a option list all containers:
# vzlist -a
Outputs:

     CTID      NPROC STATUS  IP_ADDR         HOSTNAME
        10         12 running 123.xx.yyy.zz   vps.nixcraft.in

The -o option can display only parameters specified by names, for e.g. just display hostname, disk and memory info:
# vzlist -o ctid,hostname,kmemsize,kmemsize.l,diskspace
See vzlist man page for more information.

How Do I Calculate The Container's Resources Usage?

The vzcalc utility displays the share of the host system resources a particular container is using. If the container is running, the current usage is displayed. High utilization values (>100%) mean the system is overloaded (or the container has an invalid configuration).
# vzcalc -v 10
Sample Outputs:

Resource     Current(%)  Promised(%)  Max(%)
Low Mem          0.30       5.23       5.23
Total RAM        0.43        n/a        n/a
Mem + Swap       0.21       2.95        n/a
Alloc. Mem       0.34       3.69       7.13
Num. Proc        0.04        n/a       0.73
--------------------------------------------
Memory           0.43       5.23       7.13

How Do I Shows Information About The CPU Power and Utilization?

Use vzcpucheck command:
# vzcpucheck -v
Outputs:

VEID		CPUUNITS
-------------------------
0		1000
10		1000
Current CPU utilization: 2000
Power of the node: 299281

Further readings:

  1. Read man pages - vzctl, vzcpucheck, vzcalc, and vzlist
  2. The official OpenVZ wiki.
  3. The official CentOS Linux project.

Summary:

In this series, you learned how to work with OpenVZ virtualization under CentOS / RHEL Linux environment. OpenVZ has a completely different approach to virtualization, it almost works like FreeBSD jails or Solaris zones. I highly recommend the official OpenVZ wiki for further details.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 2 comments… read them below or add one }

1 Ap.Muthu August 8, 2009 at 4:11 am

http://pve.proxmox.com has a nice baremetal installer that installs Debian 5 (Lenny) and has a nice web interface to control the Virtual machines, Server and Cluster.

The Proxmox VE v1.3 scripts are in the /usr/share/pve-manager/ folder and can be adapted to suit RHEL / CentOS based installs.

Reply

2 Scott Dowdle August 8, 2009 at 7:17 pm

Good tutorial. I did notice one thing to comment on though. The CTID you gave in your example was 10 BUT according to the OpenVZ Users Guide, CTIDs 1-100 are reserved and should not be used. While you probably won’t have any issues using CTIDs between 1-100, it isn’t recommended.

Thanks for the tutorial! I’ve been using OpenVZ for close to 4 years now and it is fantastic.

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , ,

Previous Faq:

Next Faq: