
Operations on Virtual Private Servers
32
Choosing Virtual Private Server ID
Every Virtual Private Server has a numeric ID, also known as VPS ID, associated with it. The
ID is a 32-bit integer number beginning with zero and unique for a given Hardware Node. When
choosing an ID for your Virtual Private Server, please follow the simple guidelines below:
ID 0 is used for the Hardware Node itself. You cannot and should not try to create a Virtual
Private Server with ID 0.
OpenVZ reserves the IDs ranging from 0 to 100. Though OpenVZ uses only ID 0, different
versions might use additional Virtual Private Servers IDs for internal needs.
To facilitate
upgrading, please do not create Virtual Private Servers with IDs below 101.
The only strict requirement for a VPS ID is to be unique for a particular Hardware Node.
However, if you are going to have several computers running OpenVZ, we recommend
assigning different VPS ID ranges to them. For example, on Hardware Node 1 you create
Virtual Private Servers within the range of IDs from 101 to 1000; on Hardware Node 2 you use
the range from 1001 to 2000, and so on. This approach makes it easier to remember on which
Hardware Node a Virtual Private Server has been created, and eliminates the possibility of VPS
ID conflicts when a Virtual Private Server migrates from one Hardware Node to another.
Another approach to assigning VPS IDs is to follow some pattern of VPS IP addresses. Thus,
for example, if you have a subnet with the 10.0.x.x address range, you may want to assign the
17015 ID to the VPS with the 10.0.17.15 IP address, the 39108 ID to the VPS with the
10.0.39.108 IP address, and so on. This makes it much easier to run a number of OpenVZ
utilities eliminating the necessity to check up the VPS IP address by its ID and similar tasks.
You can also think of your own patterns for assigning VPS IDs depending on the configuration
of your network and your specific needs.
Before you decide on a new VPS ID, you may want to make sure that no VPS with this ID has
yet been created on the Hardware Node. The easiest way to check whether the VPS with the
given ID exists is to issue the following command:
# vzlist -a 101
VPS not found
This output shows that Virtual Private Server 101 does not exist on the particular Hardware
Node; otherwise it would be present in the list.