VMware Cloud Community
R9Y
Contributor
Contributor

ovftool 4.3 duplicate vms

Just doing some testing with ovftool 4.3 and vsphere 6.7 and I'm seeing a change in functionality compared with ovftool 4.1 and vsphere 6.0.

Previously we were able to import vms using indentical vm names by specifying the --vmFolder option on the import task, with 4.3 and 6.7 this doesnt appear to working and a duplicate vm warning is returned with a sugestion to user the --override switch, which if used then overwrites the existing vm.

Example:

ovftool --noImageFiles --acceptAllEulas --X:logFile=ovf.log --X:logLevel=verbose --noSSLVerify --allowExtraConfig --exportFlags=extraconfig,uuid,mac --I:morefArgs --datastore=vim.Datastore:datastore-126 --vmFolder=vim.Folder:group-v325 --diskMode=thin --net:vlan1310=vim.Network:network-142 --name=xyz /xyz.ova vi://user:password@VC/DC/host/CLUSTER

Error: Duplicate name 'xyz' on target. Use --overwrite option to delete it.

The first import does work correctly and the vm ends up in the specified vm folder object, its the subsequent imports using an indetically named vm to one that already exists in the inventory but targetting a different vm folder object then cause the issue.

0 Kudos
2 Replies
dgold
Enthusiast
Enthusiast

The enhancement in 4.3 is really good that it can protect the user, in case of various reasons first deployment fails, be alerted and know about it.  There are potential for that happening. In previous version was not checking at all and I think that is why you're able to get it through. The side effect was that you had that other VM from previous failed deployment sucking up resources.

However you have a good point and it should allow you to do that.  The only side effect, which is not bad, is that there will be multiple VMs with the same name. That means if you have scripts finding entities they need to be aware to not just use name but rather ManagedObject reference info to compare.

I think this should be taken up as an enhancment for next release. 

0 Kudos
R9Y
Contributor
Contributor

Thankyou for the response I was just checking I wasn't missing any obvious. I'll raise a case for the feature request.

0 Kudos