I would like to clone a VM inside a vApp to create another instance of it in that same vApp. I have tried this with Import-CIVApp:
$targetVapp = Get-CIVApp MyVapp
$sourceVM = (Get-CIVM -VApp $targetVapp)[0]
$sourceVMinVC = $sourceVM | Get-VM
$computerName = "CloneTest"
# Note: Import CIVapp clones by default
Import-CIVApp -VM $sourceVMinVC -VApp $targetVapp -ComputerName $computerName
But when this runs I always get an error because that name already exists:
Import-CIVApp There is already a VM named "Ubuntu 12.10 (c42a678b-dba0-4142-86f7-040d4f0daa92)".
How can I change the name to avoid this?
Or is another approach required?
Thanks in advance...