Ce contenu n'est pas disponible dans la langue sélectionnée.

14.8.7. Save a Guest Virtual Machine


Save the current state of a guest virtual machine to a file using the virsh command:
# virsh save {domain-name|domain-id|domain-uuid} state-file --bypass-cache --xml --running --paused --verbose
This stops the guest virtual machine you specify and saves the data to a file, which may take some time given the amount of memory in use by your guest virtual machine. You can restore the state of the guest virtual machine with the restore (Section 14.8.11, “Restore a Guest Virtual Machine”) option. Save is similar to pause, instead of just pausing a guest virtual machine the present state of the guest virtual machine is saved.
The virsh save command can take the following options:
  • --bypass-cache - causes the restore to avoid the file system cache but note that using this option may slow down the restore operation.
  • --xml - this option must be used with an XML file name. Although this option is usually omitted, it can be used to supply an alternative XML file for use on a restored guest virtual machine with changes only in the host-specific portions of the domain XML. For example, it can be used to account for the file naming differences in underlying storage due to disk snapshots taken after the guest was saved.
  • --running - overrides the state recorded in the save image to start the domain as running.
  • --paused- overrides the state recorded in the save image to start the domain as paused.
  • --verbose - displays the progress of the save.
If you want to restore the guest virtual machine directly from the XML file, the virsh restore command will do just that. You can monitor the process with the domjobinfo and cancel it with the domjobabort.
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.