VMware {code} Community
lcqlys
Contributor
Contributor

How to increase vm disk capacity using vSphere Client SDK?

I'm new to the SDK and can't find any documentation or code sample on how to increase a VM's disk capacity.  Any pointers?

I also tried the REST API but it doesn't seem to take the 'capacity' attribute in the request and keep getting 400 error:

 

I followed this REST API: 

https://developer.vmware.com/apis/vsphere-automation/v7.0U1/vcenter/rest/vcenter/vm/vm/hardware/disk...

 

curl -kv --location --request PATCH 'https://{vcenterurl}/rest/vcenter/vm/vm-22/hardware/disk/4000' \
--header 'vmware-api-session-id: 826f459a3ec1a8cd8b8fc3797a6818fe' \
--header 'mimetype: application/json' \
--header 'Content-Type: application/json' \
--header 'Cookie: vmware-api-session-id=826f459a3ec1a8cd8b8fc3797a6818fe' \
--data-raw '{
"spec": {
"backing": {
"vmdk_file": "[DS10] myVM.vmdk",
"type": "VMDK_FILE",
},
"capacity": 64424509440,
}
}
'

0 Kudos
1 Reply
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

 

Unfortunately, we are not able to provide a direct help since this forum is concerned with vSphere Client plugin development and APIs.

You can post your request in the general vCenter Server forum.

In addition, if you want to access some vCenter Server APIs from your plugin, you can contact the folks from the Management SDK.

 

Best Regards,

Denis

0 Kudos