Open VZ cheat Sheet


VZCTL COMMANDS
---------------------

vzctl set 101 --diskspace 1000000:1100000 --save  To set diskspace for container with ID 101

vzctl set 101 --diskinodes 90000:91000 --save     To set inodes for container with ID 101

vzctl set 101 --quotatime 600 --save              To set quotatime for container with ID 101 (The time limit by

                                                       which container is allowed to temporarily exceed  its quota soft limits)

vzctl exec 101 df                                  To execute command df at the server with the CTID 101

vzctl set 101 --quotaugidlimit 100 --save          Set number of user/group id's allowed for internal disk
                                                                     quota,if 0 UID/GUID quota will not be allowed\

 vzctl set 0 --dcachesize 5G --save        Set dcachesize of the hardware node

sysctl fs.fsync-enable=0     or  echo 0 > /proc/sys/fs/fsync-enable        disable fsync calls inside containers .

Add the  two lines to /etc/sysctl.conf to make permanent across reboots

#disable fsync() calls inside Containers
fs.fsync-enable=0


sysctl fs.file-max=1048576 kernel.pid_max=262144        change kernel.pid_max and fs.file-max

~# vzup2date -m batch install --loader-autoconfig       update virtuozzo installation using Parallels update
                                                                                      utility


vzps auxwwff -E ${CTID}           Check the process list for a particular container

How to locate vzagent.conf ?

-----

All PVA Agent configuration files are located in etc_folder defined in pva.conf.

Check /opt/pva/agent/bin/pva.conf and find the etc_folder section:

etc_folder

/vz/pva/agent/etc

It means that the main configuration file vzagent.conf is located in /vz/pva/agent/etc.


vzctl create VEID [--ostemplate <name>] [--config <name>]  To create a container

vzctl exec 101 /etc/init.d/sshd status

vzpkgls - To display the templates present in the server

vzctl destroy 101 -  To destroy a VPS with VEID 101

vzctl set 101 --hostname test101.my.org --save  -- To set hostname

vzctl start/stop/restart/enter 101    To start/stop/restart/enter container with ID 101

vzctl set 101 --cpus 2 --save  To set two cpus under the container 101

vzctl set 101 --ipadd 10.0.186.1 --save   -- To add an IP address

vzctl set 101 --ipdel 10.0.186.1 --save    -- To delete an IP address

vzctl set 101 --nameserver 192.168.1.165 --save  --To set the name servers

vzctl set 101 --userpasswd root:password -- To set the root password of VPS 101

vzctl start 101 --force  -- To start a disabled VPS

Comments

Popular posts from this blog

Logical volume vmxxxx_img is used by another device - Error on LVM removal

Cheat sheet for Hardware RAID health check - Megaraid, Adaptec, 3wareraid and HPraid.