Overview

 

This document describes the procedure to take a backup and restore a Guest VNF running on a Versa uCPE device. The backup process involves saving the VNF’s virtual disk file, which contains the entire configuration and state of the guest VNF.


Prerequisites 

Before starting the backup or restore process:


- Ensure that the Guest VNF is properly configured and stable.
- You have root or administrative access to the Versa device.
- Adequate disk space is available in the destination directory or remote storage.
 - Access to SCP/FTP/SFTP tools if you plan to store the backup on a remote server.


Identify the Guest VNF Image File 

To locate the virtual disk file associated with the Guest VNF, run the following command:

show guest-vnfs virtual-machines

In the command output, check the 'disk path' field to find the exact file name and location.

 admin@UCPE-2-cli> show guest-vnfs virtual-machines

NAME         STATE    UPTIME    

-------------------------------

Ubuntu-1804  running   1w0d05h  

 

Virtual Machine            Ubuntu-1804

   State                   running

   Uptime                  1w0d05h

   Creation Timestamp      2025-09-30 13:55:35.968015

   Management IP           172.16.125.2

   Management MAC          52:54:00:00:01:01

   Number of CPUs          2

   Memory                  2048

   VNC Port                5901

   Management Interface    vni-0/300.0

   Auxiliary   Interface    n/a

   Left Interface          vni-0/302.0

   Right Interface         vni-0/303.0

   Primary-volume

      Disk Path            /var/lib/libvirt/images/ca8bc1e6-9e3e-11f0-bb23-ac433001a63e

      Disk format          qcow2

   Secondary Volume

      Disk Path            n/a

      Disk format          n/a

 

Backup Procedure


1. Stop the Guest VNF (recommended for consistent backup):
request guest-vnf <vnf-name> stop


2. Copy the VNF image file to a backup directory or remote location.
 This file contains only the configuration present in the Guest VNF at the time of backup.


    #sudo scp /var/lib/libvirt/images/<VNF-image-file> user@<remote-server>:/backup/


Example:
scp /var/lib/libvirt/images/ca8bc1e6-9e3e-11f0-bb23-ac433001a63e user@10.10.10.5:/data/backup/


3.Once the copy is completed, start the Guest VNF again:
request guest-vnf <vnf-name> start


Note:


- Always stop the Guest VNF before taking a backup to avoid data corruption.
- The file name will differ for each VNF and system.
 - Ensure sufficient storage space on the backup location.

 

Restore Procedure


To restore the Guest VNF from a backup file, follow the steps below:

1. Copy the backed-up image file back to the Versa device:
scp user@<remote-server>:/backup/<VNF-image-file> /var/lib/libvirt/images/

2. You can either use a new file name and update the Guest VNF disk path accordingly, or use the same existing name and replace the source reference in the XML configuration file.

3. Update the XML configuration file corresponding to the Guest VNF:
    The XML file name will match the VM name.


Edit the file using the command below:
    sudo vi /etc/libvirt/qemu/<VM-name>.xml

Example:

[admin@UCPE-2: ~] $ sudo virsh list --all
Id Name State
----------------------------------------------------
5 Ubuntu-1804. running

sudo vi /etc/libvirt/qemu/Ubuntu-1804.xml

4. Locate the following section inside the XML file and update the <source file> path with the restored image filename:


<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/ca8bc1e6-9e3e-11f0-bb23-ac433001a63e'/>
<target dev='vda' bus='virtio'/>
</disk>

    Replace the path under <source file> with your restored image file path. Save and exit the editor.

5. sudo virsh define <xml file>

6. Start the Guest VNF:
virsh start <VM-name>

7. Verify the VNF status:
    show guest-vnfs virtual-machines

 

Verification

 

After restoring and starting the Guest VNF, verify its status using the following command:
sudo virsh list --all

Example Output:
[admin@UCPE-2: ~] $ sudo virsh list --all
Id Name State
----------------------------------------------------
5           Ubuntu-1804          running

 The 'running' state confirms that the Guest VNF has been successfully restored and is operational.

admin@UCPE-2-cli> show guest-vnfs virtual-machines

NAME         STATE    UPTIME    

-------------------------------

Ubuntu-1804  running   1w0d05h  

 

Virtual Machine            Ubuntu-1804

   State                   running

   Uptime                  1w0d05h

   Creation Timestamp      2025-09-30 13:55:35.968015

   Management IP           172.16.125.2

   Management MAC          52:54:00:00:01:01

   Number of CPUs          2

   Memory                  2048

   VNC Port                5901

   Management Interface    vni-0/300.0

   Auxiliary   Interface    n/a

   Left Interface          vni-0/302.0

   Right Interface         vni-0/303.0

   Primary-volume

      Disk Path             /var/lib/libvirt/images/ca8bc1e6-9e3e-11f0-bb23-ac433001a63e

      Disk format          qcow2

   Secondary Volume

      Disk Path            n/a

      Disk format          n/a