Discussion:
retrieving AWS EC2 user-data via fog
bsmith
2012-11-15 18:17:40 UTC
Permalink
I feel like I must be missing something obvious, but searching the group
history, the documentation, and the web is failing me...

I'm trying to retrieve a server's user-data using fog, but no matter what I
instance = connection.servers.pop
<Fog::Compute::AWS::Server
id="i-5e68b221",
[deleted]
user_data=nil,
vpc_id=nil
user_data = instance.user_data
nil
user_data = instance.reload.user_data
nil
user_data = connection.servers.get('i-5e68b221').user_data
nil
user_data = connection.servers.get('i-5e68b221').reload.user_data
nil


Is there a more correct way to retrieve user-data?

Thanks,
-Brian
geemus (Wesley Beary)
2012-11-15 18:25:28 UTC
Permalink
I believe user data is write-once read-never. ie once you set it you can
never get it back from the api.

I think you might be able to ssh to the box and interrogate things, but the
API isn't helpful here.

wes
Post by bsmith
I feel like I must be missing something obvious, but searching the group
history, the documentation, and the web is failing me...
I'm trying to retrieve a server's user-data using fog, but no matter what
instance = connection.servers.pop
<Fog::Compute::AWS::Server
id="i-5e68b221",
[deleted]
user_data=nil,
vpc_id=nil
user_data = instance.user_data
nil
user_data = instance.reload.user_data
nil
user_data = connection.servers.get('i-5e68b221').user_data
nil
user_data = connection.servers.get('i-5e68b221').reload.user_data
nil
Is there a more correct way to retrieve user-data?
Thanks,
-Brian
JayP
2012-11-15 23:39:28 UTC
Permalink
bsmith, how are you deploying? If you deploy via AutoScaleGroups you can
fetch the launch configuration which contains the user data that was used.
Post by geemus (Wesley Beary)
I believe user data is write-once read-never. ie once you set it you can
never get it back from the api.
I think you might be able to ssh to the box and interrogate things, but
the API isn't helpful here.
wes
Post by bsmith
I feel like I must be missing something obvious, but searching the group
history, the documentation, and the web is failing me...
I'm trying to retrieve a server's user-data using fog, but no matter what
instance = connection.servers.pop
<Fog::Compute::AWS::Server
id="i-5e68b221",
[deleted]
user_data=nil,
vpc_id=nil
user_data = instance.user_data
nil
user_data = instance.reload.user_data
nil
user_data = connection.servers.get('i-5e68b221').user_data
nil
user_data = connection.servers.get('i-5e68b221').reload.user_data
nil
Is there a more correct way to retrieve user-data?
Thanks,
-Brian
p***@public.gmane.org
2013-01-28 18:19:38 UTC
Permalink
Found this thread looking to do the same thing. The AWS API does support
both getting and setting the user data after an instance is created. It is
not however passed back on a DescribeInstances API call. You have to use
DescribeInstanceAttribute to get it
(http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstanceAttribute.html).
But it appears that Fog does not support the DescribeInstanceAttribute API
call.
You can set user data with the UpdateInstanceAttribute call, and it appears
Fog does support that, but I haven't actually tried it.

-Patrick
Post by geemus (Wesley Beary)
I believe user data is write-once read-never. ie once you set it you can
never get it back from the api.
I think you might be able to ssh to the box and interrogate things, but
the API isn't helpful here.
wes
Post by bsmith
I feel like I must be missing something obvious, but searching the group
history, the documentation, and the web is failing me...
I'm trying to retrieve a server's user-data using fog, but no matter what
instance = connection.servers.pop
<Fog::Compute::AWS::Server
id="i-5e68b221",
[deleted]
user_data=nil,
vpc_id=nil
user_data = instance.user_data
nil
user_data = instance.reload.user_data
nil
user_data = connection.servers.get('i-5e68b221').user_data
nil
user_data = connection.servers.get('i-5e68b221').reload.user_data
nil
Is there a more correct way to retrieve user-data?
Thanks,
-Brian
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group, send email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-01-28 18:22:19 UTC
Permalink
Shouldn't be any reason we couldn't add DescribeInstanceAttribute, it
didn't used to exist so probably just nobody has needed it enough
previously to get it added to fog. Definitely happy to help out if somebody
wants to take a stab at it.
Thanks!
wes
Post by p***@public.gmane.org
Found this thread looking to do the same thing. The AWS API does support
both getting and setting the user data after an instance is created. It is
not however passed back on a DescribeInstances API call. You have to use
DescribeInstanceAttribute to get it (
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstanceAttribute.html).
But it appears that Fog does not support the DescribeInstanceAttribute API
call.
You can set user data with the UpdateInstanceAttribute call, and it
appears Fog does support that, but I haven't actually tried it.
-Patrick
Post by geemus (Wesley Beary)
I believe user data is write-once read-never. ie once you set it you can
never get it back from the api.
I think you might be able to ssh to the box and interrogate things, but
the API isn't helpful here.
wes
Post by bsmith
I feel like I must be missing something obvious, but searching the group
history, the documentation, and the web is failing me...
I'm trying to retrieve a server's user-data using fog, but no matter
instance = connection.servers.pop
<Fog::Compute::AWS::Server
id="i-5e68b221",
[deleted]
user_data=nil,
vpc_id=nil
user_data = instance.user_data
nil
user_data = instance.reload.user_data
nil
user_data = connection.servers.get('i-**5e68b221').user_data
nil
user_data = connection.servers.get('i-**5e68b221').reload.user_data
nil
Is there a more correct way to retrieve user-data?
Thanks,
-Brian
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group, send email to
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group, send email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...