home

Supported platforms

Vyatta documentation

Learn how to install, configure, and operate the Vyatta Network Operating System (Vyatta NOS) and Orchestrator, which help drive our virtual networking and physical platforms portfolio.

Supported libvirt domain XML elements and attributes

You can generate examples of libvirt domain XML tags by running the virsh dumpxml <domain> command. Only specific libvirt domain XML elements and attributes are supported.

The format for libvirt domain XML is described by https://libvirt.org/formatdomain.html. The XML file specifies the guest and guest hardware details. The XML file is parsed, processed, and translated into a number of vCPE virtualization commands.

The following table lists the supported libvirt domain XML elements and attributes. The element and attribute values used in the following tables are examples only. For XML code snippets that include the supported elements and attributes, refer to Sample XML snippet for the libvirt domain XML file.

Legend for the table:
  • The XML element names are shown with leading and trailing angle brackets, such as <name>.
  • The XML attribute values are enclosed within single quotation marks, such as 'device'.
  • Variables are denoted by the italicized font.
  • The commands and XML snippets are in monospace font.
Table 1. Supported XML elements and attributes
XML element or attribute vCPE command Description
<domain type='kvm'>:</domain>

The rest of the guest XML specifications must be enclosed by the <domain> element with a 'type' attribute of 'kvm'.

<name>aguest</name>
set virtualization guest <guest-name>

The XML must contain a nonblank <name> element.

The value of the <name> element becomes the guest name in the subsequent vCPE commands.

<vcpu>2</vcpu>
set virtualization guest <guest-name> cpus 2

The <vcpu> element defines the number of virtual CPUs assigned to the guest.

<vcpu cpuset='2-3'>2</vcpu>
set virtualization guest <guest-name> cpuset 2-3

The <cpuset> element defines the virtual CPU affinity.

<memory>1048576</memory>
set virtualization guest <guest-name> memory 1024 The <memory> element defines the amount of memory allocated to the guest. The default memory unit is kilobytes (blocks of 1024 bytes), but you can change it by using the <memory unit='..'> attribute. For more information, refer to xx.
<uuid>d4d15d82-f21e-4b0a-bb91-3224cfbc8514</uuid>
set virtualization guest <guest-name> uuid d4d15d82-f21e-4b0a-bb91-3224cfbc8514

Defines the UUID assigned to the guest. The UUID is generated automatically if the element is not present.

<devices>:</devices>

All hardware devices must be contained within the <devices> element. The <devices> subelements that are supported are: <disk>, <interface>, <graphics>, <video>, and <watchdog>.

<disk device='cdrom'>...</disk>

<disk device='disk'>...</disk>
set virtualization guest <guest-name> devices disk <disk-id> device-type {cdrom | disk}

The <disk> element must always have a 'device' attribute with a valid value. Two types of disk devices are supported: 'cdrom' and 'disk'.

The <disk-id> is automatically allocated on a per-guest basis, starting with the lowest unused disk-id (from 0 to 7).

The <disk> element may contain a <target> or a <boot> subelement.

<target bus='ide'/>
set virtualization guest <guest-name> devices disk <disk-id> bus-type ide

The attribute 'ide' is normally used for cdrom drives.

<target bus='sata'/>
set virtualization guest <guest-name> devices disk <disk-id> bus-type sata
<target bus='virtio'/>
set virtualization guest <guest-name> devices disk <disk-id> bus-type virtio

The attribute 'virtio' is normally used for disk drives.

<boot order='3'/>
set virtualization guest <guest-name> devices disk <disk-id> boot-order 3

The <boot> element may contain an 'order' attribute whose value determines the boot order of the disk devices. If the <boot> element is missing, or if it does not have an 'order' attribute, the disk is given a default boot-order number equal to its <disk-id> plus 1. So disk 0 has a default boot-order of 1, disk 1 has a default boot-order of 2, and so on.

<interface type='...'>: </interface>

The <interface> element must always have a 'type' attribute with a valid value. Two types of interface devices are supported: 'bridge' and 'ethernet'. Both interface types can contain a <target> element which can have a 'dev' attribute.

<target dev='...'/>
<mac-address='52:54:00:4b:d6:fd'/>
set interfaces vhost dp0vhost<n> mac-address 52:54:00:4b:d6:fd

The <mac-address> element sets the MAC address of the interface. The value is generated automatically if the element is not present.

<target
dev='dp0vhost8'/>
set interfaces vhost dp0vhost8

When the dev attribute is of the form dp0vhost<n> the deployment attempts to use or create the vhost interface with that particular name.

<target
dev='network-23'/>
set interfaces vhost dp0vhost<n> description 'network-23'

If the 'dev' attribute value does not start with the 'dp0vhost' prefix, the next free vhost interface is automatically created with the set interfaces vhost command. The 'dev' value is inserted into the description field.

<interface type='bridge'>
<source bridge='br4'/>
</interface>
set interfaces vhost dp0vhost<n> bridge-group bridge br4
The 'bridge' type interface can contain a <source> element with a 'bridge' attribute whose value defines the name of the required bridge. The following three outcomes are possible on running the XML snippet.
  • If the specified bridge interface does not already exist in the running configuration of the host, it is automatically configured with the set interfaces bridge command.
  • If the bridge interface already exists, the existing configuration is used.
  • If there is a <target> element that specifies a vhost interface that already exists, the deployment fails if force is not specified. If force is specified, the existing vhost interface configuration is overwritten.
<interface type='ethernet'> <ip address='192.168.1.1'
prefix='24'/> </interface>
set interfaces vhost dp0vhost<n> address 192.168.1.1/24

The 'ethernet' type interface can contain an <ip> subelement that has 'address' and 'prefix' attributes whose values define the IP address of the interface. If there is a <target> element that specifies a vhost interface that already exists, the deployment fails if force is not specified. If force is specified, the existing vhost interface configuration is overwritten.

<graphics type='...'/>

Only the first <graphics> element in the XML file is processed. The <graphics> element must have a 'type' attribute with one of the following two values: 'spice' or 'vnc'. The <graphics> element must also have either a 'port' or an 'autoport' attribute.

<graphics type='spice'port=6543/>
set virtualization guest <guest-name> devices display connection-type spice

set virtualization guest <guest-name> devices display port 6543

If the 'port' attribute value is anything other than '-1', its value is reflected in the devices display port command.

A 'port' attribute value of '-1' is treated as the equivalent of an 'autoport' attribute value of 'yes'.

<graphics type='vnc'autoport='yes'/>
set virtualization guest <guest-name> devices display connection-type vnc

set virtualization guest <guest-name> devices display port 5900

When 'autoport' is 'yes', the first unused port number greater than 5899 is used.

<graphics passwd='top-secret'/>
set virtualization guest <guest-name> devices display password top-secret

The password passed and stored in the configuration is in clear text, and, therefore, is not secure.

<graphics>
<listen type='address' address='127.0.0.1'/>
</graphics>
set virtualization guest <guest-name> devices display address 127.0.0.1

The listen element (or attribute) causes the display to only listen for connections on the configured address. The configured address must be assigned to an interface of the vCPE host.

<graphics tlsPort='1234'/>

Currently, the 'tlsPort' attribute is ignored.

<video>:</video>
set virtualization guest <guest-name> devices video ...

Only the first <video> element in the XML file is processed. The <video> element must have a <model> subelement with a 'type' attribute with one of the following three values: 'cirrus', 'qxl' or 'vga'.

<model type='cirrus'/>
set virtualization guest <guest-name> devices video model cirrus
<model type='qxl'/>
set virtualization guest <guest-name> devices video model qxl
<model type='vga'/>
set virtualization guest <guest-name> devices video model vga
<model type='qxl' vram='8196'/>
set virtualization guest <guest-name> devices video memory 8196

The <model> element may also have the optional 'vram' attribute.

<watchdog model='i6300esb'/>
set virtualization guest <guest-name> devices watchdog ...

Only the first <watchdog> element in the XML file is processed. The <watchdog> element must have the 'model' attribute, and its value must be 'i6300esb'. The <watchdog> element may also contain an optional 'action' attribute that can have one of the following values: 'none, 'poweroff' or 'reset'.

<watchdog model='i6300esb'action='none'/>
set virtualization guest <guest-name> devices watchdog action none
<watchdog model='i6300esb'action='poweroff'/>
set virtualization guest <guest-name> devices watchdog action poweroff
<watchdog model='i6300esb'action='reset'/>
set virtualization guest <guest-name> devices watchdog action reset