mogamal1 commented on issue #13249:
URL: https://github.com/apache/cloudstack/issues/13249#issuecomment-4544427157

   Title:
   attachVolume fails with HTTP 500 on PreSetup (DatastoreCluster) pool - 
   VirtualMachineMO.attachDisk uses vCenter HTTP folder browser which doesn't 
   work for DatastoreCluster datastores
   
   Component: Storage, VMware
   
   CloudStack Version: 4.22.0
   
   Description:
   When attaching a detached volume (state=Ready) to a VM (even Stopped) where 
   the volume resides on a PreSetup/DatastoreCluster-type primary storage pool, 
   attachVolume fails with:
   
     java.io.IOException: Server returned HTTP response code: 500 for URL:
     https://vcenter.../folder/i-XXXX-XX-VM%2F<vmdkpath>.vmdk
     ?dcPath=<DC>&dsName=<DatastoreCluster>
     at VirtualMachineMO.attachDisk(VirtualMachineMO.java:1458)
   
   Root Cause:
   VirtualMachineMO.attachDisk() calls getVmdkFileInfo() which performs an 
   HTTP GET to vCenter's /folder/ datastore browser endpoint to determine 
   VMDK capacity. This HTTP endpoint returns HTTP 500 for DatastoreCluster 
   (poolType=PreSetup) datastores — vCenter does not support HTTP-based file 
   browsing for DatastoreCluster paths.
   
   The fix should use vSphere API queryVirtualDiskInfo() instead of HTTP 
   datastore browser to retrieve VMDK metadata for PreSetup pool types.
   
   Steps to Reproduce:
   1. Add a PreSetup/DatastoreCluster primary storage pool (poolType=PreSetup)
   2. Create or migrate a detached data volume to that pool
   3. Attempt cmk attachVolume id=<vol-uuid> virtualmachineid=<vm-uuid>
      (fails whether VM is Running or Stopped)
   
   Expected: Volume attaches successfully
   Actual: HTTP 500 from vCenter, attach fails
   
   Environment:
   - CloudStack 4.22.0
   - VMware vCenter (vcenter.opscloud.eumetsat.int)
   - Primary storage type: DatastoreCluster (poolType=PreSetup)
   - ESXi hosts: tcebld* cluster
   
   Workaround: None within CloudStack currently.
   Related: #10626


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to