I have one Grafana dashboard which displays some VMWare VMs info, but if that VM was deleted, the panel of this VM still appears in Grafana and displays null values.
Is there any easy way to remove such panels? Its not working once clicking on “remove” button and saving the Dashboard.
Adding some details from my dashboard.
Of course, you may not want to remove the historical data. In that case, one approach may be to modify your template variable query, to only return the list of tags for which recent data was received. This is doable with a nested query like:
SELECT vmname FROM (SELECT last(some_field), vmname FROM vsphere_vm_cpu WHERE vcenter =~ /$vcenter/ AND time > now() - 10m GROUP BY vmname)
Note that some_field needs to be the name of an Influx field that is reliably populated. In the above example a time cut-off of 10 minutes is applied - i.e. only the list of VMs for which data was received in the last 10 minutes will be shown (you can change this depending on the data frequency/reliability in your case).
Thanks for the quick reply, thats is really helpful! So as I understand this nested query should be added into “tag values query” field? Or replaced in “Query Options” query?
I’m not too familiar with your setup; in principle that query belongs in the first “Query” box in the screenshot that you shared. But yes, some version of it may need to go in some of the other query boxes also.