Add metadata for state backups.

This is part of my effort to split up the work for backups into a few smaller patches.
Have you considered using instance ID instead of Hostname? Instance ID must be unique, whereas hostname may not be.