Ultimately, I'm trying to write a PowerCLI script that will move my collection of templates between hosts by converting them to VMs, moving them, and then converting them back to templates. I am unable to get past the first step, because none of my templates can be converted back to VMs. Whether through the vCenter interface or through PowerCLI, i get a vim.fault.NotFound error with more detail of "The object or item referred to could not be found. vDS dvs port 51970 cannot be found." I assume this is a DVS switch port that existed when the original VM was templatized, and may no longer exist. See below for supporting logs. Any thoughts?
Chris
2021-01-04T22:26:52.232Z info vpxd[03619] [Originator@6876 sub=vpxLro opID=408cee58] [VpxLRO] -- BEGIN task-276953 -- vm-40781 -- vim.VirtualMachine.markAsVirtualMachine -- 526bc7cd-fc78-5692-bb77-2afba1bc5fa4(52fc23ca-26ad-514b-4657-2b7c1a0de405)
2021-01-04T22:26:52.238Z warning vpxd[03619] [Originator@6876 sub=vmmoVm opID=408cee58] New local path path for VM [vim.VirtualMachine:vm-40781,template-centos-6] is empty. Ignoring the change - vpxa will report the new path shortly
2021-01-04T22:26:52.246Z error vpxd[03619] [Originator@6876 sub=provisioning opID=408cee58] Unable to register template ds:///vmfs/volumes/5ab1058b-7d6e9626-ddb5-001018d6af90/template-centos-6/template-centos-6.vmtx as VM
2021-01-04T22:26:52.264Z error vpxd[03619] [Originator@6876 sub=SOAP-3 opID=408cee58] Method vim.VirtualMachine.markAsVirtualMachine threw undeclared fault of type vim.fault.NotFound
2021-01-04T22:26:52.264Z info vpxd[03619] [Originator@6876 sub=vpxLro opID=408cee58] [VpxLRO] -- FINISH task-276953
2021-01-04T22:26:52.264Z info vpxd[03619] [Originator@6876 sub=Default opID=408cee58] [VpxLRO] -- ERROR task-276953 -- vm-40781 -- vim.VirtualMachine.markAsVirtualMachine: vim.fault.NotFound:
--> Result:
--> (vim.fault.NotFound) {
--> faultCause = (vmodl.MethodFault) null,
--> faultMessage = (vmodl.LocalizableMessage) [
--> (vmodl.LocalizableMessage) {
--> key = "com.vmware.vim.vpxd.dvs.portNotFound.label",
--> arg = (vmodl.KeyAnyValue) [
--> (vmodl.KeyAnyValue) {
--> key = "port",
--> value = "51970"
--> }
--> ],
--> message = <unset>
--> }
--> ]
--> msg = ""
--> }
--> Args:
-->
--> Arg pool:
--> 'vim.ResourcePool:resgroup-33696'
--> Arg host:
-->
com.vmware.vim.vpxd.dvs.portNotFound.label >>>> Seems the template has an old dvs port info . Update the template
Moderator: Moved to vSphere Discussions