Show Table of Contents
20.20. Creating a Virtual Machine XML Dump (Configuration File)
The
virsh dumpxml command will return the guest virtual machine's XML configuration file which you can then use, save, or change as needed.
The XML file (
guest.xml) can then be used to recreate the guest virtual machine (refer to Section 20.22, “Editing a Guest Virtual Machine's XML Configuration Settings”. You can edit this XML configuration file to configure additional devices or to deploy additional guest virtual machines.
Example 20.48. How to retrieve the XML file for a guest virtual machine
The following example retrieves the XML configuration of the guest1 virtual machine, and pipes it int othe guest1.xml file.
# virsh dumpxml guest1 | guest1.xml
<domain type='kvm'>
<name>guest1-rhel6-64</name>
<uuid>b8d7388a-bbf2-db3a-e962-b97ca6e514bd</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='rhel6.2.0'>hvm</type>
<boot dev='hd'/>
</os>
[...]

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.