Ask Your Question
2

How can I extend nova metadata to alter the user data after VM's boot?

asked 2013-10-09 15:33:34 -0500

B.Callanan gravatar image

updated 2013-10-11 17:50:18 -0500

smaffulli gravatar image

If I run nova --debug meta <vm_instance> set cat=dog I can see that the API will add the metadata into the cache for that instance.</vm_instance>

If I run nova boot and I specify "--user-data" and add a script/mime-type/any_of_the_supported cloud init types...etc The data injected here is only at boot time. Personalities (5 files) can also be loaded as well...

This is all great... However, I'd like to inject different stuff into the VM through the lifetime of the VM "without" using a floating IP to get to the VM. Nor do I have the ability to ssh to the VM (certainly not as root).

I want to modify the metadata/user_data to inject other stuff during the lifetime of the VM. If I can inject new key-value pairs I should be able to change more stuff. (Note: we are using the full openstack API and are very comfortable with passing any type of JSON to and from the API.

On the VM, I'm using Curl to see the contents of the metadata on a per instance basis. On the compute-node that is also running the metadata process I try to query the metadata port (ie curl http://10.2.2.22:8775/ ) what can I use are the request to get access to the each different vm instance metadata spaces/caches. is it possible?

Can I post anything else to the metadata server in this way?

Aside from writing a new agent to sit along side the metadata server I have not other options with what is provided by openstack to get data to or from the vms.

edit retag flag offensive close merge delete

Comments

What would be equally great is have the VM instance be able to post into the metadata. For instance, it could post whether the VM was healthy or not. The options are limitless...

B.Callanan ( 2013-10-09 16:19:32 -0500 )edit

Remember that you can edit your question instead of adding a comment.

smaffulli ( 2013-10-11 17:48:35 -0500 )edit

I have same question about this argument. I have an instance ad i want to inject a custom user-data to it. It's possible ?

salvorapi ( 2014-03-27 03:52:27 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-11-20 12:10:49 -0500

B.Callanan gravatar image

You can adjust the meta data at any time and a curl back to the metadata will show that. The VM must have access back to the metadata server for that to work (ie 169.254.169.254). I don't see a nova command for issuing a modification to the user data. Also note that Cloud-init only runs the user data on first boot. If you want to have the vm run user data you must alter the rc configuration to make that happen. Feel free to ask questions.

User data (custom data of any kind) can be issued at boot time. But not in an update as far as I can see.


[root@wma-cloud-06 ~]# nova help meta usage: nova meta <server> <action> <key=value> [<key=value> ...]

Set or Delete metadata on a server. Positional arguments: <server> Name or ID of server <action> Actions: 'set' or 'delete' <key=value> Metadata to set or delete (only key is necessary on delete)

edit flag offensive delete link more

Comments

Only way I've found to change user-data has been through the DB. I detailed how to do it in mysql for grizzly / havana @ http://www.asmatteringofit.com/blog/2015/4/18/updating-user-data-for-existing-openstack-vms (http://www.asmatteringofit.com/blog/2...)

joshuamiller01 ( 2015-04-18 20:07:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Get to know Ask OpenStack

Resources for moderators

Question Tools

Follow
1 follower

Stats

Asked: 2013-10-09 15:33:34 -0500

Seen: 911 times

Last updated: Nov 20 '14