[Openstack] I dont see authentication being handled while copying images from glance to esxi
Balamurugan V G
balamuruganvg at gmail.com
Fri Jan 25 06:44:02 UTC 2013
HI,
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.
class VMWareHTTPWriteFile(VMwareHTTPFile):
"""VMWare file write handler class."""
def __init__(self, host, data_center_name, datastore_name, cookies,
file_path, file_size, scheme="https"):
base_url = "%s://%s/folder/%s" % (scheme, host, file_path)
param_list = {"dcPath": data_center_name, "dsName": datastore_name}
base_url = base_url + "?" + urllib.urlencode(param_list)
_urlparse = urlparse.urlparse(base_url)
scheme, netloc, path, params, query, fragment = _urlparse
if scheme == "http":
conn = httplib.HTTPConnection(netloc)
elif scheme == "https":
conn = httplib.HTTPSConnection(netloc)
conn.putrequest("PUT", path + "?" + query)
conn.putheader("User-Agent", USER_AGENT)
conn.putheader("Content-Length", file_size)
conn.putheader("Cookie", self._build_vim_cookie_headers(cookies))
conn.endheaders()
self.conn = conn
VMwareHTTPFile.__init__(self, conn)
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.
Regards,
Balu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130125/ddc6ced7/attachment.html>
More information about the Openstack
mailing list