L.1.1 Resizing Instances if Setup is in KVM Environment

Note:

Perform this procedure on the Host where VM is deployed.
  1. Shutdown VM by running the following command:
    virsh shutdown <VM Name>

    Wait for the VM to shut down.

  2. Run the following commands:
    virsh dumpxml <VM Name> | grep 'disk type' -A 5
    Output:
    [root@ol-server ~]# virsh dumpxml Dsrtestsetup-Noam1 | grep 'disk type' -A 5
    <disk type='file' device='disk'>
    <driver name='qemu' type='qcow2'/>
    <source file='/mnt/data/ova/Dsrtestsetup-Noam1.qcow2'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </disk>
    qemu-img info {{ path with image name }}.qcow2
    Output:
    [root@ol-server ~]# qemu-img info /mnt/data/ova/Dsrtestsetup-Noam1.qcow2
    image: /mnt/data/ova/Dsrtestsetup-Noam1.qcow2
    file format: qcow2
    virtual size: 120 GiB (128849018880 bytes)
    disk size: 7.56 GiB
    cluster_size: 65536
    Format specific information:
        compat: 1.1
        compression type: zlib
        lazy refcounts: false
        refcount bits: 16
        corrupt: false
    qemu-img resize {{ path with image name }}.qcow2 +<additional required size>G
    Output:
    [root@ol-server ~]# qemu-img resize /mnt/data/ova/Dsrtestsetup-Noam1.qcow2 +40G
    Image resized.
  3. Verify VM sixe, by running the following command:
    qemu-img info {{ path with image name }}.qcow2  (To verify VM size)
    Output:
    [root@ol-server ~]# qemu-img info /mnt/data/ova/Dsrtestsetup-Noam1.qcow2
    image: /mnt/data/ova/Dsrtestsetup-Noam1.qcow2
    file format: qcow2virtual size: 160 GiB (171798691840 bytes)
    disk size: 7.56 GiB
    cluster_size: 65536
    Format specific information:
        compat: 1.1
        compression type: zlib
        lazy refcounts: false
        refcount bits: 16
        corrupt: false
        extended l2: false
  4. Start VM by running the following command:
    virsh start <VM Name>