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 and keeping the old files

You can use the keep-old-images option with the upgrade virtualization xml command to prevent the deletion of old images.

The example that follows uses a guest called another-guest with the following key parameters for the XML file:
  • Number of CPUs: 2
  • Number of virtual disks: 2
  • Type of disk defined for disk 0: disk
  • Type of disk defined for disk 1: cdrom
  • Memory: 2048 MB
  • vhost interface: dp0vhost0 and dp0vhost1

We can upgrade the images for both disk 0 and disk 1 with a single command. The old images are not overwritten.

Table 1. Upgrading a guest and keeping the old files
Step Command

Switch to configuration mode.

vyatta@vyatta:~$ config
Display the details of the guest parameters.
vyatta@vyatta# show virtualization guest
 guest another-guest {
        cpus 2
        devices {
                disk 0 {
                        boot-order 1
                        bus-type virtio
                        device-type disk
                        source {
                                file /var/lib/libvirt/images/another-guest/0-newer-disk.qcow2
                        }
                }
                disk 1 {
                        boot-order 2
                        bus-type ide
                        device-type cdrom
                        source {
                                file /var/lib/libvirt/images/another-guest/1-newer-config.iso
                        }
                }
                display {
                        connection-type vnc
                        password "********"
                        port 5900
                }
                network dp0vhost0 {
                        mac-address 52:54:00:3f:9a:c4
                }
                network dp0vhost1 {
                        mac-address 52:54:00:08:0d:ad
                }
        }
        memory 2048
        uuid 20b03fea-93b6-454c-b9fd-678dd27aeafa
Display the vhost interfaces of the guest called another-guest.
vyatta@vyatta# show interfaces vhost 
 vhost dp0vhost0 {
        address 10.10.10.1/24
 }
 vhost dp0vhost1 {
        address 10.10.15.1/24
 }
Exit the configuration mode.
vyatta@vyatta# exit
logout
Apply the new XML file, new guest image, and new ISO file for the guest.
vyatta@vyatta:~$ upgrade virtualization xml /home/vyatta/latest-another-guest.xml image /home/vyatta/latest-disk.qcow2 iso /home/vyatta/latest-config.iso keep-old-images 
[INFO] - Deleted existing guest "another-guest" config
[INFO] - Deleted vhost interface "dp0vhost0"
[INFO] - Deleted vhost interface "dp0vhost1"
[INFO] - Configured vhost interface "dp0vhost0"
[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/latest-another-guest.xml complete
Switch to the configuration mode.
vyatta@vyatta:~$ config
Display the details of the upgraded guest.
vyatta@vyatta# show virtualization guest 
 guest another-guest {
        cpus 2
        devices {
                disk 0 {
                        boot-order 1
                        device-type disk
                        source {
                                file /var/lib/libvirt/images/another-guest/0-latest-disk.qcow2
                        }
                }
                disk 1 {
                        boot-order 2
                        bus-type ide
                        device-type cdrom
                        source {
                                file /var/lib/libvirt/images/another-guest/1-latest-config.iso
                        }
                }
                network dp0vhost0 {
                        mac-address 52:54:00:28:5a:ae
                }
        }
        memory 2048
        uuid 91903030-2ed7-40f3-a4d9-a7a440de1711
 }
Display the vhost interfaces of the upgraded guest.
vyatta@vyatta# show interfaces vhost
 vhost dp0vhost0 {
        address 10.10.10.1/24
 }