Is Move-Template more for moving templates within a single vCenter? Not so much Moving Templates to another vCenter?
I tried all combinations below:
$template = Get-Template -Server $svr -Name "Template-1"
$destination = Get-Datacenter -Server $dst
$destination = Get-VMHost -Location $cluster -Server $dst | ?{$_.ConnectionState -eq "Connected"} | Get-Random
$destination = Get-Folder -Server $dst -Name "Templates"
Move-Template -Server $svr -Template $template -Destination $destination
When I tried with VMHost:
Template location can only be Datacenter or VM Folder. You passed: VMHostImpl
When I tried with a VM Folder and Datacenter:
"When migrating a VM to a different vCenter Server both Destination and Datastore need to be specified. No other destination types but
VMHost/Resource Pool and Datastore are supported for Cross vCenter vMotion"
There is no -Datastore parameter for Move-Template so what am I missing?
Or is the only way to do this right is New-VM from template then Move-VM, then convert back to template? What is the point then of Move-Template?
No X-vCenter migration with that cmdlet I'm afraid.
Only move a template, as you can see in the error message, to a Datacenter or a Folder of type VM in the same vCenter.
And yes, converting to a VM, then cross-vCenter move the VM and convert it back to a template is currently the only way to do it that I know off.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No X-vCenter migration with that cmdlet I'm afraid.
Only move a template, as you can see in the error message, to a Datacenter or a Folder of type VM in the same vCenter.
And yes, converting to a VM, then cross-vCenter move the VM and convert it back to a template is currently the only way to do it that I know off.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
See also Cloning a template from one vCenter to another in ELM
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference