I've coded support for metadata on instances.  This is part of the CloudServers API, and I needed it for my idea about metadata hints to the scheduler.<br><a href="https://code.launchpad.net/~justin-fathomdb/nova/justinsb-metadata/+merge/49490">https://code.launchpad.net/~justin-fathomdb/nova/justinsb-metadata/+merge/49490</a><br>
<br>However, Jay Pipes has raised some (very valid) design questions on the schema.<br><br>I called the table/entity 'Metadata', and it has two main attributes: 'key' and 'value'.  There's a foreign key to Instances, and long term I'd expect we'd add more foreign keys to other parent entities.  I expect only one of those parent foreign keys would be populated per row.<br>
<br>Two questions:<br><br><ol><li>Are those words too overloaded?  Jay suggested (Instance)Properties.  However, then the question arises about the 'core properties' (zone, image, instance_type for a machine) and why they are not stored in the 'properties' collection.  This is really metadata, and the CloudServers API calls it metadata.  What do people think these should be named?  "Metadata"?  "Properties"? "Tags"?  </li>
<li>I imagine that Volumes will also have metadata (long term, probably everything will - networks, images, instance types, network objects).  So should we have one entity/table or multiple entities (one per parent type)?  I like the idea of one entity, because I think it will yield better code with less code duplication.  From a SQL viewpoint, one per parent entity is probably more normal though.</li>
</ol><div><br>Justin<br><br><br><br><br></div>