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.

Upgrading a guest by using a libvirt domain XML file

You can upgrade a guest configuration by specifying another libvirt domain XML file with the same guest name.

The example that follows uses a guest called another-guest with the following key parameters:
  • Number of CPUs: 4
  • Number of virtual disks: 2
  • Location of QCOW2 file for disk 0: /var/lib/libvirt/images/another-guest/0-disk.qcow2
  • Location of ISO file for disk 1: /var/lib/libvirt/images/another-guest/1-config.iso
  • Type of disk defined for disk 0: disk
  • Type of disk defined for disk 1: cdrom
  • Memory: 4096 MB
  • vhost interface: dp0vhost0

We can reconfigure the guest by using another XML file with different values for established parameters and a set of additional parameters, for example, a remote display. In reconfiguring the guest, the old parameters are deleted and the guest restarted.

Table 1. Upgrading a guest by using a libvirt domain XML file
Step Command

Switch to configuration mode.

vyatta@vyatta:~$ config
Display the details of the guest that is going to be modified.
vyatta@vyatta# show virtualization 
 virtualization {
        guest another-guest {
                cpus 4
                devices {
                        disk 0 {
                                boot-order 1
                                bus-type virtio
                                device-type disk
                                source {
                                        file /var/lib/libvirt/images/another-guest/0-disk.qcow2
                                }
                        }
                        disk 1 {
                                boot-order 2
                                bus-type ide
                                device-type cdrom
                                source {
                                        file /var/lib/libvirt/images/another-guest/1-config.iso
                                }
                        }
                        network dp0vhost0 {
                                mac-address 52:54:00:16:56:fd
                        }
                }
                memory 4096
                uuid f7333ab9-8e3d-4a87-a27a-6d5d7d6e99ba
        }
 }
Display the bridge details for the guest.
vyatta@vyatta# show interfaces bridge 
 bridge br20
Display the vhost interfaces for the guest.
vyatta@vyatta# show interfaces vhost 
 vhost dp0vhost0 {
        bridge-group {
                bridge br20
        }
        description vhost0
 }
Exit the configuration mode.
vyatta@vyatta# exit
logout
Apply the new libvirt domain XML file for the guest in operational mode.
vyatta@vyatta:~$ upgrade virtualization xml /home/vyatta/new-another-guest.xml
[INFO] - Deleted existing guest "another-guest" config
[INFO] - Deleted vhost interface "dp0vhost0"
[INFO] - Configured vhost interface "dp0vhost0"
[INFO] - Configured vhost interface "dp0vhost1"
[INFO] - Configured guest "another-guest"
[INFO] - Powering off existing guest "another-guest"
[INFO] - Starting guest "another-guest"
[INFO] - Configuration saved
[INFO] - Upgrade using /home/vyatta/new-another-guest.xml complete
Switch to the configuration mode.
vyatta@vyatta:~$ config
Display the new parameters of the guest.
vyatta@vyatta# show virtualization 
 virtualization {
        guest another-guest {
                cpus 2
                devices {
                        disk 0 {
                                boot-order 1
                                device-type disk
                                source {
                                        file /var/lib/libvirt/images/another-guest/0-disk.qcow2
                                }
                        }
                        disk 1 {
                                boot-order 2
                                bus-type ide
                                device-type cdrom
                                source {
                                        file /var/lib/libvirt/images/another-guest/1-config.iso
                                }
                        }
                        display {
                                connection-type vnc
                                password "********"
                                port 5900
                        }
                        network dp0vhost0 {
                                mac-address 52:54:00:4c:ba:05
                        }
                        network dp0vhost1 {
                                mac-address 52:54:00:07:f7:24
                        }
                }
                memory 2048
                uuid 18949bf1-5d1b-4d7b-b768-f4029d24bdcb
        }
 }
Display the vhost interfaces for the guest.
vyatta@vyatta# show interfaces vhost
 vhost dp0vhost0 {
        address 10.10.10.1/24
 }
 vhost dp0vhost1 {
        address 10.10.15.1/24
 }