"Failed to download "[datastore_name] VM_NAME/VM_NAME-flat.vmdk": java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:1080/external-vecs/http1/vcsa-fqdn/443/folder/VM-NAME/VM-NAME-flat.vmdk?dcPath=cloud&dsName=ds-name&enc=std"
VMware vCenter Server
VMware vSphere ESXi
The VMDK files are locked by the ESXi hosts when the virtual machine is powered on. This is an expected behavior.
Power Off the virtual machine and then proceed to download the vmdk files of the virtual machine.