Example 2 - Osirium/vcdriver GitHub Wiki

Managing the session

You can see in the Example 1 how to open a Vsphere session. That session is unique across the python session and will be automatically closed when python exits, but you can manually do so before:

>>> from vcdriver.session import connection, close
>>> connection(vcdriver_host='my.vsphere.host', vcdriver_username='admin', vcdriver_password='pass')
Vcenter session opened with ID 52d75977-360d-0923-39ff-b914fd323d61
'vim.ServiceInstance:ServiceInstance'
>>> close()
Vcenter session with ID 52d75977-360d-0923-39ff-b914fd323d61 closed