Contributor
Contributor

Registering copied VM in Power CLI 6.3 / vCenter 6 / ESXi6 fails

Power CLI script copies paused VM and registers clone to vcenter with new name.  The script worked under vCenter 5.5, Power CLI 5.5 w/ ESXi 5.1, but on Vcenter 6.0 / Power CLI 6.3 / ESXi 6.0 this fails.

New-VM -VMFilePath "$DestinationVMfile" -ResourcePool $SourceVMrespool -Name $SourceVMname-Copy

"The virtual machine which was created by task '<some task>' was not found.  The likely cause is that the virtual machine was removed.  The task name was 'RegisterVM_task'"

If it is of any relevance, the Vmware 6 environment is running on a Nutanix cluster.  The VMWare 5.5 environment is a Dell VRTX.

If I try to run the New-VM command a second time with the same copy, I get a different error:

"The specified key, name, or identifier "<Vmware>-Copy" already exists"

This error is the same, even if I run the command with a different -Name value on the same copied files.

So while the first run isn't succeeding, I suspect it at least did some of the work for registering the VM (maybe it gets put in a database somewhere?), but I can't see the registered machine in vSphere.

0 Kudos
1 Reply
Leadership
Leadership

I would need to see the script you are using, at least the relevant parts.


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

0 Kudos