Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

how to get the uuid of the virtual machine that got deleted from the VM Deleted event

$
0
0

Hi,

 

I have a requirement of getting the removed vm instance uuid when I get com.vmware.vim25.VmRemovedEvent. I tried as follows:

 

case "com.vmware.vim25.VmRemovedEvent":

       VmRemovedEvent vmDelEvent = (VmRemovedEvent) event;

       VirtualMachine vm = (VirtualMachine) MorUtil

                      .createExactManagedEntity(si.getServerConnection(), vmDelEvent.getVm().vm);

       VirtualMachineConfigInfo vmConfigInfo = vm.getConfig()

 

But getting the below exception when I am trying to retrieve configInfo. Is it becasue the vm already removed?

  exception in vmjava.rmi.RemoteException: VI SDK invoke exception:com.vmware.vim25.ManagedObjectNotFound

 

Please suggest me how to find the deleted vm config information.


Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>