Many times we hurdle on how to enable http at ESXi Servers as they are COSless and one need to update the "proxy.xml" to enable HTTP. Here are the easy steps to upload the updated proxy.xml.
Follow the below mentioned steps:
1. Download the proxy.xml from https://<hostname>/host, save a local copy.
Note: Do not rename the file.
2. Use a text editor to open the downloaded proxy.xml file.
3. Navigate to the list of endpoints in the file (identified by the <EndpointList> tag) that contains settings for the Web service supporting the SDK. The nested tags may look something like this:
...
<e id="1">
<_type>vim.ProxyService.NamedPipeServiceSpec</_type>
<accessMode>httpsWithRedirect</accessMode>
<pipeName>/var/run/vmware/proxy-sdk</pipeName>
<serverNamespace>/sdk</serverNamespace>
</e>
...
4. Change the accessMode to httpAndHttps. Alternatively, to completely disable HTTPS, you can set it to httpOnly.
5. Save your settings and close the file.
6. Upload the updated file using httpFileAccess mechanism. Please refer below C# code snippet to upload the file.
Cookie cookie = _service.CookieContainer.GetCookies(new Uri(url))[0];
String cookieString = cookie.ToString();
String httpUrl = "https://" + <hostname> + "/host/proxy.xml";
httpUrl = httpUrl.Replace("\\ ", "%20");
Console.WriteLine("Putting VM File " + httpUrl);
WebClient client = new WebClient();
NetworkCredential nwCred = new NetworkCredential();
nwCred.UserName = username;
nwCred.Password = password;
client.Credentials = nwCred;
client.Headers.Add(HttpRequestHeader.Cookie, cookieString);
client.UploadFile(httpUrl, "PUT", localpath);
Note: You need to first login using VI APIs, steal a cookie from an active session.
7. Restart the hostd management services using DCUI.
Disclaimer
We work for InterraIT as member of technical staff. We call ourselves virtual team and we are into virtualization for the past year and half. Currently working for a major player in virtualization. Here we will write our views and learnings from our experiences.
Views published here are not read in advance by InterraIT. These are our own views.
Views published here are not read in advance by InterraIT. These are our own views.
Blog Archive
Recent Posts
Recent Comments
Labels
- 32bit (2)
- 64bit (2)
- Amazon (1)
- Cloud Computing (1)
- conflict (1)
- disk.key (1)
- ESXi (1)
- guest OS (1)
- HTTP (1)
- Install (1)
- Install vCLI (1)
- Linux (2)
- Plugin (1)
- powershell (1)
- proxy (1)
- RedHat (1)
- sequence (1)
- soap request (1)
- Suse (1)
- Suse10 (1)
- Ubuntu (1)
- vCenter IP (1)
- vCLI (2)
- VI API (1)
- VI Perl Toolkit (2)
- VI-Client Plugin (1)
- VIPT (2)
- virtual disk (2)
- Virtual Infrastructure (1)
- Virtualization (4)
- Virtualization Standards (1)
- vmdk (2)
- VMware (3)
- VMware Tools (1)
- wsdl (1)