diff --git a/lib/ansible/modules/extras/cloud/ovirt/ovirt_disks.py b/lib/ansible/modules/extras/cloud/ovirt/ovirt_disks.py index a8f84c26e8..092fb051cf 100644 --- a/lib/ansible/modules/extras/cloud/ovirt/ovirt_disks.py +++ b/lib/ansible/modules/extras/cloud/ovirt/ovirt_disks.py @@ -65,7 +65,10 @@ options: default: 'virtio' format: description: - - "Format of the disk. Either copy-on-write or raw." + - Specify format of the disk. + - If (cow) format is used, disk will by created as sparse, so space will be allocated for the volume as needed, also known as I(thin provision). + - If (raw) format is used, disk storage will be allocated right away, also known as I(preallocated). + - Note that this option isn't idempotent as it's not currently possible to change format of the disk via API. choices: ['raw', 'cow'] storage_domain: description: @@ -168,6 +171,7 @@ class DisksModule(BaseModule): format=otypes.DiskFormat( self._module.params.get('format') ) if self._module.params.get('format') else None, + sparse=False if self._module.params.get('format') == 'raw' else True, provisioned_size=convert_to_bytes( self._module.params.get('size') ), @@ -198,7 +202,6 @@ class DisksModule(BaseModule): return ( equal(self._module.params.get('description'), entity.description) and equal(convert_to_bytes(self._module.params.get('size')), entity.provisioned_size) and - equal(self._module.params.get('format'), str(entity.format)) and equal(self._module.params.get('shareable'), entity.shareable) ) @@ -234,7 +237,6 @@ def main(): vm_id=dict(default=None), size=dict(default=None), interface=dict(default=None,), - allocation_policy=dict(default=None), storage_domain=dict(default=None), profile=dict(default=None), format=dict(default=None, choices=['raw', 'cow']),