Categories: Commands

OpenVZ commands and its usages

10+ Commonly using OpenVZ commands and its usages

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, Command to list running and stopped VPSs in an node
This command lists all 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 110
CTID 116 exist unmounted down

6, To enter a VPS

# vzctl enter CTID

Example:

# vzctl enter 106
entered into CT 106

7, Set hostname for a Server

# vzctl set CTID --hostname New_hostname --save

8, Add new IP to VPS

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

9, Delete IP from VPS

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

10, Reset root password of a VPS

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

11, To add NameServer IPs to VPS

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

12, Delete a container

# vzctl destroy CTID

13, Suspending a container

# vzctl suspend CTID

 


Vishwajit Kale
Vishwajit Kale blazed onto the digital marketing scene back in 2015 and is the digital marketing strategist of Hostripples, a company that aims to provide affordable web hosting solutions. Vishwajit is experienced in digital and content marketing along with SEO. He's fond of writing technology blogs, traveling and reading.

Recent Posts

Step-by-Step Guide to Implementing a CDN for WordPress

Picture this: Your WordPress site is like that one friend who's always fashionably late to everything. You know, the one…

1 week ago

The Truth Behind AI Detectors: Trust or Distrust?

In a world where artificial intelligence is rapidly reshaping our digital landscape, AI detectors have emerged as both guardians and…

3 weeks ago

What are the advantages of using VPS for e-learning?

In today's digital age, e-learning has become more than just a convenience – it's a necessity. As virtual classrooms and…

4 weeks ago

Updated cPanel License Price in Jan 2025: A Comprehensive Guide

Are you ready for another cPanel price adjustment? As we have approached January 2025, cPanel has rolled out significant changes…

2 months ago

Finding Your Fit: Website Builder or WordPress for Your Site?

In this growing digital world, having a website is not enough—it’s a crucial and much-needed option. But here's the challenge…

2 months ago