linux VPS Commands

Utility vzctl runs on host server (HS) and performs direct manipulations with Container (CT).

Containers can be referred to by numeric ctid (or name which can be assigned with --name option).

Note
that CT ID <= 100 are reserved for Virtuozzo internal purposes.


Following commands turn the quota on or off for the particular Container; the vzctl quotainit command forces the quota to be initialized for the Container, i.e. its disk space and inodes recalculated. The Container ID must be specified after these commands with no additional options:

vzctl quotaon

vzctl quotaoff

vzctl quotainit

When the quota is turned on or initialized for the specified Container, the quota settings are taken from the Container configuration file. If you wish to change these settings, you should use the vzctl set command.


============================================

vzctl

vzctl is the primary tool for Container management. To use it, you have to log in to the Hardware Node as the root user. The syntax of vzctl is:
CT_ID>>>>is Container ID set

vzctl [--quiet | --verbose] command CT_ID

vzctl --version

vzctl --help

Where command can be one of the following:

convert : Used to convert legacy Containers to the new Virtuozzo Containers 4.0 directory layout.

create : Used to create Containers.

delete : Used to remove a Container.

Like vzctl delete, this command is also used to remove a Container from the Hardware Node.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mounting and Unmounting

vzctl mount CT_ID : Allows mounting the Container private area and executing the Container mount script.

vzctl umount CT_ID : Allows dismounting the Container private area and executing the unmount script.

start : Starts a Container.

stop : Stops a Container.

restart : Restarts a Container.

status : Displays the Container status.

vzctl set ctid :
This command sets various CT parameters. If flag --save is given, parameters are saved in CT configu
ration file ve.conf(5). If CT is currently running, vzctl applies these parameters to CT, in case
--setmode option specified apply logic for parameters that canĂ¢t be applied or tunning CT will be
changed, if restart -restart CT, if ignore - ignore error. Parameters that can not be applied run-
time are capability, quotaugidlimit, bindmount, and iptables.

The following options can be used with set command.

Miscellaneous parameters

--setmode restart|ignore
Change default mode for apply parameters that can not be applied on running CT. restart - restart CT,
ignore - ignore error.

--onboot yes|no
Sets whether this CT will be started during system boot up. CT will not be auto-started during system
boot up unless this parameter is set to yes.

--root path
Sets path to root directory for this CT. This is essentially a mount point for CT root. Value must
contain string $VEID, which will be substituted with numeric CT ID. Changing this parameter is not
recommended, better edit vz(5) global configuration file.

--userpasswd user:password
Sets password for given user in CT, creating the user if it does not exists. Note that this option is
not saved in configuration file at all (so --save flag is useless), it is applied to CT (by modifying
its /etc/passwd and /etc/shadow files).

In case CT root is not mounted, it is automatically mounted, then all appropriate file changes are
applied, then it is unmounted.

Note that CT area should be created before using this option.

--disabled yes|no :
Disable CT start. For force start disabled CT option --force can be used.

--name name :
Bind CT with name, it allows to use name unstead of CT ID. The valid symbols for name are [0-9][aA-
Zz][ -_.] and all international sybmols.

--description desc :
Assing description for CT. It can be viewed by vzlist utility.

--ipadd addr :
Network related parameters


vzctl start : Start the container

vzctl create {--pkgset [--pkgver ] | --ostemplate }
[--config ] [--private ] [--root ]
[--ipadd ] | [--hostname ] [--skip_app_templates] : Create Container with the package , configuration, allocating ipaddress, signing hostname , etc..

vzctl convert CT_ID :
In Virtuozzo 4.0 Container is created in new (4.0) layout. All private data (config,
scripts, quota) resides under CT private. Convert action convert Container from old to
4.0 layout.


vzctl set [--save] [--ipadd ] [--ipdel |all]
Used to set Container parameters, including resource control settings, the location of the Container private area, hostname, IP addresses, and Container root user password.

vzctl unset
: Used to remove Container parameters (resource control settings, IP addresses, etc.) from the configuration file.
vzctl enter
: Provides a way for the Hardware Node administrator to "enter" a Container without knowing the Container root password. Use this command with caution and never run it on un-trusted Containers.

exec, exec2 : These two commands allow running arbitrary commands inside a Container without logging in to the corresponding Container. The difference between two is the returned status.

vzctl recover : Recovers the original state of the Container system and application files in case something has been broken. The user files are left intact.

vzctl quotaon
: Turns the disk quota on for the given Container.

quotaoff
: Turns the disk quota off for the given Container.

quotainit
: Initializes the disk quota for the given Container with the parameters taken from the Container configuration file.


Pages