User`s guide

Reference 93
vzctl create
This command is used to create a new Virtual Private Server. It has the following syntax:
vzctl create vpsid [--ostemplate name] [--config name]
[--private path] [--root path]
With this command, you can create Virtual Private Servers. Virtual Private Server ID vpsid is
required for this command and shall be unique for the Hardware Node.
Note: Virtual Private Server IDs from 1 to 100 are reserved for internal OpenVZ needs. Do not
use IDs from 1 to 100 for your Virtual Private Servers.
Command arguments are as follows:
--ostemplate name
Denotes package set (OS template) to use when creating the Virtual
Private Server. If omitted, this value is taken from the global OpenVZ
configuration file (
DEF_OSTEMPLATE parameter).
--config name
Optional. If this option is given, vzctl copies the values from the
sample VPS configuration file located in /etc/sysconfig/vz-
scripts and having the name in the form of ve-name.conf-
sample. The sample configuration files usually have a number of
resource control limits for the VPS. If you skip this option and the
default configuration file name is not specified in the global OpenVZ
configuration file, you will have to set resource control parameters
for the VPS by using the vzctl set command before you are able
to start the VPS.
--private path
Optional. When used specifies path to the Virtual Private Server
private area. This option is used to override default path to private
area from the /etc/sysconfig/vz configuration file
(VE_PRIVATE variable). The argument can contain $VEID string
which will be replaced by numeric VPS ID value.
--root path
Optional. When used specifies path to the mount point of the Virtual
Private Server root directory. This option is used to override default
path to VPS root directory from the /etc/sysconfig/vz
configuration file (VE_ROOT variable). The argument can contain
$VEID string which will be replaced by numeric VPS ID value.
When creating a new Virtual Private Server, you should specify a unique ID for it. There are no
restrictions besides uniqueness from the vzctl standpoint. However, it is advisable to assign
different ID ranges to hardware nodes in multi-node environments. For example, you can use
IDs from 101 to 2000 on the first node, IDs from 2001 to 4000 on the second one and so on.
This will help you in tracking down the node where VPS was created and will eliminate
possibility of VPS IDs conflicts when migrating Virtual Private Servers between Nodes.