Common OpenVZ Tasks

Common OpenVZ Admin Tasks

vzctl act as a master tool for various tasks:

How Do I Set VPS Name to
# vzctl set 10 --hostname --save
How Do I Set VPS IP Address?
# vzctl set 10 --ipadd --save
How Do I Set VPS DNS Name Servers?
# vzctl set 10 --nameserver --save
How Do I Set Disk Quota?
# vzctl set 10 --diskspace SoftLimitG:HardLimitG --save
# vzctl set 10 --diskspace 2G:5G --save
How Do I Stop / Start / Restart VPS Servers?
# vzctl start 10
# vzctl restart 10
# vzctl stop 10
How Do I Run a Command For VPS?

You can run command as follows

# vzctl exec 10 w
# vzctl exec 10 df
# vzctl exec 10 date
# vzctl exec 10 ps aux
How Do I Login Into VPS Server (container)?

Type the following command

# vzctl enter 10

To exit, simply type:

# exit

You can remotely login to your VPS using a ssh client itself or using putty:

$ ssh
How Do I Destroy VPS?

Type the following command to delete VPS:

# vzctl destroy 10

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.