Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compute|aws] Tags not saved when creating a server #366

Closed
dbackeus opened this issue Jun 21, 2011 · 2 comments
Closed

[compute|aws] Tags not saved when creating a server #366

dbackeus opened this issue Jun 21, 2011 · 2 comments

Comments

@dbackeus
Copy link

Creating an EC2 server through Compute with tags provided does not persist the tags on the amazon instance.

compute = Fog::Compute.new :provider => 'AWS' # etc...
server = compute.servers.create :tags => {"Name" => "Awesome", "environment" => "staging"}
server.tags # => {"Name" => "Awesome", "environment" => "staging"}
server.wait_for { ready? }
server.reload.tags # => {}
@geemus
Copy link
Member

geemus commented Jun 21, 2011

It is true that this doesn't work (and probably should). In the mean time you can use tags if you separate them out. You can create tags such as the ones you mention by first creating the server and then doing something like:

compute.tags.create(:resource_id => server.identity, :key => 'Name', :value => 'Awesome')
compute.tags.create(:resource_id => server.identity, :key => 'environment', :value => 'staging')

After that, server.reload.tags should do as you expect. I'm leaving this issue open until I can look at adding the behavior you mentioned, but this should provide a workaround (and it isn't my highest priority to support the other way, as it is likely to be tricky/error prone and I'm trying to finish up a release at the moment).

Let me know if that workaround doesn't work for you and I'll try to clarify and/or fix it up.

Thanks!
wes

@dbackeus
Copy link
Author

Thanks a lot for the compute.tags examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants