OpenVZ - Frequently used Commands

# vzctl start <VPSID>

   -To start a vps

# vzctl stop <VPSID>

   -To stop a vps

# vzctl restart <VPSID>

   -To restart a vps

# vzctl status <VPSID>

  -To check the status of vps

vzctl destroy <VPSID>

   -To To Delete a VPS. All the data will be deleted, no confirmation, so be careful when using this command.

# vzlist -a

   -To list all vps in the Hardware Node

# vzlist

  -To list running vps in the Hardware Node

vzcalc -v <VPSID>

    -To calculate the vps resources usage.

vzctl exec <VPSID> <Command>

    -To execute a command inside the container. Command can be df, ls etc.

# vzctl enter <VPSID>

    -To enter into vps

vzyum <VPSID> install package_name

    -To install any package/Software on a VPS from Node

vzctl set <VPSID>  --hostname  vps.domain.com  --save

    -To set the Hostname of a VPS

vzctl set  <VPSID>  --ipadd 1.2.3.4 --save

    -To add a new IP to the VPS

vzctl set  <VPSID> --ipdel  1.2.3.4  --save

    -To delete the IP from VPS

vzctl set  <VPSID>  --userpasswd  root:new_password  --save

    -To reset root password of a VPS

vzctl set  <VPSID>  --nameserver 1.2.3.4  --save

    -To add the nameserver IP's to the VPS

vzcpucheck -v

    -To check current CPU usage/vps. It'll list all vps.

This entry was posted by Unknown. Bookmark the permalink.

Leave a Reply