Description

Is there a way to check to ensure QCOW2 or ISO file is not corrupted, as a result of a power failure?

Symptoms

Had a power failure at the site, and want to ensure the QCOW2 or ISO files for the Virtual-Network-Functions (VNF) is proper, and in good integrity.

Solution

  1. To check the file integrity of QCOW2 files for your VNF, you will need to go into hypervisor.

  2. Once in hypervisor, use the following command to check for file integrity:

    qemu-img info <path to qcow2 file>
    qemu-img check <path to qcow2 file>

  3. If there are no errors after running these commands, the file integrity is intact.


Example:

jdm:/var/third-party# ssh hypervisor
Last login: Mon May  6 17:34:51 2019 from jdm

root@localhost:~# qemu-img info /var/third-party/media-vsrx-vmdisk-15.1X49-D100.6.qcow2
image: /var/third-party/media-vsrx-vmdisk-15.1X49-D100.6.qcow2
file format: qcow2
virtual size: 16G (17179869184 bytes)
disk size: 3.3G
cluster_size: 65536
Format specific information:
    compat: 0.10
    refcount bits: 16
root@localhost:~#
root@localhost:~# qemu-img check /var/third-party/media-vsrx-vmdisk-15.1X49-D100.6.qcow2
No errors were found on the image.
53726/262144 = 20.49% allocated, 0.53% fragmented, 0.00% compressed clusters
Image end offset: 3522953216
root@localhost:~#