Article ID: 112395, created on Sep 28, 2011, last review on Apr 17, 2012

  • Applies to:
  • Virtuozzo hypervisor 5.0

Information

Parallels Server 5 Bare Metal offers new feature of virtual machine state control hooks. These are custom scripts which are executed upon virtual machine status change:
prestart
poststart
prestop
poststop

One may create these scripts in virtual machine directory under scripts subfolder and add execute permissions:
/vz/vmprivate/VMNAME.pvm/scripts/prestart
/vz/vmprivate/VMNAME.pvm/scripts/poststart
/vz/vmprivate/VMNAME.pvm/scripts/prestop
/vz/vmprivate/VMNAME.pvm/scripts/poststop
~# chmod a+x /vz/vmprivate/VMNAME.pvm/scripts/*


These scripts are executed in hardware node context. The following environment variables are passed to these scripts:
VM_HOME - virtual machine home directory
UUID - virtual machine UUID

Prestart is executed before start command is sent to a virtual machine, poststart is executed after start command returns successful result.
The same is valid for prestop and poststop scripts.

For more information regarding scripts execution refer to this table:
  to state
from state Running Stopped Suspended Paused
Running n\a prestop
poststop
prestop
poststop
no script
Stopped prestart
poststart
n\a not possible not possible
Suspended prestart
poststart
prestop
poststop
n\a prestart
poststart
Paused no script prestop
poststop
prestop
poststop
n\a

And this chart:


c662da62f00df94fd77ba7a2c9eff4b4 a26b38f94253cdfbf1028d72cf3a498b 2897d76d56d2010f4e3a28f864d69223

Email subscription for changes to this article
Save as PDF