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
Comments
Files identified in the description: If these files are inaccurate, please update the |
@tnisan could you please check this issue, looks like storage issue. |
Files identified in the description: If these files are inaccurate, please update the |
Files identified in the description: If these files are incorrect, please update the |
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:
|
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
COMPONENT NAME
ovirt_disk
ANSIBLE VERSION
CONFIGURATION
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
Create a sparse QCOW2 image, eg with;
qemu-img create -f qcow2 /root/testimage.qcow2 1G
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
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"
EXAMPLE PLAYBOOK
"
hosts: localhost
connection: smart
vars_files:
vars:
timestamp: "{{ansible_date_time.iso8601_basic_short}}"
tasks:
name: Obtains SSO token
ovirt_auth:
url: "{{ url }}"
username: "{{ username }}"
password: "{{ password }}"
insecure: "{{ insecure }}"
tags:
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:
The text was updated successfully, but these errors were encountered: