2012/12/30 Ata Bohra <ata.husain(a)hotmail.com>:
Hi Everyone,
Merry Christmas and Happy New Year!
I'm trying to upload disk to ESX 5.0 server using the URL obtained by the
server (during VM installation process); I'm using libcurl support in
libvirt to upload the disk, but I get this error on file upload:
----------------------
* About to connect() to <ip> port 443 (#1)
* Trying <ip>... * connected
* found 153 certificates in /etc/ssl/certs/ca-certificates.crt
* server certificate verification SKIPPED
* compression: NULL
* cipher: AES-128-CBC
* MAC: SHA1
> PUT /ha-nfc/52c6d592-7636-67c5-29f3-d5b373be4f42/disk-0.vmdk HTTP/1.1
User-Agent: libvirt-esx
Host: <ip>
Accept: */*
Cookie: vmware_soap_session="521af33d-2bbe-38aa-21e8-13d474ccb023"
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:vim25"
Content-Length: 7021568
< HTTP/1.1 403 Forbidden
< Date: Sun, 30 Dec 2012 01:28:19 GMT
< Connection: close
< Content-Type: text; charset=plain
< Content-Length: 44
----------------------
The URL /ha-nfc/52c6d592-7636-67c5-29f3-d5b373be4f42/disk-0.vmdk looks
like the lease you get during OVA import on the ESX server to upload a
disk image to, isn't it? I'm not sure why you would get and Forbidden
error from the server here. Are you logged in with an restricted user
account instead of the root account?
To achieve this operation I've added a routine to support file
Upload (for
ESX driver as currently it only support buffer upload), I verified its
functioning my uploading a file using datastore based URL:
(http(s)//<ip>/file??dcPath=ha-datacenter?dsName=xxx).
Are you trying to upload directly to the root of the datastore? IIRC
this isn't allowed and you can only upload subdirectories in the
datastore as in
http(s)//<ip>/subdirectory/file??dcPath=ha-datacenter?dsName=xxx
--
Matthias Bolte
http://photron.blogspot.com