Ask Your Question
0

Is there a way to get the tenant/project from inside a spawned instance

asked 2014-09-01 04:21:20 -0500

Remko Duppen gravatar image

We're looking into a way to automatically register new spawned instances in DNS (with designate or some dnsmasq hack)

The idea is to have a subdomain per tenant/project and use the designate api to manage these during the first boot with cloud-init. To do that I would need the project id in the metadata or some way to retrieve the tenant id based on the instance id. But the compute rest API is tenant based which get's me into a catch 22

We're running icehouse

edit retag flag offensive close merge delete

Comments

Ok, this is a dirty hack, but I temporarily fixed this by adding python metadata['project_id' ] = self.instance['project_id'] in nova/api/metadata/base.py InstanceMetadata::_metadata_as_json() Is there a rational why not to add this info to the metadata ?

Remko Duppen gravatar imageRemko Duppen ( 2014-09-01 06:53:23 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-09-01 11:40:54 -0500

grahamhayes gravatar image

You could try adding it manually to the metadata of the instance after it boots

http://docs.openstack.org/user-guide/...

edit flag offensive delete link more

Comments

yeah, but that would entail an extra manual step if I use the horizon dashboard, or scripting the instance creating using the rest api with an homemade frontend. I already thought about using user data for this info, but that has the same drawbacks imho

Remko Duppen gravatar imageRemko Duppen ( 2014-09-01 16:56:11 -0500 )edit

Your Answer

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

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-09-01 04:21:20 -0500

Seen: 708 times

Last updated: Sep 01 '14