VMware Cloud Community
DanielVaknin
Enthusiast
Enthusiast

Stale/Not Collecting object not being purged/deleted

Hi,

We have many objects that are not being deleted from vROPS even after the "Object History" has been passed a long time ago.

For example as you can see in this picture:

objects.png

We have many Datastores that are not collecting data (they have been deleted a few years ago), but still show up in vROPS database.

Here are our "Global Settings":

globel settings.png

As you can see, they should have been deleted after 300 days but this didn't happen..

When trying to delete the object manually it works, but since there are thousands of these objects, we can't go and delete all of them manually.

We recently upgraded to vROPS 6.4 because VMware told us that this problem should be fixed by then (and it didn't..)

Does someone know what is the issue here? or what should I search for?

Thanks!

2 Replies
JimKnopf99
Commander
Commander

Hi,

i don´t know why vrops do not purge those entries. I think that is something vmware has to evaluate.

But maybe we are able to get rid of those entry with a script.

Today, i do some testing with rest and vreops. I try to get all VM´s that has an collection state "grey". What is the collection state of your VM´s?

It is only a approach. Here is what i doing so far.

$vrealize = "vrealizeserver"

$username = "mt";

$password = ConvertTo-SecureString –String "password" –AsPlainText -Force

$credential = New-Object –TypeName "System.Management.Automation.PSCredential" –ArgumentList $username, $password

#Get all information

$data = Invoke-RestMethod -Method Get -uri "https://$vrealize/suite-api/api/resources/" -Credential $credential

#get the identifier for the vm´s with a resourcehealth of grey

$vm = ($data.resources.resource | where {$_.resourceHealth -like "*GREY*"}).identifier

#get the information about the vm´s

$vms = foreach ($vm in $vm) {Invoke-RestMethod -Method Get -uri "https://$vrealize/suite-api/api/resources/$vm" -Credential $credential}

#Get the VM name

foreach ($vms in $vms) {write-host $vms.resource.resourceKey.name}

With delete resource you should be able to delete the stale vm´s and datastores or what ever from the inventory.

Frank

If you find this information useful, please award points for "correct" or "helpful".
DanielVaknin
Enthusiast
Enthusiast

Thanks for this.

But a few things to note:

  • The collection state on those VMs (and not only VMs, but also Datastores, etc.) is not gray, but actually doesn't exist (as you can see in the picture).
  • There is actually no problem deleting these objects manually from vROps, but the issue is why it happens from the first place.

So actually my question is why it happens and not how to delete those objects.

Reply
0 Kudos