If you have a lot of super metrics, backing them up can be a challenge. You cannot do bulk export to back up. It’s easy to have version control issue if you manually export each.
Replicating in another instance (e.g. your test/dev) is tedious as you need to import one by one.
A workaround is to use Policy as vehicle to bulk export/import.
- For backup purpose, export is all you need.
- For restore into the same environment (where you exported it earlier), you can use the same XML file. You don’t need to customise it.
- For replicating in another environment, you likely need to modify the XML file. This is because the policy file contains other settings, such as alert. It’s safer if your exported policy does not contain all other settings.
I’ll show you how to trim the policy file, so it has only super metrics. In this way, it’s safe to import into any environment, as it won’t modify anything. The XML file only contains super metrics, that’s all.
The policy file is just a long XML file. In the example below, it has >5000 lines! Notice it has Alerts and Custom Profile.
To delete an entire section, simply use the keyboard to highlight them. See below, where I selected Custom Profile.
I’ve also deleted the alert section. The file is shorter now 🙂
We still have some irrelevant lines (line 4 – 1187 in my case). Delete them too. You’ll end up with something like this.
I’ll expand the content so you know what exactly the supermetric section contains.
BTW, do not copy/paste your super metric from vR Ops UI into the XML file. The expression is not 100% identical.
Once done, you can import it safely into another vR Ops instance. The import is much faster too! Here is what it looks like:
And if you go to Super Metrics, they are all there 🙂
To enable them, go your default policy (the one marked with a tiny D on the column), and edit it. Go to section 6, and find your super metrics. In Operationalize Your World case, they are all prefixed with “Ops. ”
Do not enable for all objects. It will slow down your system. It also makes it more complex unnecessarily as the formula don’t apply to them.