Resolution
Here are the most common causes of a container not starting.
The container starts but shuts down after a few minutes.
You probably do not have a valid license installed; it might be expired or the number of containers is exceeded. Please check the output of the
vzlicview
command. The status of the license should be ACTIVE and thect_total
value in brackets should be not greater thanct_total
. More information about licenses can be found in the article How do I check/install a Parallels Virtuozzo Containers license?The container cannot be started because it is locked.
Please follow the instructions from this article.
The container starts but displays the error
/bin/bash: no such file
or something similar.The owner of the container could have removed some important package, such as
bash
orglibc
. For containers based on standard templates, you can use the deprecated option of thevzctl
command,vzctl recover CTID
, to recover the private area of the container.Also, the standard OS template the container is based on may be absent from the Hardware Node; you may check it using
vzpkgls CTID
andvzpkgls
and install the missing OS template if it is needed.For containers based on EZ templates, such an error can appear after migrating the container from another node or after restoring the container from a backup. The pre-migration steps and reparative post-migration steps are described in the article Prepare containers for migration.
The container may also be compromised (see below).
The container starts but Segmentation fault occurs very soon after its starting.
The container may be compromised; please check the article How do I determine that my container is hacked/compromised?
The container failed to start with a message like this:
ERROR: Can't write to file /etc/sysconfig/network-scripts/ifcfg-venet0 vzquota : (warning) block_hard_limit [50100] < block_current_usage [60279] vzquota : (warning) block_hard_limit [50100] < block_current_usage [60279]
This error message means that the container exceeded its disk space quota and cannot be started because it is impossible to change system files during container startup. You can check the usage and limits for the container using the following command:
# vzquota show CTID
Solution - Increase
diskspace
(and probablyinodes
) allocated to the container using thevzctl
utility:# vzctl set CTID --diskspace BARRIER:LIMIT --save # vzctl set CTID --diskinodes BARRIER:LIMIT --save
If increasing
blocks
andinodes
limits does not help, try to re-init the quota for this container with the following:# vzctl quotainit CTID
Then start the container.
The container failed to start with a message like this:
Running the command: /etc/sysconfig/vz-scripts/vz-net_add Run the script /etc/sysconfig/vz-scripts/dists/scripts//redhat-add_ip.sh /bin/cp: writing `/etc/sysconfig/network.5': Disk quota exceeded ERROR: Can't copy file /etc/sysconfig/network
Check that the second-level quota for the user
root
was not manually set inside the container:# vzctl mount CTID # vzquota stat CTID -t
Check quotas for users, for example:
... User/group objects: ID type resource usage softlimit hardlimit grace status 0 user 1k-blocks 11464476 358400 358400 none loaded 0 user inodes 716143 0 0 loaded ...
Here the quota for "root" has been exceeded, and the number of used disk blocks exceeds the soft and hard limits, causing the startup issue.
You can reset this quota for the
root
user (UID 0) using the following command:# vzquota setlimit2 CTID -u 0 0 0 0 0
Alternatively, the limit can be reset for any other user or group with the following commands, supplying the proper UID or GID:
# vzquota setlimit2 CTID -u UID 0 0 0 0 # vzquota setlimit2 CTID -g GID 0 0 0 0
The container failed to start with the following:
# vzctl start CTID Owner check failed on the server pcs.hostname.tld; Container is registered for Pcs.hostname.tld
Either the container is registered on another node or someone changed the hostname of the node.
- If the issue is related only to one container, you can manually edit
/vz/private/CTID/.owner
toPcs.hostname.tld
(pcs.hostname.tld
andPcs.hostname.tld
are different; the hostname is case-sensitive). If the issue is related to all containers and they are not listed in the output of the
vzlist -a
command, then the fastest and the proper way is to change the hostname of the node back using the hostname command:# hostname Pcs.hostname.tld
After that, the containers should appear on the node and you will be able to start them. Please note that this is a temporary change and that you should modify the
hostname
in/etc/sysconfig/network
in order for the changes to stick after a reboot.- If the issue is related only to one container, you can manually edit