HI,<br><br>In the file /usr/lib/python2.7/dist-packages/nova/virt/vmwareapi/read_write_util.py, the code which copying the image from Glance to the ESXi datastore doesnt seem to handle the authentication.<br><br>class VMWareHTTPWriteFile(VMwareHTTPFile):<br>
"""VMWare file write handler class."""<br><br> def __init__(self, host, data_center_name, datastore_name, cookies,<br> file_path, file_size, scheme="https"):<br>
base_url = "%s://%s/folder/%s" % (scheme, host, file_path)<br> param_list = {"dcPath": data_center_name, "dsName": datastore_name}<br> base_url = base_url + "?" + urllib.urlencode(param_list)<br>
_urlparse = urlparse.urlparse(base_url)<br> scheme, netloc, path, params, query, fragment = _urlparse<br> if scheme == "http":<br> conn = httplib.HTTPConnection(netloc)<br> elif scheme == "https":<br>
conn = httplib.HTTPSConnection(netloc)<br> conn.putrequest("PUT", path + "?" + query)<br> conn.putheader("User-Agent", USER_AGENT)<br> conn.putheader("Content-Length", file_size)<br>
conn.putheader("Cookie", self._build_vim_cookie_headers(cookies))<br> conn.endheaders()<br> self.conn = conn<br> VMwareHTTPFile.__init__(self, conn)<br><br> <br>Can some one enlighten me on how this works? When I manually tried the same using curl and provided the username/password, the file upload worked just fine. But when I create an instance in OpenStack, the image copy to ESXi is not working.<br>
<br>Regards,<br>Balu<br><br><br>