Mailing List Archive

Can't update the metadata via nova cli
Hi everyone,

I tried a little today.

$ nova meta my_instance set hostname=new_hostname

I didn't get any errors.

Nothing in the instance (curl
http://169.254.169.254/latest/meta-data/hostname) even after reboot and
nothing in the instance db record.

Here are the nova-api trace, seems to be ok:

2012-08-07 15:18:58 INFO nova.api.openstack.wsgi
[req-c8bf2011-933b-4d6a-b28c-48063252fbf1 359076e3189b4658a4dd1b83d6313cc9
5172f50226f647ebb03ca4e4e82d056d] POST
http://172.17.1.2:8774/v2/5172f50226f647ebb03ca4e4e82d056d/servers/4e1c4652-199c-4160-9a73-2eddcf4cd21f/action
2012-08-07 15:18:59 INFO nova.api.openstack.wsgi
[req-c8bf2011-933b-4d6a-b28c-48063252fbf1 359076e3189b4658a4dd1b83d6313cc9
5172f50226f647ebb03ca4e4e82d056d]
http://172.17.1.2:8774/v2/5172f50226f647ebb03ca4e4e82d056d/servers/4e1c4652-199c-4160-9a73-2eddcf4cd21f/actionreturned
with HTTP 200

Did I miss something?

Last question, is there a way to update the metadata of a running instance.
I mean instead of updating the db record... For example re-injecting a SSH
key?

Cheers!
Re: Can't update the metadata via nova cli [ In reply to ]
On Aug 9, 2012, at 1:56 PM, S├ębastien Han <han.sebastien@gmail.com> wrote:

>
> Did I miss something?

Unfortunately this is confusing because the term metadata is used for two different things.

the metadata visible to the instance is a replication of the aws metadata server. it is constructed from the database (mostly the instances table)

The metadata you were setting with your command are sets of keys and values that are visible in the compute api:

http://docs.openstack.org/trunk/openstack-compute/developer/openstack-compute-api-1.1/content/MetadataSection.html

which is stored in the instance_metadata table

>
> Last question, is there a way to update the metadata of a running instance. I mean instead of updating the db record... For example re-injecting a SSH key?

no, there is currently no way of doing this through the api.

Vish
Re: Can't update the metadata via nova cli [ In reply to ]
Thank you very much for those clarifications :D


On Fri, Aug 10, 2012 at 12:31 AM, Vishvananda Ishaya
<vishvananda@gmail.com>wrote:

>
> On Aug 9, 2012, at 1:56 PM, S├ębastien Han <han.sebastien@gmail.com> wrote:
>
>
> Did I miss something?
>
>
> Unfortunately this is confusing because the term metadata is used for two
> different things.
>
> the metadata visible to the instance is a replication of the aws metadata
> server. it is constructed from the database (mostly the instances table)
>
> The metadata you were setting with your command are sets of keys and
> values that are visible in the compute api:
>
>
> http://docs.openstack.org/trunk/openstack-compute/developer/openstack-compute-api-1.1/content/MetadataSection.html
>
> which is stored in the instance_metadata table
>
>
> Last question, is there a way to update the metadata of a running
> instance. I mean instead of updating the db record... For example
> re-injecting a SSH key?
>
>
> no, there is currently no way of doing this through the api.
>
> Vish
>