我正在使用脓球与我的esxi服务器接口。
我尝试使用的函数之一是send_file (解释为这里)。这导致以下例外情况:
File "/usr/local/lib/python2.7/dist-packages/pysphere/vi_virtual_machine.py", line 1282, in send_file
resp = opener.open(request)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 500: Internal Server Error我启用了跟踪文件,它们看起来如下(我正在显示响应)
RESPONSE:
200
OK
-------
Date: Wed, 10 Dec 2014 07:03:21 GMT
Cache-Control: no-cache
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
Content-Length: 521
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<InitiateFileTransferToGuestResponse xmlns="urn:vim25"><returnval>https://*:443/guestFile?id=11&token=52548475-79f4-6b02-a207-be5d1e3b0a8511</returnval></InitiateFileTransferToGuestResponse>
</soapenv:Body>
</soapenv:Envelope>在esxi服务器本身上,我可以从最近的任务中看到,已经提出了传输文件的请求。
在这个阶段,我很困惑。我至少检查了我所有的设置五次。我已经测试过我是否有能力执行其他的动作,而且它们看起来都很好。我能做些什么?是否需要在esxi服务器中启用某些设置?那个VM?防火墙上可能有什么东西?
一个类似的问题:https://code.google.com/p/pysphere/issues/detail?id=53
编辑:我想要做的是能够将文件传输到VM。如果有另一种可靠的方法,那也是很好的。
发布于 2015-06-10 16:25:38
我试着在pysphere中使用send_file,它痛苦而缓慢。由于某种原因,发送文件与二进制文件有问题。我的解决办法是:用二进制文件创建iso文件,在虚拟机中挂载它(为它存在pysphere api ),创建bat文件(它应该找到正确的cdrom并复制您的文件)。通过send_file发送批处理。通过启动进程运行。
Yapp,send_files在处理大文件时遇到麻烦,需要使用小黑客https://code.google.com/p/pysphere/issues/detail?id=16
https://stackoverflow.com/questions/27405032
复制相似问题