[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [ESX:Error] HTTP 403 error for CURL upload operation



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
----------------------

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).
 
CURL options provided by me are;
 
-----------
   curl_easy_setopt(curl->handle, CURLOPT_UPLOAD, 1L);
    curl_easy_setopt(curl->handle, CURLOPT_URL, url);
    curl_easy_setopt(curl->handle, CURLOPT_READDATA, <data pointer>);
    curl_easy_setopt(curl->handle, CURLOPT_INFILESIZE_LARGE,
                        (curl_off_t) fileData->size);
    curl_easy_setopt(curl->handle, CURLOPT_READFUNCTION,
                        <read function>);
    curl_easy_setopt(curl->handle, CURLOPT_VERBOSE, 1);
------------------------
 
My understanding is there needs to be some tuning done to ESX server to accept this upload operation, please suggest if anyone has faced this issue before.
 
Thanks!
Ata

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]