Posted on by Tony Lucas
Something we’ve been asked for for quite a while now is the ability for customers to supply metadata to their virtual servers at run-time. It’s really useful for things like dynamic configuration of servers, passing data securely to ‘dumb’ servers and so on. Run-time metadata is great, but wouldn’t it be great if you could also use metadata to store and use data on a more permanent and flexible basis?
So we are unveiling a new metadata service. Metadata covers the following types of object:
As you can see, Instance metadata is the “run-time” category, and all the others stick around, even when servers are stopped.
When you boot up a server, it can retrieve the metadata associated with its instance, server, image and the customer that owns it as an XML. Each type of object is represented in a different section of the XML file. You can also retrieve the metadata through the API.
Each of these metadata sections can have public, private or restricted metadata, as well as system generated metadata. The difference between each classes is who is allowed access to them and through which mechanism; this best described using the table below:
| Public | Restricted | Private | System | |
|---|---|---|---|---|
| Available to the VM | Yes | Yes | No | Yes |
| Customer can read using API if customer owns object | Yes | Yes | Yes | Yes |
| Customer can write using API if customer owns object | Yes | Yes | Yes | No |
| Customer can read using API if object not owned by customer | Yes | No | No | No |
| Customer can write using API if object not owned by customer | No | No | No | No |
We have added a number of calls to the API for to allow you to read and write metadata (subject to the above restrictions), which have been rolled out as part of the FlexiScale 2.1 release. Full details are available in the API guide available here.
You can also read the metadata from the virtual machine itself, through a simple http or https request. Full details are in our metadata document available here.
This enables you to do all sorts of interesting things. Here are some ideas:
Full documentation on the metadata service is available here
We’ve only just scratched the surface of possibilities, so we’d love to hear suggestions and ideas from our users on what they come up with.
On that note, we have a number of extensions to the metadata service already planned (the ssh keys being one, but some others are already being worked on). Watch this space!