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.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. 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/663f8464ee7ab2cb086857f04393e643407fba0f/lib/ansible/modules/cloud/ovirt. 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/QSFF7CEVQAVCHDCDRZ6NUYUGLVMVWL7A/
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/SOKGFIMYLY2CCB3V3Q74XZGEZBRWMTKW/


--

Jan Zmeskal

Quality Engineer, RHV Core System

Red Hat