[Openstack] [Heat] Specifying metadata in Properties section is not mapped correctly

Daniel Kuffner daniel.kuffner at gmail.com
Wed Nov 20 10:31:59 UTC 2013


Hi All,
I currently try to extend the docker driver. The final result should
be that a user can specify a  host folder which should be mounted into
the docker container.

for testing I have specified some custom metadata in heat like:

HeatTemplateFormatVersion: '2012-12-12'
Parameters: {}
Mappings: {}
Resources:
  busybox:
    Type: OS::Nova::Server
    Properties:
      flavor: m1.small
      image: busybox:latest
      metadata:
          Volumes: "/tmp:/tmp/"

When I try to read the metadata in the docker driver
(/usr/lib/python2.6/site-packages/nova/virt/docker/driver.py) from the
given instance object then I get something like:

instance['metadata']

[{
    u'instance_uuid': u'7bc909c4-76d4-42d3-812d-310095f28757',
    u'deleted': 0,
    u'created_at': u'2013-11-20T10:16:14.000000',
    u'updated_at': None,
    u'value': u'/tmp:/tmp',
    u'key': u'Volumes',
    u'deleted_at': None,
    u'id': 56
}]

Please note that the map does not container "Volumes: /tmp:/tmp" but a
"value" and a "key" key.
To access the needed value I have to:

instance['metadata'][0]['value']

instead of:

instance['metadata'][0]['Volumes']

Is that a bug in heat or is my template wrong?
does anybody else use the metadata section in a heat template?

thank you,
Daniel




More information about the Openstack mailing list