Questo contenuto non è disponibile nella lingua selezionata.

20.12. Events Configuration


Using the following sections of domain XML it is possible to override the default actions taken on various events.

  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <on_lockfailure>poweroff</on_lockfailure>

Figure 20.18. Events configuration

The following collections of elements allow the actions to be specified when a guest virtual machine OS triggers a life cycle operation. A common use case is to force a reboot to be treated as a poweroff when doing the initial OS installation. This allows the VM to be re-configured for the first post-install bootup.
The components of this section of the domain XML are as follows:
Table 20.10. Event configuration elements
StateDescription
<on_poweroff>Specifies the action that is to be executed when the guest virtual machine requests a poweroff. Four possible arguments are possible:
  • destroy - this action terminates the domain completely and releases all resources
  • restart - this action terminates the domain completely and restarts it with the same configuration
  • preserve - this action terminates the domain completely but and its resources are preserved to allow for future analysis.
  • rename-restart - this action terminates the domain completely and then restarts it with a new name
<on_reboot>Specifies the action that is to be executed when the guest virtual machine requests a reboot. Four possible arguments are possible:
  • destroy - this action terminates the domain completely and releases all resources
  • restart - this action terminates the domain completely and restarts it with the same configuration
  • preserve - this action terminates the domain completely but and its resources are preserved to allow for future analysis.
  • rename-restart - this action terminates the domain completely and then restarts it with a new name
<on_crash>Specifies the action that is to be executed when the guest virtual machine crashes. In addition, it supports these additional actions:
  • coredump-destroy - the crashed domain's core is dumped, domain is terminated completely, and all resources are released.
  • coredump-restart - the crashed domain's core is dumped, and the domain is restarted with the same configuration settings
Four possible arguments are possible:
  • destroy - this action terminates the domain completely and releases all resources
  • restart - this action terminates the domain completely and restarts it with the same configuration
  • preserve - this action terminates the domain completely but and its resources are preserved to allow for future analysis.
  • rename-restart - this action terminates the domain completely and then restarts it with a new name
<on_lockfailure>Specifies what action should be taken 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:
  • poweroff - forcefully powers off the domain
  • restart - restarts the domain to reacquire its locks.
  • pause - pauses the domain so that it can be manually resumed when lock issues are solved.
  • ignore - keeps the domain running as if nothing happened.
Red Hat logoGithubRedditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita ilBlog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

© 2024 Red Hat, Inc.