ovirt-ansible-collection
ovirt-ansible-collection copied to clipboard
Add support for converting disks
SUMMARY
The module ovirt_disk
should be extended to support the conversion of disk from raw to qcow2 or vice-versa. This is possible in the latest oVirt version according to the API docs.
COMPONENT NAME
ovirt_disk
ADDITIONAL INFORMATION
The parameter format
is already present but is only used when uploading files AFAIK. If this parameter is provided the module should check the format of the disk and if it's not in the desired format convert it by issuing a call to convert
.
- name: List disks
ovirt_disk_info:
pattern: vm_names=vm01
register: disks
- set_fact:
disks: "{{ disks.ovirt_disks | map(attribute='id') }}" # extract disk ids
- name: Configure Disks
ovirt_disk:
id: "{{ item }}"
format: cow
loop: "{{ disks }}"
collections:
- ovirt.ovirt