14.5.23. Creating a Virtual Machine XML Dump (Configuration File)
Output a guest virtual machine's XML configuration file with
virsh
:
virsh dumpxml {guest-id, guestname or uuid}
# virsh dumpxml {guest-id, guestname or uuid}
This command outputs the guest virtual machine's XML configuration file to standard out (
stdout
). You can save the data by piping the output to a file. An example of piping the output to a file called guest.xml:
virsh dumpxml GuestID > guest.xml
# virsh dumpxml GuestID > guest.xml
This file
guest.xml
can recreate the guest virtual machine (refer to Section 14.6, “Editing a Guest Virtual Machine's configuration file”. You can edit this XML configuration file to configure additional devices or to deploy additional guest virtual machines.
An example of
virsh dumpxml
output:
Note that the <shareable/> flag is set. This indicates the device is expected to be shared between domains (assuming the hypervisor and OS support this), which means that caching should be deactivated for that device.