Hallo
I wont to copy virtual machine data from a Windows local disk to a vsan datastore with Powershell.
In the first step I create a PSdrive.
As example:
New-PSDrive -Location (Get-Datastore -name $a.Datastore) -Name ds -PSProvider VimDatastore -Root "\"
the next step is the copy procedure with "Copy-DatastoreItem".
As example:
Copy-DatastoreItem -Item ($path + "\VMs\" + $a.VMname + "\") -Recurse -Destination "ds:\" -force
All files (apart VMDK) where copy to the vsan datastore. The folder for the VM was create automatically.
Only the files with ending *.vmdk can't copy. I've become an 500 (Internal Server Error).
The same Problem is with Thin or Thick disk. Large file e.g. ISO file can copy to the Datastore.
Change the destination datastore to local datastore of an ESXi server has the same problem.
I've test the powercli connection to the vCenter or to the ESXi host. Both have the same failure.
As a workaround:
When I use thick disk and change the file extension to e.g. TXT, the copy process is working fine
Hav anybody the same problem and a solution?
Kind regards
Matthias