Discussion:
AWS spot instance bad object
Sylvain Kalache
2013-10-23 23:18:38 UTC
Permalink
Hello!

I'm back with a AWS spot instance issue. That time I can launch a spot
instance, but it seems the object is not well constructed as I can't do
anything with the returned server object. I've done a lot of digging, here
is are my finding so far.

Some context: in lib/fog/compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb> in
the method private_key_path, I that Fog.credentials[:private_key_path] is
everytime returning nil but somehow but @private_key_path already has the
path to the private key he spot bootstrap.

However, once the instance is launched, if I want to interact in my code
with the server object that is being returned, for example, using the sshmethod. I get an ArgumentError
:key_data, :keys, :password or a loaded ssh-agent is required to initialize
SSH raised exception because private_key_path is not defined in
lib/fog/compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>
so :key_data is not defined either in lib/fog/core/ssh.rb<https://github.com/fog/fog/blob/master/lib/fog/core/ssh.rb>
.

May be you guys will are more context and you'll have an idea of where is
might failed, anyway I'll keep digging it.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an 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-10-25 13:22:11 UTC
Permalink
Could you set the private_key_path in credentials? I think that might help,
or explicitly setting it on server creation.


On Wed, Oct 23, 2013 at 6:18 PM, Sylvain Kalache
Post by Sylvain Kalache
Hello!
I'm back with a AWS spot instance issue. That time I can launch a spot
instance, but it seems the object is not well constructed as I can't do
anything with the returned server object. I've done a lot of digging, here
is are my finding so far.
Some context: in lib/fog/compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb> in
the method private_key_path, I that Fog.credentials[:private_key_path] is
the path to the private key he spot bootstrap.
However, once the instance is launched, if I want to interact in my code
with the server object that is being returned, for example, using the sshmethod. I get an ArgumentError
:key_data, :keys, :password or a loaded ssh-agent is required to initialize
SSH raised exception because private_key_path is not defined in
lib/fog/compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>
so :key_data is not defined either in lib/fog/core/ssh.rb<https://github.com/fog/fog/blob/master/lib/fog/core/ssh.rb>
.
May be you guys will are more context and you'll have an idea of where is
might failed, anyway I'll keep digging it.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
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 and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Sylvain Kalache
2013-10-28 22:11:37 UTC
Permalink
Hello geemus,

Thanks for your answer.

I already had the private_key_path in the credentials and in the server
creation but it did not helped.
The only way I succeeded to make it works is by hard coding it into
compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>,
commenting line 14-15. I'll try to dig more.

Also I found that aws/models/compute/server.rb<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb>line 68 would over ride the username I set, I had to add a || to make it
works. I looks like a bug, I can send a code request for that.
Post by geemus (Wesley Beary)
Could you set the private_key_path in credentials? I think that might
help, or explicitly setting it on server creation.
Post by Sylvain Kalache
Hello!
I'm back with a AWS spot instance issue. That time I can launch a spot
instance, but it seems the object is not well constructed as I can't do
anything with the returned server object. I've done a lot of digging, here
is are my finding so far.
Some context: in lib/fog/compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb> in
the method private_key_path, I that Fog.credentials[:private_key_path] is
the path to the private key he spot bootstrap.
However, once the instance is launched, if I want to interact in my code
with the server object that is being returned, for example, using the sshmethod. I get an ArgumentError
:key_data, :keys, :password or a loaded ssh-agent is required to initialize
SSH raised exception because private_key_path is not defined in
lib/fog/compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>
so :key_data is not defined either in lib/fog/core/ssh.rb<https://github.com/fog/fog/blob/master/lib/fog/core/ssh.rb>
.
May be you guys will are more context and you'll have an idea of where is
might failed, anyway I'll keep digging it.
--
You received this message because you are subscribed to the Google Groups
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
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 and stop receiving emails from it, send an 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-10-28 22:43:56 UTC
Permalink
Sounds good, definitely appreciate any and all help with bugs.


On Mon, Oct 28, 2013 at 5:11 PM, Sylvain Kalache
Post by Sylvain Kalache
Hello geemus,
Thanks for your answer.
I already had the private_key_path in the credentials and in the server
creation but it did not helped.
The only way I succeeded to make it works is by hard coding it into
compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>,
commenting line 14-15. I'll try to dig more.
Also I found that aws/models/compute/server.rb<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb>line 68 would over ride the username I set, I had to add a || to make it
works. I looks like a bug, I can send a code request for that.
Post by geemus (Wesley Beary)
Could you set the private_key_path in credentials? I think that might
help, or explicitly setting it on server creation.
Post by Sylvain Kalache
Hello!
I'm back with a AWS spot instance issue. That time I can launch a spot
instance, but it seems the object is not well constructed as I can't do
anything with the returned server object. I've done a lot of digging, here
is are my finding so far.
Some context: in lib/fog/compute/models/**server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb> in
the method private_key_path, I that Fog.credentials[:private_key_**path]
has the path to the private key he spot bootstrap.
However, once the instance is launched, if I want to interact in my code
with the server object that is being returned, for example, using the
ssh method. I get an ArgumentError :key_data, :keys, :password or a
loaded ssh-agent is required to initialize SSH raised exception because
private_key_path is not defined in lib/fog/compute/models/**server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>
so :key_data is not defined either in lib/fog/core/ssh.rb<https://github.com/fog/fog/blob/master/lib/fog/core/ssh.rb>
.
May be you guys will are more context and you'll have an idea of where
is might failed, anyway I'll keep digging it.
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/**groups/opt_out<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 and stop receiving emails from it, send an
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 and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Sylvain Kalache
2013-10-30 21:43:06 UTC
Permalink
Just a follow up if someone encounter the same issues.

I unfortunately haven't found yet where is the bug for the private_key_path
issue. The trick that I use in my code is that once my spot request is
fulfilled and that I get back a server object, I re-inject the
private_key_path path.

For the second issue with the username being overridden, I sent a pull
request that has already been accepted<https://github.com/fog/fog/pull/2334>by the Fog crew.
Post by geemus (Wesley Beary)
Sounds good, definitely appreciate any and all help with bugs.
Post by Sylvain Kalache
Hello geemus,
Thanks for your answer.
I already had the private_key_path in the credentials and in the server
creation but it did not helped.
The only way I succeeded to make it works is by hard coding it into
compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>,
commenting line 14-15. I'll try to dig more.
Also I found that aws/models/compute/server.rb<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb>line 68 would over ride the username I set, I had to add a || to make it
works. I looks like a bug, I can send a code request for that.
Post by geemus (Wesley Beary)
Could you set the private_key_path in credentials? I think that might
help, or explicitly setting it on server creation.
Post by Sylvain Kalache
Hello!
I'm back with a AWS spot instance issue. That time I can launch a spot
instance, but it seems the object is not well constructed as I can't do
anything with the returned server object. I've done a lot of digging, here
is are my finding so far.
Some context: in lib/fog/compute/models/**server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb> in
the method private_key_path, I that Fog.credentials[:private_key_**path]
has the path to the private key he spot bootstrap.
However, once the instance is launched, if I want to interact in my
code with the server object that is being returned, for example, using
the ssh method. I get an ArgumentError :key_data, :keys, :password or
a loaded ssh-agent is required to initialize SSH raised exception
because private_key_path is not defined in lib/fog/compute/models/**
server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>
so :key_data is not defined either in lib/fog/core/ssh.rb<https://github.com/fog/fog/blob/master/lib/fog/core/ssh.rb>
.
May be you guys will are more context and you'll have an idea of where
is might failed, anyway I'll keep digging it.
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/**groups/opt_out<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 and stop receiving emails from it, send an
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 and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Sylvain Kalache
2013-10-30 21:43:50 UTC
Permalink
Just a follow up if someone encounter the same issues.

I unfortunately haven't found yet where is the bug for the private_key_path
issue. The trick that I use in my code is that once my spot request is
fulfilled and that I get back a server object, I re-inject the
private_key_path path.

For the second issue with the username being overridden, I sent a pull
request that has already been accepted<https://github.com/fog/fog/pull/2334> by
the Fog crew.
Post by geemus (Wesley Beary)
Sounds good, definitely appreciate any and all help with bugs.
Post by Sylvain Kalache
Hello geemus,
Thanks for your answer.
I already had the private_key_path in the credentials and in the server
creation but it did not helped.
The only way I succeeded to make it works is by hard coding it into
compute/models/server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>,
commenting line 14-15. I'll try to dig more.
Also I found that aws/models/compute/server.rb<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb>line 68 would over ride the username I set, I had to add a || to make it
works. I looks like a bug, I can send a code request for that.
Post by geemus (Wesley Beary)
Could you set the private_key_path in credentials? I think that might
help, or explicitly setting it on server creation.
Post by Sylvain Kalache
Hello!
I'm back with a AWS spot instance issue. That time I can launch a spot
instance, but it seems the object is not well constructed as I can't do
anything with the returned server object. I've done a lot of digging, here
is are my finding so far.
Some context: in lib/fog/compute/models/**server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb> in
the method private_key_path, I that Fog.credentials[:private_key_**path]
has the path to the private key he spot bootstrap.
However, once the instance is launched, if I want to interact in my
code with the server object that is being returned, for example, using
the ssh method. I get an ArgumentError :key_data, :keys, :password or
a loaded ssh-agent is required to initialize SSH raised exception
because private_key_path is not defined in lib/fog/compute/models/**
server.rb<https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb>
so :key_data is not defined either in lib/fog/core/ssh.rb<https://github.com/fog/fog/blob/master/lib/fog/core/ssh.rb>
.
May be you guys will are more context and you'll have an idea of where
is might failed, anyway I'll keep digging it.
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/**groups/opt_out<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 and stop receiving emails from it, send an
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 and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...