使用pysphere登录guest虚拟机时出错

时间:2016-02-04 10:05:43

标签: vmware remote-access pysphere

我有vCenter 5.5和ESXi主机是5.1但是我在登录来宾VM时遇到以下错误。我还更新了vmware工具

    import sys
    from  pysphere import VIServer
    s=VIServer()
    s.connect("X.X.X.X","administrator@vsphere.local","xxxxxxxxx"
    vm=s.get_vm_by_name('vmware_vm')
    vm.login_in_guest('admin', 'Admin123')

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/lib/python3.4/site-packages/pysphere/vi_virtual_machine.py", line 1027, in login_in_guest
        self.__validate_authentication(auth)
      File "/lib/python3.4/site-packages/pysphere/vi_virtual_machine.py", line 1706, in __validate_authentication
        raise VIApiException(e)
    pysphere.resources.vi_exception.VIApiException: [GuestOperationsUnavailableFault]: The guest operations agent could not be contacted.

2 个答案:

答案 0 :(得分:0)

我也有同样的问题。在vm上安装vm_tools有帮助。

答案 1 :(得分:0)

在虚拟机上安装vmware工具。