Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Essential Openvz commands

Rumi, May 31, 2017

1. Command to list the running VPSs in a node

# vzlist

Example:

# vzlist
 CTID NPROC STATUS IP_ADDR HOSTNAME
 106 104 running xx.xx.xx.xx server1.test.com 
 107 46 running xx.xx.xx.xx server2.test.com 
 108 83 running xx.xx.xx.xx server3.test.com
 109 86 running xx.xx.xx.xx server4.test.com

2. This command lists all (running and stopped) the VPSs in a node.

# vzlist -a

Example:

# vzlist -a
 CTID NPROC STATUS IP_ADDR HOSTNAME
 106 104 running xx.xx.xx.xx server1.test1.com 
 107 46 running xx.xx.xx.xx server2.test2.com 
 108 83 running xx.xx.xx.xx server3.test3.com
 109 86 running xx.xx.xx.xx server4.test4.com
 110 - stopped xx.xx.xx.xx server5.test5.com

3, To start a VPS

# vzctl start CTID

Example:

# vzctl start 110

4, To stop or shutdown a VPS

# vzctl stop CTID

Example:

# vzctl stop 110

5, To view the status of a VPS

# vzctl status CTID

Example:

# vzctl status 116
CTID 116 exist unmounted down

6, To restart a VPS

# vzctl restart CTID

Example:

# vzctl restart 110

Logging into a container

7, To enter a VPS

# vzctl enter CTID

Example:

# vzctl enter 106
entered into CT 106

8, Delete a container

# vzctl destroy CTID

9, Suspending a container

# vzctl suspend CTID

10, Set hostname for a Server

# vzctl set CTID --hostname New_hostname --save

11, Add new IP to VPS

# vzctl set CTID --ipadd xx.xx.xx.xx --save

12, Delete IP from VPS

# vzctl set CTID --ipdel xx.xx.xx.xx --save

13, Reset root password of a VPS

# vzctl set CTID --userpasswd root:new_password --save

14, To add NameServer IPs to VPS

# vzctl set CTID --nameserver xx.xx.xx.xx --save

15, Executes commands for a container from node

# vzctl exec CTID command

Example:

# vzctl exec 110 df -h
# vzctl exec 101 df -h 
Filesystem Size Used Avail Use% Mounted on
/dev/simfs 130G 89G 27G 78% /
none 8.0G 4.0K 8.0G 1% /dev
none 8.0G 0 8.0G 0% /dev/shm

16, To check the resource usages

# vzcalc -v CTID

Example:

# vzcalc -v 110
# vzcalc -v 101
Resource Current(%) Promised(%) Max(%)
Low Mem 1.53 182706895112.42 182706895112.42
Total RAM 33.79 n/a n/a
Mem + Swap 1.73 38695649865149.61 n/a
Alloc. Mem 2.95 38695649865149.61 38695649865149.61
Num. Proc 0.05 n/a 2395786836523892.00
--------------------------------------------
Memory 33.79 38695649865149.61 2395786836523892.00
Administrations Cloud OpenVZProxmox

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes