1

I am playing arround with pyvmomi and I managed to get the "sample" script (getallvms.py) working.

I am now trying an other script that I found here: https://raw.githubusercontent.com/vmware/pyvmomi-community-samples/master/samples/vminfo_quick.py

When I run this script I get the following error:

Iwans-Mac:sample iwan-home-folder$ python vminfo_quick.py -s 10.11.11.215 -u pyvmomi-user@sso-iwan.local -p VMware1!

Traceback (most recent call last):
  File "vminfo_quick.py", line 19, in <module>
    from tools import cli
ImportError: No module named tools

I am not sure how I install the module "tools". Can someone tell me how I should continue?

Thanks, Iwan

I-1
  • 39
  • 1
  • 7

1 Answers1

1

The script you are trying to run is meant to be run from the samples project directory. To have the most success you would want to clone the project:

git clone https://github.com/vmware/pyvmomi-community-samples
cd pyvmomi-community-samples/samples
python vminfo_quick.py xxxx

Once you do that the import issues will go away. If you look in the samples directory you will find tools/cli which is what is trying to be imported.

Michael Rice
  • 7,974
  • 1
  • 15
  • 18
  • I did an earlier clone from:[link](https://github.com/vmware/pyvmomi.git) and this did not contain the "tools" folder. anyway I managed to download the separate tools forlder from github and I manually placed this in my samples directory. The version you are proposing contains old scripts where the Smartconnect part needs some updating... – I-1 Jul 27 '16 at 15:09
  • I think you may be confused. You are linking to pyvmomi which has a sample folder in it with 2 samples (neither of which are the vminfo_quick). I am giving instructions to use the pyvmomi-community-samples which is a totally different project (which is what actually has the vminfo_quick script in it). If you find bugs in the community-samples project samples you need to file a bug with that project so someone will fix them. – Michael Rice Jul 28 '16 at 14:55