mstefani77
Contributor
Contributor

Renamed VMs now missing

Jump to solution

Currently running vRA 6.2 and ran into a problem with renamed VMs showing as missing in vRA.  Typically the only VMs that are renamed are ones that were imported into vRA (provisioned manually before we had it).  Basically a VM is renamed from the webclient and after the next data collection it shows a status of missing in vRA.  Despite showing the VM as missing if you run a disposal on the missing object in vRA it find and deletes the renamed VM in vCenter.  Anyone run across this problem before?  Thanks for any info,

Mike

1 Solution

Accepted Solutions
qc4vmware
Virtuoso
Virtuoso

Its been a while since I have played in the vRA world but during the workflow development I did several months ago I found it a bit of a mystery when it came to connecting the dots between the various products in play.  It seems like the catalog resources (the stuff that shows in up the items list in the CAFE server) has a link to the vCenter vm by vm id + vcenter id.  The connection between the vCAC vm and the vCenter vm uses the vCenter vm's uuid ( I think in the past is used the vm's bios uuid which was bad since that could have duplicates).  I really wish they both just used the vCenter vm's uuid.  Since the relationship from vCAC vm to vCenter vm is that vCenter vm uuid you still have a link to the vCenter vm and probably why the entity still gets removed.  I'm guessing the vCAC vm's name is only set during the initial discovery and this is why it's breaking something else in the system.  I'm sure somewhere along the line they are also using the name as part of some link to how the gui displays things or does an additional check.  Who knows.  Anyway, if you also update the vCAC vm's name I bet it will all sync up.  This code for vRO will rename the vCAC vm.

You will need two inputs.  newName (string) and vCACVm (VCAC:VirtualMachine)

var entity = vCACVm.getEntity();

var hostId = entity.hostId;

var modelName = entity.modelName;

var entitySetName = entity.entitySetName;

var entityIdString = entity.keyString;

var links = null;

var headers = null;

var updateProperties = new Properties();

updateProperties.put("VirtualMachineName", newName);

System.getModule("com.vmware.library.vcac").updateVCACEntity(hostId, modelName, entitySetName, entityIdString, updateProperties, links, headers);

View solution in original post

0 Kudos
5 Replies
qc4vmware
Virtuoso
Virtuoso

Its been a while since I have played in the vRA world but during the workflow development I did several months ago I found it a bit of a mystery when it came to connecting the dots between the various products in play.  It seems like the catalog resources (the stuff that shows in up the items list in the CAFE server) has a link to the vCenter vm by vm id + vcenter id.  The connection between the vCAC vm and the vCenter vm uses the vCenter vm's uuid ( I think in the past is used the vm's bios uuid which was bad since that could have duplicates).  I really wish they both just used the vCenter vm's uuid.  Since the relationship from vCAC vm to vCenter vm is that vCenter vm uuid you still have a link to the vCenter vm and probably why the entity still gets removed.  I'm guessing the vCAC vm's name is only set during the initial discovery and this is why it's breaking something else in the system.  I'm sure somewhere along the line they are also using the name as part of some link to how the gui displays things or does an additional check.  Who knows.  Anyway, if you also update the vCAC vm's name I bet it will all sync up.  This code for vRO will rename the vCAC vm.

You will need two inputs.  newName (string) and vCACVm (VCAC:VirtualMachine)

var entity = vCACVm.getEntity();

var hostId = entity.hostId;

var modelName = entity.modelName;

var entitySetName = entity.entitySetName;

var entityIdString = entity.keyString;

var links = null;

var headers = null;

var updateProperties = new Properties();

updateProperties.put("VirtualMachineName", newName);

System.getModule("com.vmware.library.vcac").updateVCACEntity(hostId, modelName, entitySetName, entityIdString, updateProperties, links, headers);

View solution in original post

0 Kudos
zebduin
Enthusiast
Enthusiast

Any renaming actions performed outside of vRA, for vRA managed items has the potential of causing data mismatches between the vCenter PostgreSQL database and the vRA IaaS database.  If you've ever tried to rename clusters, hosts, datastores and network port groups, you likely have experienced some of these pains.

I agree with qc4vmware. enable the capability in vRA - use ASD, publish additional actions such as a VM rename and entitle the actions to the VM.

If you find yourself with a VM with 'Missing' status, as you experienced, a destroy action will result in the VM being deleted from disk in vCenter.  That begs the question of why does the VM status report 'Missing' but still allow an action such as destroy to still work - as it obviously uses the VM UUID.  In these cases, removing manually from the vRA IaaS DB and reimporting through Infrastructure Organizer, may be your only course to clean up your vRA inventory.

mstefani77
Contributor
Contributor

Thanks guys.  Yes, it is weird that a disposal action actually is still able to correctly identify the VM and delete it despite it being "missing".  We ended up running the removal script that VMware offers to manually remove the VMs from the IAAS and Postgres databases and then re-imported.  I'm looking forward to testing out that rename script though, so thanks!

0 Kudos
muxx
Enthusiast
Enthusiast

Is the removal script available for download? I have one such virtual machine stuck in vRA that cannot be deleted.

0 Kudos