If I add a VM to a service, and then remove the VM from VMDB, it disappears from the service as well:
s1 = $evm.vmdb(:service).find_by_name("s1") puts s1.vms.count 0 vm = $evm.vmdb(:vm).find_by_name("vm1") vm.add_to_service(s1) puts s1.vms.count 1 vm.remove_from_vmdb puts s1.vms.count 0
If I do the same with generic objects, it is not removed from the service:
s1 = $evm.vmdb(:service).find_by_name("s1") puts s1.generic_objects.count 0 go1 = $evm.vmdb(:generic_object).find_by_name("go1") go1.add_to_service(s1) puts s1.generic_objects.count 1 go1.remove_from_vmdb puts s1.generic_objects.count 1 puts s1.generic_objects.to_s [nil]
So the object is still referenced in the service, but with nil. The UI still shows 1 generic object of the service and if I try to click the objects I get the following error message:
In order to avoid this problem I found a workaround to remove it from the service before removing from vmdb:
But I need to keep track which service(s) the object were added to safely delete it. Is this behavior intended or an issue?