Este conteúdo não está disponível no idioma selecionado.

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>
Copy to Clipboard Toggle word wrap

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:
Expand
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:
  • 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 to be executed when the guest virtual machine requests a reboot. Four 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, the 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 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 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:
  • 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.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat