Cloning VMs with thin disks to NFS datastore

This post was originally published on this site

I’ve adapted code from here to add to my Simple VMware GUI script for backing up VMs. It works fine for VMFS to VMFS but if the destination datastore is NFS I get “The virtual disk is either corrupted or not a supported format” when I call CloneVM_Task for the VM which I’m guessing is because the source VM is using thin disks which are a feature of VMFS so can’t be on NFS.

 

The original script set the “transform” property of the VirtualMachineRelocateSpec object but after RTFM it says that this is deprecated and ignored and that I should be using diskBackingInfo instead but I can’t find any examples close enough to what I’m trying to do to plagiarise (with credit given, as ever!) and can’t make sense of the documentation so has anyone attempted similar please, e.g. cloning VMs with thin disks to NFS or at least made them non-thin? I was hoping to be able to do it all in the spec passed to CloneVM_Task rather than having to explicitly copy the disks from the source which I’ve got code for but was hoping to avoid.

 

Thanks in advance.

 

Guy

@guyrleech

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.