0

I am using PowerCLI version 6 on a Windows server with 20 GB of free space. I am trying to use copy-datastoreitem with PowerCLI. It seems to work to transfer a .vmdk file from an ESXi datastore to the Windows server that has PowerCLI. There are no error messages, but there is one problem. The .VMDK file takes up 5 GB of space in the datastore. The vSphere GUI reflects this. The copy file, on the Windows server after the PowerCLI command runs, is only 1 KB. Clearly the copy did not work correctly.

Is there another command besides the copy-datastoreitem command that works more effectively?

What would cause the file sizes to be so different? Using other PowerCLI commands, I found the 5 GB file (the source file) has the capacity for 35 GB of storage space as a VM. It is a working, non-corrupt file. The copy is not. But my PowerCLI commands have no errors. There is evidence that they work except for a huge difference in the size of the copied file. The problem is 100% reproducible.

Kiran
  • 67
  • 4
  • 10

1 Answers1

0

The descriptor file defines how and where the data of the VMDK image is stored. The data is stored in extent data files.

I think copy-datastoreitem only copies a file, that is in your case: You just copy / download the descriptor file which is pretty small.

I didn't find a PowerCLI command to download a VMDK but maybe Export-VApp can help you.

On reddit someone said that "you need to download the flat.vmdk, not the .vmdk, which is just the disk descriptor".

Mario Lenz
  • 1,612
  • 9
  • 13