pyvmomi
pyvmomi copied to clipboard
upload a vmdk to vsan datastore leaves disk unusable
Describe the bug
Hi, uploading a vmdk with pyvmomi to a vsan datastore seem to leave the resulting file in an unusable state.
This pops up for me because I am using vsphere_copy in ansible (which is using the sdk in background).
For simplicity I reproduced the issue with the sample datastore upload python: https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/upload_file_to_datastore.py
Version 8.0.2.0.1 Python 3.11 on a RHEL8.9
vmdk is a stream optimized v6 image, using the same file and uploading it via the webui through firefox results in a usable vmdk.
Uploading the vmdk via api results in an error when trying to use in vsphere: "Unsupported or invalid disk type 22 for 'scsi0:0'. Ensure that the disk has been imported."
vCenter: 7.0.3 Build: 22357613 (VxRail 7.0.482)
Reproduction steps
- have a stream optimized vmdk + a vsphere + vsan
- python3.11 upload_file_to_datastore.py -s vsphere_server -o 443 -u [email protected] -p "password" --disable-ssl-verification --datastore-name VxRail-Virtual-SAN-Datastore-id --local-file-path ~/diskimages/file.vmdk --remote-file-path import/file.vmdk
- create a VM that uses that VMDK as disk ...
Expected behavior
Works, no error
Additional context
Actual behavior: VM does not start; error "Unsupported or invalid disk type 22 for 'scsi0:0'. Ensure that the disk has been imported."