Linux Commands

Basic OpenVZ commands

Basic OpenVZ commands
Basic OpenVZ commands

What is OpenVZ?

OpenVZ is an operating system-level virtualization technology based on the Linux operating system. It allows multiple operating system instances (containers) on a single physical server. In OpenVZ, both the host and guest OS should be Linux. This is due to the OpenVZ uses a single patched Linux kernel.

Basic OpenVZ commands

Here I am explaining some Basic OpenVZ commands and their usage:

1. List All Containers

 
vzlist -a

2. Start a VPS

 
vzctl start <VPS ID>

3. Stop a VPS

 
vzctl stop <VPS ID>

4. Restart a VPS

 
vzctl restart <VPS ID>

5. To get status of a VPS

 
vzctl status <VPS ID>

6. Suspend a VPS

 
vzctl suspend <VPS ID>

or

 
vzctl chkpnt <VPS ID>

7. Destroy a container

 
vzctl destroy <VPS ID>

8. Enter to the container

 
vzctl enter <VPS ID>

9. Exit from the container

 
[container]# exit
exited from container <ID>
[host-node]#

10. Set IP for VPS

 
vzctl set <VPS ID> --ipadd <IP Address> --save

11. Delete IP from VPS

 
vzctl set <VPS ID> --ipdel <IP Address> --save

12. Set Nameservers IP for VPS

 
vzctl set <VPS ID> --nameserver 8.8.8.8 --save

13. Set Hostname IP for VPS

 
vzctl set <VPS ID> --hostname <desired Hostname> --save

14. Set Disk quota for VPS

 
vzctl set <VPS ID> --diskspace BARRIER:LIMIT --save

15. Set RAM and SWAP

 
vzctl set <VPS ID> --ram 1G --swap 1G --save

 

16. Set inode

 
vzctl set <VPS ID> --diskinodes BARRIER:LIMIT --save

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Topics