fborges555
Enthusiast
Enthusiast

Copy a template from one vcenter to another

Hi gurus.

can we use PowerCLI to copy a template from vcenter B to vcenter B, I found a solution from 2015, want to know if that is still the process or is there another way to do it after all this time.

 

Thanks

0 Kudos
3 Replies
LucD
Leadership
Leadership

Which solution did you find?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
fborges555
Enthusiast
Enthusiast

L.- Yours

$vmName = 'MyVM'

$templateName = 'template'

$tgtDC = 'dc'

$dc = Get-Datacenter -Name $tgtDC

# Get the source VM

$vm = Get-VM -Name $vmName

# Clone VM and move it to the target DC

New-VM -VM $vm -Name $templateName | Move-VM -Destination $dc

# Convert the cloned VM to a template

Get-VM -Name $templateName | Set-Template

 

  did not know if there was improved process after all this years

 

Thanks

0 Kudos
LucD
Leadership
Leadership

Afaik, that is still the only direct method.

You could check if it is possible with a Published ContentLibrary and then define a subscription on the other side.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos