Trying to build a few VMs for my lab using vsphere automation CLI. A very basic configurations work just fine using default disk and no cdrom:
pzi@pzi-c7-1:~$ dcli +loglevel debug com vmware vcenter vm create --name pzi-ph-42 \
> --guest-os VMWARE_PHOTON_64 \
> --placement-resource-pool resgroup-8 \
> --placement-folder group-v3 \
> --placement-datastore datastore-89
vm-114
As soon as try to add disk sizing with '--disks-new-vmdk-capacity 6000000' or cdrom with '--cdroms-type SATA' i get a very informative error message 'Error: Invalid input type':
pzi@pzi-c7-1:~$ dcli +loglevel debug com vmware vcenter vm create --name pzi-ph-43 \
> --guest-os VMWARE_PHOTON_64 \
> --placement-resource-pool resgroup-8 \
> --placement-folder group-v3 \
> --placement-datastore datastore-89 \
> --disks-new-vmdk-capacity 6000000
usage: dcli [+server SERVER] [+interactive] [+prompt PROMPT]
[+skip-server-verification | +cacert-file CACERT_FILE]
[+credstore-add | +credstore-file CREDSTORE_FILE | +credstore-list | +credstore-remove]
[+formatter {simple,table,xml,json,html,csv}]
[+loglevel {debug,info,warning,error}] [+more]
[+session-manager SESSION_MANAGER] [+username USERNAME]
[args [args ...]]
Error: Invalid input type
For usage type: dcli --help
The dcli log file has also very informative error as well:
2017-06-26 22:35:39,227 INFO | __main__ | Using username/password authentication scheme |
2017-06-26 22:35:39,227 INFO | __main__ | Using username/password authentication scheme |
2017-06-26 22:35:39,227 INFO | __main__ | Trying to read credstore for login credentials |
2017-06-26 22:35:39,227 INFO | __main__ | Trying to read credstore for login credentials |
2017-06-26 22:35:39,228 INFO | root | Doing session login to session manager |
2017-06-26 22:35:39,228 INFO | root | Doing session login to session manager |
2017-06-26 22:35:39,228 DEBUG | vmware.vapi.protocol.client.msg.json_connector _do_request: request invoke |
2017-06-26 22:35:39,230 DEBUG | requests.packages.urllib3.connectionpool "POST /api HTTP/1.1" 200 None |
2017-06-26 22:35:39,237 DEBUG | __main__ | Invoking vAPI operation |
2017-06-26 22:35:39,237 DEBUG | vmware.vapi.protocol.client.msg.json_connector _do_request: request invoke |
2017-06-26 22:35:39,481 DEBUG | requests.packages.urllib3.connectionpool "POST /api HTTP/1.1" 200 None |
2017-06-26 22:35:39,485 ERROR | vmware.vapi.client.dcli.util Error: Invalid input type |
2017-06-26 22:35:39,485 ERROR | vmware.vapi.client.dcli.util Error: Invalid input type |
2017-06-26 22:35:39,485 ERROR | vmware.vapi.client.dcli.util Error stack trace: |
File "/build/mts/release/bora-4557936/vapi-core/scons/package/dclicore/setup_console.py", line 28, in <module>
File "vmware/vapi/client/dcli/cli.py", line 626, in <module>
File "vmware/vapi/client/dcli/cli.py", line 620, in main
File "/build/mts/release/bora-4557936/vapi-core/build/dclicore/release/build/vmware/vapi/client/dcli/util.py", line 275, in handle_error
2017-06-26 22:35:39,485 ERROR | vmware.vapi.client.dcli.util Error stack trace: |
File "/build/mts/release/bora-4557936/vapi-core/scons/package/dclicore/setup_console.py", line 28, in <module>
File "vmware/vapi/client/dcli/cli.py", line 626, in <module>
File "vmware/vapi/client/dcli/cli.py", line 620, in main
File "/build/mts/release/bora-4557936/vapi-core/build/dclicore/release/build/vmware/vapi/client/dcli/util.py", line 275, in handle_error