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.inThe -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:
- Read man pages - vzctl, vzcpucheck, vzcalc, and vzlist
- The official OpenVZ wiki.
- 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.
This FAQ entry is 5 of 5 in the "RHEL / CentOS Linux OpenVZ Virtualization Tutorial" series. Keep reading the rest of the series:Facebook it - Tweet it - Print it -



{ 2 comments… read them below or add one }
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.
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.