VMware Cloud Community
qwert1235
Enthusiast
Enthusiast
Jump to solution

Clone VM between VCs

Hello:

I know how to clone VM on the same VC via powercli (New-VM -Name "Test" -VM $OriginalVM -ResourcePool "***" -Datastore "***" -DiskStorageFormat thin), but I have to clone VM between VCs...

I have few VCs using the same PSC, so I can clone VM from one vCenter to another when I am using web client, but I wonder if how can I script it.

Is it possible to clone VM via PowerCLI between VCs?

Thank you!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you already try the script from William's Cross vCenter Clone with vSphere 6.0+ post?


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

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

Did you already try the script from William's Cross vCenter Clone with vSphere 6.0+ post?


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

0 Kudos
Caleb83
Contributor
Contributor
Jump to solution

Most of the stuff from William Lam I believe was moved to a fling.  Cross vCenter VM Mobility - CLI .  It's Java based, lets us know if this helps.

qwert1235
Enthusiast
Enthusiast
Jump to solution

Luc,

Thanks a lot for pointing to this script!

It does work (now I just need to adjust it to clone VMs to few VCs at once).

Thank you very much, again!

0 Kudos
qwert1235
Enthusiast
Enthusiast
Jump to solution

Yes, Williams script worked just fine for me.

Thank you!

0 Kudos
qwert1235
Enthusiast
Enthusiast
Jump to solution

Luc,

The William's script works great for Virtual Centers on the same SSO (connected to the same/joined PSC), but will not work between VCs on different SSOs.

I have a lot of VMs on VC6.0 that I need to clone to VC 6.7 on another SSO, but I am getting the error:

"Clone virtual machine *******  A general system error occurred: An existing connection was forcibly closed by the remote host"

Do you know by any chance how to fix it?

Thank you!

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Depends on which 6.0 version you are using, see KB2106952

Worst case you will first have to upgrade the 6.0 version to a supported 6.0 version.

For different SSO domains you can fall back on the API method (see the bullets in the KB above).

Or you can use the Fling Cross vCenter Workload Migration Utility, which support different SSO domains.


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

0 Kudos