Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
23.13. Events Configuration
Using the following sections of domain XML it is possible to override the default actions for various events:
<on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <on_lockfailure>poweroff</on_lockfailure>
Figure 23.23. Events Configuration
The following collections of elements allow the actions to be specified when a guest virtual machine operating system triggers a life cycle operation. A common use case is to force a reboot to be treated as a power off when doing the initial operating system installation. This allows the VM to be re-configured for the first post-install boot up.
The components of this section of the domain XML are as follows:
Table 23.9. Event configuration elements
State | Description |
---|---|
<on_poweroff> | Specifies the action that is to be executed when the guest virtual machine requests a power off. Four arguments are possible:
|
<on_reboot> | Specifies the action to be executed when the guest virtual machine requests a reboot. Four arguments are possible:
|
<on_crash> | Specifies the action that is to be executed when the guest virtual machine crashes. In addition, it supports these additional actions:
|
<on_lockfailure> | Specifies the action to take when a lock manager loses resource locks. The following actions are recognized by libvirt, although not all of them need to be supported by individual lock managers. When no action is specified, each lock manager will take its default action. The following arguments are possible:
|