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 #67933

Closed
pacsikaz opened this issue Mar 2, 2020 · 6 comments
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. cloud collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md ovirt oVirt and RHV community support:community This issue/PR relates to code supported by the Ansible community.

Comments

@pacsikaz
Copy link

pacsikaz commented Mar 2, 2020

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




@ansibot
Copy link
Contributor

ansibot commented Mar 2, 2020

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Mar 2, 2020

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. ovirt oVirt and RHV community support:community This issue/PR relates to code supported by the Ansible community. labels Mar 2, 2020
@mnecas
Copy link
Contributor

mnecas commented Mar 24, 2020

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

@ansibot
Copy link
Contributor

ansibot commented Mar 24, 2020

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. labels Mar 24, 2020
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Mar 26, 2020
@ansibot
Copy link
Contributor

ansibot commented Mar 26, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 26, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:mnecas.ovirt needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 24, 2020
@ansibot ansibot removed collection:ovirt.ovirt needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Jun 13, 2020
@ansibot ansibot added the needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md label Jun 29, 2020
@Akasurde
Copy link
Member

Thank you very much for your interest in Ansible. This plugin/module is no longer maintained in this repository and has been migrated to https://github.com/oVirt/ovirt-ansible-collection

Migrated this issue in the above repository - oVirt/ovirt-ansible-collection#81.

If you have further questions please stop by IRC or the mailing list:

@ansible ansible locked and limited conversation to collaborators Sep 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. cloud collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md ovirt oVirt and RHV community support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

5 participants