Python vCenter Helper
vCenterScripter is a Python library designed to simplify and enhance the usage of the PyVMOMI library. vCenterScripter provides developers with an intuitive and streamlined interface, enabling them to automate and interact with VMware vSphere infrastructure effortlessly.
pyvmomi, PrettyTable
pip install -e git+/~https://github.com/P923/vCenterScripter.git#egg=vcenterscripter
An example of usage.
from vCenterScripter import vm
if __name__ == '__main__':
si = connect.SmartConnect(host=args.host, user=args.user, pwd=args.pwd,
disableSslCertValidation=True)
# Get names of VMs
name_vms = list_vm_names(si)
# Get a VM from vCenter
vm = get_vm(si, "vm_name")
# Run a program on VM using vmWare tools
cred = vim.vm.guest.NamePasswordAuthentication(username=entry.username, password=entry.password)
run_program(si, vm, cred, "net.exe", program_arguments="user")
# Generate a snapshot
generate_snapshot(si, vm, "Snapshot1", "A generated snapshot.")
# And more...
For more documentation see the docstrings.
This project is licensed under the MIT License.
Matteo P923 | 2023