Rebooting OpenVZ containers

The /etc/init.d/reboot file in the ProxMox VE Host is altered to make the do_stop() function as:
Code:
do_stop () {
        # Message should end with a newline since kFreeBSD may
        # print more stuff (see #323749)
        touch /reboot
        log_action_msg "Will now restart"
        reboot -d -f -i
}
This will ensure the presence of a /reboot file in the guest when a reboot is signalled from within the guest.

We may need to put in ALLOWREBOOT="yes" in the /etc/vz/conf/XXX.conf file where XXX is the VEID.

After an average of 2 to 3 minutes, the guest will then restart. Any way to make it immediate?

The entries in /etc/vz/cron/vz file are:
Code:
# Clean containers' network rules (arp,route,iptables)
*/5 * * * * root /usr/share/vzctl/scripts/vpsnetclean
 
# Start containers marked as rebooted.
*/5 * * * * root /usr/share/vzctl/scripts/vpsreboot
That is every 5 minutes a reboot!

On a properly working Proxmox VE v1.8, none of the above is necessary. This post is only a stop-gap fix till the actual reason of why the /reboot file is not being written within the container is found.
 
Last edited:
hi,
im having the same problem thats being listed here, ive got some openvz templates from openvz's website and they are not restarting.
the servers are just simply mounting themselves and then after 5 mins they are up again...
ive changed the /etc/vz/cron/vz file to every minute to reboot the machine and thats ok, however i wanted it to reboot, STRAIGHT AWAY!

ive tried the touch /reboot in the /etc/init.d/reboot in function (do_stop()) on both the Proxmox server and then openvz container and that still makes no difference :(

does any one have any more ideas?

also another thing ive noticed is that, when i tell the server to 'shutdown -h now' it just simply mounts the container and does not stop it? is this sopose to happen?

Cheers

SASmith
Simon Smith
 
The last time it worked correctly was in v1.3 without the updates.

Since there is no public SVN for the Proxmox VE GUI (even in read-only mode), it is difficult to trace back.

Each Proxmox rpm release has the time stamp on all the files in the rpms set to the release date rather than the date of change. This makes it difficult to vet the effects of specific changes. Such an SVN for public readonly access atleast for the text scripts would enable the community to enhance features and correct bugs fast. Features such as "restore from snapshot" and "template update" using chroot could be built into the GUI without fear of having them being overwritten by "updates".
 
The last time it worked correctly was in v1.3 without the updates.

I doubt that this is related to changes in proxmox VE packages. Instead I think it is related to dependency based startup scripts used inside containers. We need to update to newer vzctl (vzevent support) - which means that we can no longer support 2.6.24 kernel.
 
if you enable the pvetest repo you will get three new packages (pve-manager vzctl vzdump).

finally you will get:

Code:
pveversion -v

pve-manager: 1.8-16 (pve-manager/1.8/5829)
running kernel: 2.6.32-4-pve
proxmox-ve-2.6.32: 1.8-32
pve-kernel-2.6.32-4-pve: 2.6.32-32
qemu-server: 1.1-30
pve-firmware: 1.0-11
libpve-storage-perl: 1.0-17
vncterm: 0.9-2
vzctl: 3.0.26-1pve2
vzdump: 1.2-12
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.14.0-3
ksm-control-daemon: 1.0-5

I did already some tests with the new vzctl - rebooting immediately is working great so far, a real big improvement.