I try to use python for get VM name on VMware (vSphere) when I execute this python script:
https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/get_vm_names.py
I have this message :
python3 test2.py --host ip_of_vmware
usage: test2.py [-h] -s HOST [-o PORT] -u USER [-p PASSWORD] [-S]
test2.py: error: the following arguments are required: -u/--user
I don't know how to execute this script.
I think this line which used to put in parameter:
si = SmartConnectNoSSL(host=args.host,
user=args.user,
pwd=args.password,
port=int(args.port))
atexit.register(Disconnect, si)
I want to know how to execute this script.
The arguments required for the program are built by setup_args function in that program which in turn appears to be constructed by this line:
This is in a package I don't have so I can't see what it is doing.
Nevertheless the help message, without explicitly stating which arguments are mandatory, is hinting in that general direction. I believe the arguments in [ ] are optional and everything else is required, so you need at least -s HOST and -u USER
or