Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt_disk: invalid Actual Size after uploading sparse qcow2 image to datastore #81

Open
Akasurde opened this issue Aug 12, 2020 · 2 comments

Comments

@Akasurde
Copy link

From @pacsikaz on Mar 02, 2020 16:20

SUMMARY

Using ovirt_disk ansible module to upload a sparse qcow2 image results in invalid actual size on a storage domain, backed by an iSCSI storage.
On source the qcow2 file size is less than 1G, but after uploading the actual size will be more than the virtual size given in the playbook. See details in attached logs.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ovirt_disk

ANSIBLE VERSION
[root@FFM-MAINT ansible]# ansible --version
ansible 2.9.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jun 11 2019, 14:33:56) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
[root@FFM-MAINT ansible]#

CONFIGURATION
[root@FFM-MAINT ansible]# ansible-config dump --only-changed
[root@FFM-MAINT ansible]#

OS / ENVIRONMENT

RHEV version: 4.3.7.2-0.1.el7
Storage domain is backed by an iSCSI (HP MSA) storage device

rhevm_rpm_versions.log

STEPS TO REPRODUCE
  1. Create a sparse QCOW2 image, eg with;
    qemu-img create -f qcow2 /root/testimage.qcow2 1G

  2. check details of the created image with qemu-img info
    qemu-img info /root/testimage.qcow2
    image: /root/testimage.qcow2
    file format: qcow2
    virtual size: 1.0G (1073741824 bytes)
    disk size: 196K
    cluster_size: 65536
    Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

  3. use the below playbook to upload the image to Ovirt Engine (RHEV-M), specify the target storage domain, virtual size and source img file as mandatory parameters.

ansible-playbook -vvv --ask-vault-pass image_upload.yml --extra-vars "image_name=testvmdisk image_size=10GiB storage_domain_name=BACKUP image_full_path=/root/testimage.qcow2"

  1. Check the uploaded image Actual Size from Engine GUI - Storage - Domains - select target storage domain - Disks

EXAMPLE PLAYBOOK

"

  • hosts: localhost
    connection: smart

    vars_files:

    • vars/vars.yml
    • vault/vault_rhevm.yml

    vars:
    timestamp: "{{ansible_date_time.iso8601_basic_short}}"

    tasks:

    • name: Obtains SSO token
      ovirt_auth:
      url: "{{ url }}"
      username: "{{ username }}"
      password: "{{ password }}"
      insecure: "{{ insecure }}"
      tags:

      • auth
    • name: Upload backup vm disk
      ovirt_disk:
      auth: "{{ ovirt_auth }}"
      name: "{{ disk_image_name_var }}"
      format: cow
      bootable: yes
      storage_domain: "{{ storage_domain_name_var }}"
      size: "{{image_size_var }}"
      sparse: yes
      sparsify: yes
      timeout: 3600
      image_path: "{{ image_path_var }}"
      tags: upload_vm_disk
      "

EXPECTED RESULTS

When checking on RHEV-M GUI, Virtual Size shall be equal to the setting in playbook, while Actual size shall be aligned with actual size of the image (as also visible in qemu-img info / disk size)

ACTUAL RESULTS

Actual Size is invalid, become bigger than Virtual Size. Nor Sparse neither Sparsify module parameter makes any difference in the end result.

Note that uploading the very same image with upload_disk.py results in correct Actual Size on Storage Domain.

ansible_image_upload_logs.log

Result in RHEV-M GUI:

image




Copied from original issue: ansible/ansible#67933

@Akasurde
Copy link
Author

From @mnecas on Mar 24, 2020 15:05

@tnisan could you please check this issue, looks like storage issue.

@luciflus
Copy link

Hello, Team.

Did you fix your problem with ansible/ansible#67933 ? I have the same problem, and i can't find solution.

Maybe you have solution. Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants