I am using the following script to power on the vm:
from pysphere import VIServer
server = VIServer()
server.connect("esx_host_name", "uname", "pwd")
vm_target = server.get_vm_by_path("[datastore] path.vmx")
vm_target.power_on()
print vm_target.get_status()
Python 3.5 is installed in C:\Python
Pysphere folder is available in C:\Python\lib\site-packages (installed pysphere 0.1.8)
Path was set during install
I am seeing the following error:
======================= RESTART: C:\Python\Newtest.py =======================
Traceback (most recent call last):
File "C:\Python\Newtest.py", line 3, in <module>
from pysphere import VIServer
File "C:\Python\lib\site-packages\pysphere\__init__.py", line 171, in <module>
from pysphere.vi_task import VITask
File "C:\Python\lib\site-packages\pysphere\vi_task.py", line 110
except (VI.ZSI.FaultException), e:
^
SyntaxError: invalid syntax
I tried by providing the sys.path.append (path to pysphere folder, as mentioned above). But nothing seems to work. Any help on this??