ovirt_disk Ansible module creating disks of wrong size but why?

Hello everyone, I just saw the list of modules at https://github.com/ansible/ansible/tree/663f8464ee7ab2cb086857f04393e643407f.... Does this mean you (oVirt devs) did not update ovirt Ansible modules since 2 years? Anyhow, the following tasks create a VM with a 8GB instead of 500GB disk (confirmed with lsblk and fdisk). Why is that and how do I get around it? - name: download centos image get_url: url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 dest: /data/isos/CentOS-7-x86_64-GenericCloud.qcow2 - name: create disk for vm ovirt_disk: name: centos upload_image_path: /data/isos/CentOS-7-x86_64-GenericCloud.qcow2 storage_domain: vmdata2 size: 500GiB wait: true bootable: true format: cow when: register_centos_disks.ovirt_disks|length == 0 - name: create vm ovirt_vm: name: dumbo type: server state: "running" cluster: dumbo high_availability: yes disks: - name: centos graphical_console: protocol: vnc operating_system: Linux nics: - name: nic1 profile_name: ovirtmgmt memory: 8GiB cpu_sockets: 1 cpu_cores: 1 cpu_threads: 2 If I use sparse: false with the ovirt_disk module I am getting following errors. An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Error: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. Disk configuration (COW Preallocated) is incompatible with the storage domain type.]". HTTP response code is 409. fatal: [dumbo]: FAILED! => changed=false msg: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. Disk configuration (COW Preallocated) is incompatible with the storage domain type.]". HTTP response code is 409. The storage domain type is data. So what is wrong with that? Frustrated regards Skrzetuski

Hi, On 1/13/20 12:14 AM, m.skrzetuski@gmail.com wrote:
Hello everyone,
I just saw the list of modules at https://github.com/ansible/ansible/tree/663f8464ee7ab2cb086857f04393e643407f.... Does this mean you (oVirt devs) did not update ovirt Ansible modules since 2 years?
Anyhow, the following tasks create a VM with a 8GB instead of 500GB disk (confirmed with lsblk and fdisk). Why is that and how do I get around it?
The original image is 8G so I think creating disk with uploaded image can't resize it in one step. When I try to upload it in UI it doesn't allow me to change the size, it just loads the original size of the image. It could be mentioned in the documentation how it works with size and upload_image_path together.
- name: download centos image get_url: url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 dest: /data/isos/CentOS-7-x86_64-GenericCloud.qcow2
- name: create disk for vm ovirt_disk: name: centos upload_image_path: /data/isos/CentOS-7-x86_64-GenericCloud.qcow2 storage_domain: vmdata2 size: 500GiB wait: true bootable: true format: cow when: register_centos_disks.ovirt_disks|length == 0
- name: create vm ovirt_vm: name: dumbo type: server state: "running" cluster: dumbo high_availability: yes disks: - name: centos graphical_console: protocol: vnc operating_system: Linux nics: - name: nic1 profile_name: ovirtmgmt memory: 8GiB cpu_sockets: 1 cpu_cores: 1 cpu_threads: 2
If I use sparse: false with the ovirt_disk module I am getting following errors.
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Error: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. Disk configuration (COW Preallocated) is incompatible with the storage domain type.]". HTTP response code is 409. fatal: [dumbo]: FAILED! => changed=false msg: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. Disk configuration (COW Preallocated) is incompatible with the storage domain type.]". HTTP response code is 409.
The storage domain type is data. So what is wrong with that?
Frustrated regards Skrzetuski _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/QSFF7CEVQAVCHD...
Best regards, -- Lucie Leistnerova Senior Quality Engineer, QE Cloud, RHVM Red Hat EMEA IRC: lleistne @ #rhev-qe

Hi, I can confirm that what Lucie writes is true for the UI. However, I was able to upload 30 GB disk (virtual size) using ansible. I mean at least oVirt sees it as 30GiB, see here: [image: image.png] I used the following playbook: --- - hosts: localhost gather_facts: false vars: disk_name: centos7 tasks: - name: Obtain SSO token ovirt_auth: url: https://<engine_fqdn>/ovirt-engine/api username: admin@internal password: <pass> - name: Create a bootable disk for vm ovirt_disk: auth: "{{ ovirt_auth }}" name: "{{ disk_name }}" upload_image_path: /tmp/CentOS-7-x86_64-GenericCloud.qcow2 storage_domain: hosted_storage size: 30GiB wait: true bootable: true format: cow - name: Create a VM with QCOW2 disk ovirt_vm: auth: "{{ ovirt_auth }}" state: present cluster: Default name: jzmeskal_centos7 disks: - name: "{{ disk_name }}" bootable: True It needs to be mentioned that I used Ansible 2.9.1 to achieve it. I don't know what version you're using, but it might be old. At least the GH link with oVirt Ansible modules you shared is somewhat dated. I'm not an oVirt dev, but it's definitely not the case that the modules haven't been updated for the past two years. You've just checked out some older commit. See for example here: stable-2.9 branch <https://github.com/ansible/ansible/tree/stable-2.9/lib/ansible/modules/cloud/ovirt>. As of writing this email, the most recent change there is 2 days old. Hope this helps! Jan On Mon, Jan 13, 2020 at 8:56 AM Lucie Leistnerova <lleistne@redhat.com> wrote:
Hi,
On 1/13/20 12:14 AM, m.skrzetuski@gmail.com wrote:
Hello everyone,
I just saw the list of modules at https://github.com/ansible/ansible/tree/663f8464ee7ab2cb086857f04393e643407f.... Does this mean you (oVirt devs) did not update ovirt Ansible modules since 2 years?
Anyhow, the following tasks create a VM with a 8GB instead of 500GB disk (confirmed with lsblk and fdisk). Why is that and how do I get around it?
The original image is 8G so I think creating disk with uploaded image can't resize it in one step. When I try to upload it in UI it doesn't allow me to change the size, it just loads the original size of the image.
It could be mentioned in the documentation how it works with size and upload_image_path together.
- name: download centos image get_url: url:
https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
dest: /data/isos/CentOS-7-x86_64-GenericCloud.qcow2
- name: create disk for vm ovirt_disk: name: centos upload_image_path:
/data/isos/CentOS-7-x86_64-GenericCloud.qcow2
storage_domain: vmdata2 size: 500GiB wait: true bootable: true format: cow when: register_centos_disks.ovirt_disks|length == 0
- name: create vm ovirt_vm: name: dumbo type: server state: "running" cluster: dumbo high_availability: yes disks: - name: centos graphical_console: protocol: vnc operating_system: Linux nics: - name: nic1 profile_name: ovirtmgmt memory: 8GiB cpu_sockets: 1 cpu_cores: 1 cpu_threads: 2
If I use sparse: false with the ovirt_disk module I am getting following
errors.
An exception occurred during task execution. To see the full traceback,
fatal: [dumbo]: FAILED! => changed=false msg: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. Disk configuration (COW Preallocated) is incompatible with
use -vvv. The error was: Error: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. Disk configuration (COW Preallocated) is incompatible with the storage domain type.]". HTTP response code is 409. the storage domain type.]". HTTP response code is 409.
The storage domain type is data. So what is wrong with that?
Frustrated regards Skrzetuski _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/QSFF7CEVQAVCHD... Best regards,
-- Lucie Leistnerova Senior Quality Engineer, QE Cloud, RHVM Red Hat EMEA
IRC: lleistne @ #rhev-qe _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/SOKGFIMYLY2CCB...
-- Jan Zmeskal Quality Engineer, RHV Core System Red Hat <https://www.redhat.com> <https://www.redhat.com>

Hallo Jan, maybe I worded my findings not clearly enough, sorry. oVirt is showing that the disk I create is 500GiB (like in your test) but inside the CentOS VM I have only a 8GiB disk, which I can see with lsblk and fdisk. Any workarounds for that? Is CentOS doing something wrong here? I am using Ansible 2.9. Kind regards Skrzetuski

Maybe it's just what Lucie mentioned - that we cannot really resize the original disk size of CentOS image. I think workaround for that would be using the original QCOW image as boot disk for OS and then creating a new disk for data of whatever size you want it to be. On Mon, Jan 13, 2020 at 10:18 AM <m.skrzetuski@gmail.com> wrote:
Hallo Jan,
maybe I worded my findings not clearly enough, sorry. oVirt is showing that the disk I create is 500GiB (like in your test) but inside the CentOS VM I have only a 8GiB disk, which I can see with lsblk and fdisk.
Any workarounds for that? Is CentOS doing something wrong here?
I am using Ansible 2.9.
Kind regards Skrzetuski _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/RD2CQSITNXWLPS...
-- Jan Zmeskal Quality Engineer, RHV Core System Red Hat <https://www.redhat.com> <https://www.redhat.com>

It looks to me like a bug. It shouldn't resize the uploaded disk (as it is in UI) or it should be mentioned in the documentation. Can you please create a BZ for it with logs and ansible verbose output attached. Thank you! On 1/13/20 10:16 AM, m.skrzetuski@gmail.com wrote:
Hallo Jan,
maybe I worded my findings not clearly enough, sorry. oVirt is showing that the disk I create is 500GiB (like in your test) but inside the CentOS VM I have only a 8GiB disk, which I can see with lsblk and fdisk.
Any workarounds for that? Is CentOS doing something wrong here?
I am using Ansible 2.9.
Kind regards Skrzetuski _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/RD2CQSITNXWLPS...
-- Lucie Leistnerova Senior Quality Engineer, QE Cloud, RHVM Red Hat EMEA IRC: lleistne @ #rhev-qe

Hello m.skrzetuski (unfortunately I don't know your first name), have you reported the bug? If yes, can you please share it with me? If no, I'll try to find some time to reproduce and report it. Jan On Wed, Jan 15, 2020 at 7:58 AM Lucie Leistnerova <lleistne@redhat.com> wrote:
It looks to me like a bug. It shouldn't resize the uploaded disk (as it is in UI) or it should be mentioned in the documentation.
Can you please create a BZ for it with logs and ansible verbose output attached.
Thank you!
Hallo Jan,
maybe I worded my findings not clearly enough, sorry. oVirt is showing
On 1/13/20 10:16 AM, m.skrzetuski@gmail.com wrote: that the disk I create is 500GiB (like in your test) but inside the CentOS VM I have only a 8GiB disk, which I can see with lsblk and fdisk.
Any workarounds for that? Is CentOS doing something wrong here?
I am using Ansible 2.9.
Kind regards Skrzetuski _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/RD2CQSITNXWLPS...
-- Lucie Leistnerova Senior Quality Engineer, QE Cloud, RHVM Red Hat EMEA
IRC: lleistne @ #rhev-qe _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/ACHR56D4SIZJ6P...
-- Jan Zmeskal Quality Engineer, RHV Core System Red Hat <https://www.redhat.com> <https://www.redhat.com>

On Mon, Jan 13, 2020 at 11:18 AM <m.skrzetuski@gmail.com> wrote:
Hallo Jan,
maybe I worded my findings not clearly enough, sorry. oVirt is showing that the disk I create is 500GiB (like in your test) but inside the CentOS VM I have only a 8GiB disk, which I can see with lsblk and fdisk.
Can you share the output of this command on the image being uploaded? qemu-img info /path/to/omage oVirt SDK lets you create disk of any size when you upload an image. You must create disk large enough to be able to upload the image, but oVirt cannot prevent you from creating a bigger disk, and it can make sense for some cases. The virtual size of the disk is called provisioned_size in the SDK. This must be the same size as reported by qemu-img info "virtual size". It you specify smaller value the upload will fail at the end, when oVirt verify that uploaded image. Specifying more is allowed (for backward compatibility) but is not recommended. When uploading qcow2 images to block storage (e.g iSCSI/FC) you must specify the initial_size. You can find this value using: qemu-img measure -f qcow2 -O qcow2 /path/to/image.qcow2 You must use the value returned as "required size". The best tool to upload images is upload_disk.py from ovirt sdk examples: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_di... With oVirt 4.4 you can upload any image format to any disk format, and the tool detect the image format and calculate the correct size without errors. Here are some examples (eliminating the engine details). Upload raw image to qcow2 disk: $ python3 upload_disk.py ... --disk-format qcow2 --disk-sparse fedora-30.raw Checking image... Image format: raw Disk format: cow Disk content type: data Disk provisioned size: 6442450944 Disk initial size: 1236336640 Disk name: fedora-30.qcow2 Connecting... Creating disk... Creating transfer session... Uploading image... [ 100.00% ] 6.00 GiB, 4.27 seconds, 1.40 GiB/s Finalizing transfer session... Upload completed successfully Upload qcow2 disk to raw disk: $ python3 upload_disk.py ... --disk-format raw --disk-sparse disk.qcow2 Checking image... Image format: qcow2 Disk format: raw Disk content type: data Disk provisioned size: 6442450944 Disk initial size: 6442450944 Disk name: disk.raw Connecting... Creating disk... Creating transfer session... Uploading image... [ 100.00% ] 6.00 GiB, 4.51 seconds, 1.33 GiB/s Finalizing transfer session... Upload completed successfully Run upload_disk.py --help to learn about the available options. I guess the ansible module should be updated to upload the disk properly based on the sdk example. Nir
participants (4)
-
Jan Zmeskal
-
Lucie Leistnerova
-
m.skrzetuski@gmail.com
-
Nir Soffer