Resolve vRA/vCAC VM to vCenter VM

I wrote this post some time ago but I felt that it didn’t include some other use cases where you would want to resolve a vCenter virtual machine. I also previously used code that was provided by the vRO appliance that I wasn’t too keen on (logging was a bit light and there was code to search using the BIOS UUID, which we don’t care about). I have therefore updated this post to reflect the following use cases:

  • Find the vCenter VM by its instance Uuid when using the Event Broker;
  • Find the vCenter VM by its instance Uuid on a specific vCenter Server;
  • Find the vCenter VM by its name, on a specific vCenter Server and a specific folder;
  • Find the vCenter VM by its MoRef id on a specific vCenter Server;

Hopefully, there should be enough code provided here to help you achieve your goal no matter what your scenario. However, if you need something different, then feel free to contact me and I will try to help. Continue reading