@ -65,7 +65,10 @@ options:
default : ' virtio '
default : ' virtio '
format :
format :
description :
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 ' ]
choices : [ ' raw ' , ' cow ' ]
storage_domain :
storage_domain :
description :
description :
@ -168,6 +171,7 @@ class DisksModule(BaseModule):
format = otypes . DiskFormat (
format = otypes . DiskFormat (
self . _module . params . get ( ' format ' )
self . _module . params . get ( ' format ' )
) if self . _module . params . get ( ' format ' ) else None ,
) if self . _module . params . get ( ' format ' ) else None ,
sparse = False if self . _module . params . get ( ' format ' ) == ' raw ' else True ,
provisioned_size = convert_to_bytes (
provisioned_size = convert_to_bytes (
self . _module . params . get ( ' size ' )
self . _module . params . get ( ' size ' )
) ,
) ,
@ -198,7 +202,6 @@ class DisksModule(BaseModule):
return (
return (
equal ( self . _module . params . get ( ' description ' ) , entity . description ) and
equal ( self . _module . params . get ( ' description ' ) , entity . description ) and
equal ( convert_to_bytes ( self . _module . params . get ( ' size ' ) ) , entity . provisioned_size ) 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 )
equal ( self . _module . params . get ( ' shareable ' ) , entity . shareable )
)
)
@ -234,7 +237,6 @@ def main():
vm_id = dict ( default = None ) ,
vm_id = dict ( default = None ) ,
size = dict ( default = None ) ,
size = dict ( default = None ) ,
interface = dict ( default = None , ) ,
interface = dict ( default = None , ) ,
allocation_policy = dict ( default = None ) ,
storage_domain = dict ( default = None ) ,
storage_domain = dict ( default = None ) ,
profile = dict ( default = None ) ,
profile = dict ( default = None ) ,
format = dict ( default = None , choices = [ ' raw ' , ' cow ' ] ) ,
format = dict ( default = None , choices = [ ' raw ' , ' cow ' ] ) ,