Cloning a VM from one vCenter to another fails with error "Invalid datastore path '[DATASTORE_NAME] <VM_NAME>_2/<VM_NAME>-000001.vmdk'." if disk or hardware configuration changes are made to the new VM as part of the cloning process.
vpxd logs on the destination vCenter server similar to below:2023-08-15T18:34:39.866Z info vpxd[06646] [Originator@6876 sub=Default opID=<UUID_1>] [VpxLRO] -- ERROR session[<UUID_2> -- workflow-session[<UUID_12> -- vpx.vmprov.Workflow.execute: vim.fault.InvalidDatastorePath:
--> Result:
--> (vim.fault.InvalidDatastorePath) {
--> faultCause = (vmodl.MethodFault) null,
--> faultMessage = <unset>,
--> datastore = <unset>,
--> name = <unset>,
--> datastorePath = "[<DATA_CENTER_NAME>] <VM_NAME>_2/<VM_NAME>_39-000001.vmdk" <---- Caused by the datastore path
--> msg = ""
--> }
--> Args:
-->
--> Arg actionType:
--> "vpx.vmprov.ReconfigureVm" ----- > followed by reconfigureVM task
vpxd logs will show source and destination datastore are different between two--> backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
--> fileName = "ds:///vmfs/volumes/<UUID_5>/<VM_NAME>_2/<VM_NAME>_39-000004.vmdk",
--> datastore = 'vim.Datastore:<UUID_3>:datastore-<UUID_4>', <=== source datastore
--> backingObjectId = "",
--> diskMode = "persistent",
--> split = false,
--> writeThrough = false,
--> thinProvisioned = true,
--> eagerlyScrub = false,
--> uuid = "<UUID_6>",
--> contentId = "<UUID_7>",
--> changeId = <unset>,
--> parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
--> fileName = "ds:///vmfs/volumes/<UUID_5>/<VM_NAME>_2/<VM_NAME>_39-000001.vmdk",
--> datastore = 'vim.Datastore:<UUID_3>:datastore-<UUID_4>', <=== source datastore
--> backingObjectId = "",
--> diskMode = "persistent",
--> split = <unset>,
--> writeThrough = <unset>,
--> thinProvisioned = true,
--> eagerlyScrub = false,
--> uuid = "<UUID_6>",
--> contentId = "<UUID_7>",
--> changeId = <unset>,
--> parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
--> fileName = "ds:///vmfs/volumes/<UUID_5>/<VM_NAME>_2/<VM_NAME>_39.vmdk",
--> datastore = 'vim.Datastore:<UUID_3>:datastore-<UUID_4>', <=== source datastore
--> backingObjectId = "",
--> diskMode = "persistent",
--> split = <unset>,
--> writeThrough = <unset>,
--> thinProvisioned = true,
--> eagerlyScrub = false,
--> uuid = "<UUID_6>",
--> contentId = "<UUID_8>",
--> changeId = <unset>,
--> parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null,
--> deltaDiskFormat = <unset>,
--> backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
--> fileName = "ds:///vmfs/volumes/<UUID_11>/<VM_NAME_2>/<VM_NAME_2>_40.vmdk", <===== This destination datastore is different.
--> datastore = 'vim.Datastore:<UUID_9>:datastore-<UUID_10>',
--> backingObjectId = "",
--> diskMode = "persistent",
--> split = false,
--> writeThrough = false,
--> thinProvisioned = true,
--> eagerlyScrub = false,
--> uuid = "<UUID_6>",
--> contentId = "<UUID_7>",
--> changeId = <unset>,
--> parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
--> fileName = "[<DATA_CENTER_NAME>] <VM_NAME>_2/<VM_NAME>_39-000001.vmdk",
--> datastore = 'vim.Datastore:<UUID_3>:datastore-<UUID_4>',
--> backingObjectId = "",
--> diskMode = "persistent",
--> split = <unset>,
--> writeThrough = <unset>,
--> thinProvisioned = true,
--> eagerlyScrub = false,
--> uuid = "<UUID_6>",
--> contentId = "<UUID_7>",
--> changeId = <unset>,
--> parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
--> fileName = "[<DATA_CENTER_NAME>] <VM_NAME>_2/<VM_NAME>_39.vmdk",
--> datastore = 'vim.Datastore:<UUID_3>:datastore-<UUID_4>',
--> backingObjectId = "",
--> diskMode = "persistent",
This is due to the use of the "VirtualMachineConfigSpec" API to apply hardware changes to a cloned virtual machine.
VirtualMachineCloneSpec
There is no resolution for this issue currently.
Workaround:
Do not make any hardware changes to the new VM as part of the clone process. Create the clone first, then make hardware changes afterward.