VMware {code} Community
SebEnn
Contributor
Contributor

Set type of hard disk for virtual machine

Hello, 
when creating a virtual machine within the vCenter Web Interface, you have the option to set the Disk Provisioning of a hard disk (later called type of hard disk).

SebEnn_0-1678282430610.png

I would like to set this option with the vSphere Automation SDK in Java (currently version 7.0), but I couldn't figure out a way to do so.
Does anyone know which UpdateSpec or CreateSpec I need to use?

0 Kudos
1 Reply
doskiran
Enthusiast
Enthusiast

AFAIK, not all VM operations-based vSphere REST APIs are available in current releases. We may expect it in the next major vSphere release. But in SOAP APIs (vSphere Management APIs), have the option to set the disk provisioning type of a hard disk.

Sample code:
Add new harddisk with specified capacity and disk provisioning type for a VM:
https://developer.vmware.com/samples/1820/add-new-harddisk-with-specified-capacity-and-disk-provisio...