From e7d784e5cc8c1587762c4aee63b4276c98c95602 Mon Sep 17 00:00:00 2001 From: Nijin Ashok Date: Tue, 19 Feb 2019 18:52:04 +0530 Subject: [PATCH] ovirt_disk: Don't pass "initial_size" while adding the disk (#52559) Currently we are passing "initial_size" while creating the disk for block based storage domains. Since this is equal to the size of the disk, all the thin provisioned disk which is created using this module will be having the size equal to the virtual size of the disk. The "initial_size" is only required while uploading the image. The patch take care of the same. --- lib/ansible/modules/cloud/ovirt/ovirt_disk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_disk.py b/lib/ansible/modules/cloud/ovirt/ovirt_disk.py index 99b582c0f82..8e88c483254 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_disk.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_disk.py @@ -504,7 +504,7 @@ class DisksModule(BaseModule): ], ) if logical_unit else None, ) - if hasattr(disk, 'initial_size'): + if hasattr(disk, 'initial_size') and self._module.params['upload_image_path']: disk.initial_size = convert_to_bytes( self._module.params.get('size') )