What is vmjuggler¶
vmjuggler provides the simple high level API to VMWare’s SDK.
It built around pyvmomi
library with aim to simplify interaction to VMWare VCenter and it’s managed objects
for DevOps crowd and those who don’t want to plunge deeply to object’s relations. At the same time ability
to perform actions on low level was preserved.
Installation¶
pip install vmjuggler
Manual installation¶
Install following python packages
- pyvmomi
- future-fstrings if used Python version < 3.5
Download latest vmjuuggler from https://github.com/shurkam/vmjuggler
Unpack and run
python setup.py install
Getting started¶
from vmjuggler import VCenter
# Create instance of VCenter and connect to VCenter
vc = VCenter('10.0.0.1', 'user', 'super_secret_password')
vc.return_single(True)
vc.connect()
# Find VM and print out it's power state
vm = vc.get_vm(name='My_Linux_VM')
if vm:
print(f'{vm.name} | {vm.state}')
# Close connection to VCenter
vc.disconnect()
Note
To use nice Python F-string feature with Python < 3.5 the future-fstrings package should be installed and the following line should be the first line in file after shebang.
# -*- coding: future_fstrings -*-