Dear oVirt,

 

I am downloading the ubuntu cloud image 16.04 and or 18.04:

 

   - name: "Download base cloud image from server"

     get_url:

       url: "{{ image_url }}"

       checksum: "sha256:{{ image_checksum }}"

       validate_certs: yes

       dest: "/tmp/{{ inventory_hostname_short }}.qcow2"

     delegate_to: localhost

 

creating a 40GB HDD and attaching image to it:

 

    - name: "Create oVirt disk with base image (with 40Gb allocated)"

      ovirt_disk:

        name: "{{ inventory_hostname_short }}"

        interface: virtio

        size: 40GiB

        format: cow

        upload_image_path: "/tmp/{{ inventory_hostname_short }}.qcow2"

        storage_domain: ovirt_production

        wait: true

      delegate_to: localhost

 

creating VM afterwards:

 

 

    - name: "Create new Ubuntu VMs from cloud image"

      delegate_to: localhost

      ovirt_vm:

        auth: "{{ ovirt_auth }}"

        name: "{{ inventory_hostname_short }}"

        disks:

        - name: "{{ inventory_hostname_short }}"

        graphical_console:

            protocol: vnc

        serial_console: true

        usb_support: true

        soundcard_enabled: false

        operating_system: "{{ operating_system_type }}"

        type: server

        nics:

        - name: nic1

          profile_name: tenant1

          interface: virtio

          nic_on_boot: true

        cloud_init:

          host_name: "{{ inventory_hostname }}"

          user_name: ubuntu

          authorized_ssh_keys: "{{ ssh_agent_pubkeys.stdout }}"

        state: "running"

        cluster: "{{ ovirt_cluster }}"

      when: inventory_hostname in groups['ubuntu-baker']

 

When VM gets created, I can see in oVIrt VM details disk created is 40GB.

Executing df -h, gives me following:

 

  root@av3-ubuntu-18-base:/home/ubuntu# df -h

Filesystem      Size  Used Avail Use% Mounted on

udev            447M     0  447M   0% /dev

tmpfs            92M  696K   92M   1% /run

/dev/vda1       2.0G  1.3G  706M  65% /

tmpfs           460M     0  460M   0% /dev/shm

tmpfs           5.0M     0  5.0M   0% /run/lock

tmpfs           460M     0  460M   0% /sys/fs/cgroup

/dev/vda15      105M  3.6M  101M   4% /boot/efi

tmpfs            92M     0   92M   0% /run/user/1000

 

Initially I thought growpart or resize2fs is not triggered, but then running dmesg or fdisk /dev/vda, told me that physical disk size is still only size of the downloaded ubuntu cloud image.

 

Disk /dev/vda: 2.2 GiB, 2361393152 bytes, 4612096 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

 

Is this related to ovirt_disk module, or ubuntu and ovirt_disk, since I do not have this behavior with CentOS 7 images?

 

Can you advise how to proceed, in case I am missing some configuration parameter or command to be run?

 

The following Ubuntu images are used:

 

ubuntu-16: image_url=https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img image_checksum=fda868058586b129c7fdb6472fe575e911f7c67551a6dc75966f2ec02201bdae

ubuntu-18: image_url=https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img image_checksum=7d2b90022a169119d7726c0fefa1713acbead7cc36d282c879896fd89c5a6663

 

 

Kindly awaiting your reply.

 

 

— — —
Met vriendelijke groet / Kind regards,

Marko Vrgotic

Sr.  System Engineer @ System Administration
m.vrgotic@activevideo.com
tel. +31 (0)35 677 4131