As @wlargou suggested, if you don’t want the tags to be returned by the
SHOW TAG VALUES query, you need to remove the relevant data from Influx altogether. Specifically the
DROP SERIES query - see Manage your database using InfluxQL | InfluxDB OSS 1.8 Documentation for detail on that.
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)
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).