Open JimCircadian opened 5 years ago
It turns out using GuestOS.CENTOS or GuestOS.RHEL-7 works fine. I guess this is the based on the host version?
Though the disk also ended up being thin provisioned, I'd be interested to understand whether it's a missing feature of the REST API to specify the provisioning type?
Thanks in advance.
The REST API vmdk create spec doesn't support desired provisioning like LAZY, THICK, THIN etc.
Only few config is supported in vmdk create spec (which you already covered as in your code snippet), https://vmware.github.io/vsphere-automation-sdk-python/vsphere/cloud/com.vmware.vcenter.vm.html#com.vmware.vcenter.vm.hardware_client.Disk.VmdkCreateSpec
If there's anything I can do to help advance this, let me know! ;-) I think it's still a really useful feature to have!
"...The REST API vmdk create spec doesn't support desired provisioning like LAZY, THICK, THIN etc...." stuck with this as well, is there any estimation when we can expect that to be available? The provisioning of HDD (vmdk) is OK, but it's odd to think in direction to convert from thin to tick (or vice versa) because of lack of ability to specify that in advance.
Environment
vmdkspec = Disk.VmdkCreateSpec( capacity=64 * 1024 ** 3, name="a-test-disk", storage_policy=None, ) boot_disk = Disk.CreateSpec(type=Disk.HostBusAdapterType.SCSI, scsi=ScsiAddressSpec(bus=0, unit=0), new_vmdk=vmdkspec)
... vm_create_spec = VM.CreateSpec(name="a-test-name", hardware_version=Hardware.Version.VMX_11, cpu=Cpu.UpdateSpec(count=2, cores_per_socket=1, hot_add_enabled=False, hot_remove_enabled=False), memory=Memory.UpdateSpec(size_mib=2 * 1024, hot_add_enabled=False), guest_os=GuestOS.CENTOS_7, placement=placement_spec, disks=[primary_disk], nics=[nic], boot=boot_spec, boot_devices=boot_device_order,)
INFO:root:Resource pool group-v1172 and folder resgroup-1053 with datastore datastore-952 selected INFO:root:Creating VM Traceback (most recent call last): File "create_vm.py", line 70, in
vm = client.vcenter.VM.create(vm_create_spec)
File "/home/jambyr/.virtualenvs/vmware/lib/python3.6/site-packages/com/vmware/vcenter_client.py", line 3660, in create
'spec': spec,
File "/home/jambyr/.virtualenvs/vmware/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py", line 345, in _invoke
return self._api_interface.native_invoke(ctx, _method_name, kwargs)
File "/home/jambyr/.virtualenvs/vmware/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py", line 298, in native_invoke
self._rest_converter_mode)
com.vmware.vapi.std.errors_client.Unsupported: {messages : [LocalizableMessage(id='com.vmware.api.vcenter.vm.device.disk.unsupported_gos_get_disk_size', default_message="Unable to get recommended disk size for the guest OS. Guest OS 'CENTOS_7' is not supported.", args=['CENTOS_7'], params=None, localized=None)], data : None, error_type : None}