VZ Shell Commands

From Ubiquity Server Wiki

Jump to: navigation, search

Virtuozzo, as well as OpenVZ, have a series of shell commands that can be used in managing virtual containers via the hardware node.


Contents

VZCTL: Control a VPS

vzctl v.4.0.0-223
 
Usage:
vzctl destroy | mount | umount | start | stop | status | enter |
  quotaon | quotaoff | quotainit <ctid|name>
vzctl start <ctid|name> [--wait]
vzctl create <ctid|name> {--pkgset <set> [--pkgver <ver>] | --ostemplate <name>}
       [--config <name>] [--private <path>] [--root <path>]
       [--ipadd <addr>] | [--hostname <name>] [--skip_app_templates]
vzctl convert VEID
vzctl reinstall <ctid|name> [--skipbackup] [--resetpwdb]
vzctl suspend <ctid|name>
vzctl resume <ctid|name>
vzctl exec | exec2 <ctid|name> <command> [arg ...]
vzctl runscript <ctid|name> <script>
vzctl monitor <ctid | 0>
vzctl set <ctid|name> [--save] [--ipadd <addr>] [--ipdel <addr>|all]
  [--hostname <name>] ]
  [--nameserver <addr>] [--searchdomain <name>] [--onboot yes|no]
  [--userpasswd <user>:<passwd>] [--cpuunits <N>] [--cpulimit <N>] [--cpus <N>]
  [--diskspace <soft>[:<hard>]] [--diskinodes <soft>[:<hard>]]
  [--quotatime <N>] [--quotaugidlimit <N>]
  [--rate <dev>:<class>:<Kbits>] [--ratebound yes|no]
  [--noatime yes|no] [--capability <name>:on|off ...]
  [--devnodes device:r|w|rw|none]
  [--applyconfig <name>] [--setmode restart|ignore] [--description <desc>]
  [--netif_add <ifname[,mac,host_ifname,host_mac]]>] [--netif_del <ifname>]
  [--bindmount_add <dst[,nosuid,noexec,nodev]>]
  [--bindmount_del <dst|all>] [--name <name>]
  [--offline_management yes|no] [--offline_service <name>]
  [--netdev_add <name> [--netdev_del <name>]
  [--iptables <name>] [--disabled <yes|no>]
  [--slmmemorylimit B[:B]] [--slmmode ubc|slm|all] [--ioprio <N>]
  [--features name:on|off
  [UBC parameters]
UBC parameters (N - items, P - pages, B - bytes):
Two numbers divided by colon denote barrier:limit.
In case the limit is not given it is set to the same value as the barrier.
  --numproc N[:N]      --numtcpsock N[:N]      --numothersock N[:N]
  --vmguarpages P[:P]  --kmemsize B[:B]        --tcpsndbuf B[:B]
  --tcprcvbuf B[:B]    --othersockbuf B[:B]    --dgramrcvbuf B[:B]
  --oomguarpages P[:P] --lockedpages P[:P]     --privvmpages P[:P]
  --shmpages P[:P]     --numfile N[:N]         --numflock N[:N]
  --numpty N[:N]       --numsiginfo N[:N]      --dcachesize N[:N]
  --numiptent N[:N]    --physpages P[:P]       --avnumproc N[:N]


VZPKG: Install pre-made packages

Virtuozzo EZ template management tool.
Usage:
vzpkg install | update | remove | localinstall | localupdate | upgrade |
   list | info | clean | fetch | status | link | update metadata |
   create cache | update cache | remove cache |
   remove template | install template | update template | help
vzpkg install [-p] [-C|-r] [-n] [-f] [-q|-d <level>]
          <VEID>|<VENAME> <object> [...]
vzpkg update  [-p] [-C|-r] [-n] [-f] [-q|-d <level>]
          <VEID>|<VENAME> [<object> [...]]
vzpkg remove  [-p] [-C|-r] [-n] [-f|-w] [-q|-d <level>]
          <VEID>|<VENAME> <object> [...]
vzpkg localinstall [-C|-r] [-n] [-q|-d <level>]
          <VEID>|<VENAME> <file> [...]
vzpkg localupdate  [-C|-r] [-n] [-q|-d <level>]
          <VEID>|<VENAME> <file> [...]
vzpkg upgrade      [-C|-r] [-n] [-q|-d <level>] <VEID>|<VENAME>
vzpkg list [-S] [-p [-u [-C|-r]]] [-q|-d <level>]
          <VEID>|<VENAME> [...]
vzpkg list [-S] [-p [-C|-r]] [-A|-O] [-q|-d <level>] [<OS template> [...]]
vzpkg create cache [-C|-r] [-f] [-q|-d <level>] [<OS template> [...]]
vzpkg update cache [-C|-r] [<OS template> [...]]
vzpkg remove cache [-q|-d <level>] [<OS template> [...]]
vzpkg info [-F <OS template>|<VEID>|<VENAME>] [-q|-d <level>] <template>
          [name] [summary] [description] [packages] [repositories] [mirrorlist]
          [package_manager] [distribution] [technologies] [config_path]
          [version] [release] [arch] [package_manager_type]
vzpkg info -p [-C|-r] [-F <OS template>|<VEID>|<VENAME>] [-q|-d <level>]
          <package> [name] [version] [release] [arch] [summary] [description]
vzpkg install template [-f] [-q] <file> ...
vzpkg update template  [-f] [-q] <file> ...
vzpkg remove template  [-f] [-q] [-F <OS template>] <template> ...
vzpkg fetch [-C|-r] [-f] [-O|-A] [-P] [-q|-d <level>] <OS template> [...]
vzpkg update metadata [-C|-r] [-q|-d <level>] [<OS template> [...]]
vzpkg status [-C|-r] [-q|-d <level>] <VEID>|<VENAME>|<OS template>
vzpkg clean [-k|-t|-a] [-f] [-n] [-q|-d <level>] [<OS template> [...]]
vzpkg link [-s] [-C|-r] [-q|-d <level>] <VEID>|<VENAME>
vzpkg upgrade area [-C|-r] [-q|-d <level>] <OS template> [...]
vzpkg help
 Options:
   -f/--force           force option
   -w/--with-depends    remove also packages depending on that
   -n/--check-only      check only mode
   -q/--quiet           quiet mode
   -d/--debug n         set debug level. Practical range : 0-5
                        Default value is 0.
   -p/--packages        interpret objects as packages name
                        (instead of as templates by default)
   -C/--cache           Seek entirely in local packages cache,
                        don't get new packages from network.
                        If something needed is not available locally -
                        vzpkg will fail.
   -u/--custom-pkg      report list of packages, installed into CT but
                        are not available in the template repositories
                        (for list command)
   -S/--with-summary    to print list of templates/packages with summary
   -r/--remote          force to use remote metadata.
   -O/--os              execute for OS templates only
   -A/--app             execute for application templates only
   -F/--for-os <ostemplate>/<VEID>/<VENAME>
                        specify OS template or CT
   -c/--cached          skip cacheable OS templates missed in the cache
   -i/--pkgid           to print system-wide unique templated id
                        instead of template name
   -k/--clean-packages  clean local package cache
   -t/--clean-template  clean template area from unused packages
   -a/--clean-all       clean both
   -e/--expanded        use 'expanded' update mode:
                        upgrade for yum and dist-upgrade for apt-get
   -I/--interactive     use interactive mode of debian package management
   -s/--force-shared    force action for template area on shared partition case
   -P/--separate        execute transaction for each template separately
      --update-cache    update packages in existing cache instead of cache recreation


VZTOP: Display Top Processes by Container ID

       vztop: procps version 3.2.3
usage:  vztop -hv | -bcisS -E ctid -d delay -n iterations [-u user | -U user] -p pid [,pid ...]


VZQUOTA: Manage Quota's

Usage: vzquota [options] command quotaid [command-options-and-arguments]

vzquota commands are:
       init       Initialize quota data for given quotaid
       on         Turn on quota accounting for given quotaid
       off        Turn off quota accounting for given quotaid
       drop       Delete quota limits from file
       setlimit   Set quota limits for given quotaid
       setlimit2  Set L2 quota limits for given quotaid and QUGID
       reload2    Reload L2 quota limits from quota file for given quotaid
       stat       Show usage and quota limits for given quotaid
       show       Show usage and quota limits from quota file

VZLIST: Display Information on VPS on the Node

Usage: vzlist [-a] [-o name[,name...]]
               [-s {name|-name}] [-h <pattern>] [-n] [-N <pattern>]
               [-i ifname] [-H] [-S] [ctid [ctid ...]|-1]
      vzlist -L

   --all -a             list of all CTs
   --output -o          output only specified parameters
   --hostname -h        hostname search pattern
   --name -n            display Container name
   --netif -i <name>    display Container with specified interface
   --name_filter -N     name search pattern
   --description -d     description search pattern
   --sort -s            sort by specified parameter, the - sign before
                        parameter means the sorting order should be reversed
   --no-header -H       supress displaying the header
   --stopped -S         list of stopped CTs
   --list -L            list of allowed parameters
Personal tools