Comment 4 for bug 1988942

Revision history for this message
Paul Goins (vultaire) wrote :

I looked at sources a little, but I'm not a cinder expert, so anyone who reads this, please take this with a grain of salt.

It looks like this is likely hitting cinder/api/contrib/volume_image_metadata.py, VolumeImageMetadataController.create(). That function has a @validation.schema(volume_image_metadata.set_image_metadata) decorator, and, if I'm reading it right, it defines the schema for metadata essentially as:

{"metadata": {nested dict with keys as 1-255 character strings and values as 0-255 character strings}}

In other words, the metadata field can contain many key/value pairs, and it doesn't look like there is a hardcoded limit in the number of pairs, but each key and value have a max length of 255 characters.

This is based on looking at the cinder master branch.

Interestingly, the volume_glance_metadata table of the cinder DB defines the key as a varchar(255), but the value as a text field, so it seems the DB schema may be able to allow longer values in theory without modification - it's the API's validation schema which is rejecting this.

...Again, this is my interpretation as a non-expert.