OpenVZ Cheatsheet

Show Running Containers

vzlist -a

Create Container

vzctl create $VM_ID \
--ostemplate $TEMPLATE \
--conf $CONF_TYPE \
--ipadd $IP \
--hostname $HOSTNAME
Example
vzctl create 101 \
--ostemplate ubuntu-14.04-x86_64 \
--conf basic \
--ipadd 192.168.1.1 \
--hostname client1

Destroy Container

vzctl destroy $VM_ID

Start Container

vzctl start $VM_ID

Stop Container

vzctl stop $VM_ID

Enter Container

vzctl enter $VM_ID

Set Users Password

vzctl set 101 --userpasswd $USER:$PASSWORD

Add An IP

vzctl set $VM_ID --ipadd $IP --save
This does not replace the IP, but adds one

Remove An IP

vzctl set $VM_ID --ipdel $IP --save

References

No comments:

Post a Comment