Product SiteDocumentation Site

Chapter 28. Manipulating the domain XML

28.1. General information and metadata
28.2. Operating system booting
28.2.1. BIOS bootloader
28.2.2. Host physical machine bootloader
28.2.3. Direct kernel boot
28.2.4. Container boot
28.3. SMBIOS system information
28.4. CPU allocation
28.5. CPU tuning
28.6. Memory backing
28.7. Memory tuning
28.8. Memory allocation
28.9. NUMA node tuning
28.10. Block I/O tuning
28.11. Resource partitioning
28.12. CPU model and topology
28.12.1. Changing the feature set for a specified CPU
28.12.2. Guest virtual machine NUMA topology
28.13. Events configuration
28.14. Power Management
28.15. Hypervisor features
28.16. Time keeping
28.17. Timer element attributes
28.18. Devices
28.18.1. Hard drives, floppy disks, CD-ROMs
28.18.2. Filesystems
28.18.3. Device addresses
28.18.4. Controllers
28.18.5. Device leases
28.18.6. Host physical machine device assignment
28.18.7. Redirected devices
28.18.8. Smartcard devices
28.18.9. Network interfaces
28.18.10. Input devices
28.18.11. Hub devices
28.18.12. Graphical framebuffers
28.18.13. Video devices
28.18.14. Consoles, serial, and channel devices
28.18.15. Guest virtual machine interfaces
28.18.16. Channel
28.18.17. Host physical machine interface
28.18.18. Sound devices
28.18.19. Watchdog device
28.18.20. Setting a panic device
28.18.21. Memory balloon device
28.18.22. TPM devices
28.19. Storage pools
28.19.1. Providing metadata for the storage pool
28.19.2. Source elements
28.19.3. Creating target elements
28.19.4. Setting device extents
28.20. Storage Volumes
28.20.1. General metadata
28.20.2. Setting target elements
28.20.3. Setting backing store elements
28.21. Security label
28.22. A Sample configuration file
This chapter explains in detail the components of the domain.xml configuration file. In this chapter, the term domain refers to the root <domain> element required for all guest virtual machines. The domain XML has two attributes: type and id. type specifies the hypervisor used for running the domain. The allowed values are driver specific, but include KVM and others. id is a unique integer identifier for the running guest virtual machine. Inactive machines have no id value. The sections in this chapter will describe the components of the domain XML. Additional chapters in this manual may refer to this chapter when manipulation of the domain XML is required.

Important

Use only supported management interfaces (such as virsh) and commands (such as virsh edit) to edit the components of the domain XML file. Do not open and edit the domain XML file directly with a text editor such as vim or gedit.

28.1. General information and metadata

This information is in this part of the domain XML:


<domain type='kvm' id='3'>
  <name>fv0</name>
  <uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
  <title>A short description - title - of the domain</title>
  <description>A human readable description</description>
  <metadata>
    <app1:foo xmlns:app1="http://app1.org/app1/">..</app1:foo>
    <app2:bar xmlns:app2="http://app1.org/app2/">..</app2:bar>
  </metadata>
  ...
</domain> 

Figure 28.1. Domain XML metadata

The components of this section of the domain XML are as follows:

Table 28.1. General metadata elements

Element Description
<name> Assigns a name for the virtual machine. This name should consist only of alpha-numeric characters and is required to be unique within the scope of a single host physical machine. It is often used to form the filename for storing the persistent configuration files.
<uuid> Assigns a globally unique identifier for the virtual machine. The format must be RFC 4122 compliant, for example, 3e3fce45-4f53-4fa7-bb32-11f34168b82b. If omitted when defining or creating a new machine, a random UUID is generated. It is also possible to provide the UUID via a sysinfo specification.
<title> Creates space for a short description of the domain. The title should not contain any new lines.
<description> Different from the title, this data is not used by libvirt. It can contain any information the user chooses to display.
<metadata> Can be used by applications to store custom metadata in the form of XML nodes/trees. Applications must use custom namespaces on XML nodes/trees, with only one top-level element per namespace (if the application needs structure, they should have sub-elements to their namespace element).