Table of Contents


Virtualisation with OpenVZ

Common tasks

I use 101 as the vpsid in these expamples.

start, stop, restart, status

vzctl start 101
vzctl stop 101 [--fast]
vzctl restart 101
vzctl status 101

run command inside VPS

vzctl exec someprog 101
vzctl exec2 someprog 101

enter a VPS

vzctl enter 101

set configuration/parameters for VPS

vzctl set 101 --setting_name value [--save]

vzctl set 101 --ipadd --save

list VPSs

Usage:  vzlist [-a | -S] [-n] [-H] [-o field[,field...] | -1] [-s [-]field]
               [-h pattern] [-N pattern] [-d pattern] [CTID [CTID ...]]
        vzlist -L | --list

        -a, --all               list all containers
        -S, --stopped           list stopped containers
        -n, --name              display containers' names
        -H, --no-header         suppress columns header
        -o, --output            output only specified fields
        -1                      synonym for -H -octid
        -s, --sort              sort by the specified field
                                ('-field' to reverse sort order)
        -h, --hostname          filter CTs by hostname pattern
        -N, --name_filter       filter CTs by name pattern
        -d, --description       filter CTs by description pattern
        -L, --list              get possible field names


Connecting eth1 of VPS 102 to vmbr1 - if not specified, vmbr0 would be chosen by default.

vzctl set 102 --netif_add eth1,,,,vmbr1 --save

In the config file this will show up like something like this:


virtual/openvz.txt · Last modified: 2012-03 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready