parent
5a170295ef
commit
8c2d409467
1 changed files with 3 additions and 5 deletions
|
@ -725,14 +725,12 @@ def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest,
|
||||||
msg="Error on %s definition. datastore needs to be"
|
msg="Error on %s definition. datastore needs to be"
|
||||||
" specified." % disk)
|
" specified." % disk)
|
||||||
try:
|
try:
|
||||||
disksize = vm_disk[disk]['size_gb']
|
disksize = int(vm_disk[disk]['size_gb'])
|
||||||
# Convert the disk size to kiloboytes
|
# Convert the disk size to kiloboytes
|
||||||
disksize = disksize * 1024 * 1024
|
disksize = disksize * 1024 * 1024
|
||||||
except KeyError:
|
except (KeyError, ValueError):
|
||||||
vsphere_client.disconnect()
|
vsphere_client.disconnect()
|
||||||
module.fail_json(
|
module.fail_json(msg="Error on %s definition. size needs to be specified as an integer." % disk)
|
||||||
msg="Error on %s definition. size needs to be"
|
|
||||||
" specified." % disk)
|
|
||||||
try:
|
try:
|
||||||
disktype = vm_disk[disk]['type']
|
disktype = vm_disk[disk]['type']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Loading…
Reference in a new issue