abhilekhsingh / gc3pie

Automatically exported from code.google.com/p/gc3pie
0 stars 0 forks source link

adding the openssh ProxyCommand parameter to the shellcmd backend #477

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In our cloud setup we are using the openssh ProxyCommand feature when ssh to 
VMs, so, connections are not direct but through the head of the cloud. Paramiko 
supports this feature but it is not implemented in the gc3pie in the shellcmd 
backend. Here is my simple implementation (attached file 
sshProxyCommand.patch). It doesn't affect any existing logic and makes it 
possible to specify a gateway for the ProxyCommand through the gc3pie.conf file 
as a parameter for a resource, e.g., ssh_gateway = 
trampoline@clusterinfo.unineuchatel.ch 

I am using the development branch, revision 4123.

Original issue reported on code.google.com by Karanda...@gmail.com on 2 Feb 2015 at 2:27

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report and the patch.  As you say, it's simple and does
not break any existing functionality, so I'm OK with applying it.

I have a question, though: your patch hard-codes `ssh -W $frontend
$gateway` as a proxy command.  Would it be better to just allow an
arbitrary `ProxyCommand` to be specified? (I can take care of the
additional coding.)

Original comment by riccardo.murri@gmail.com on 9 Feb 2015 at 1:22

GoogleCodeExporter commented 9 years ago

Original comment by riccardo.murri@gmail.com on 9 Feb 2015 at 1:23

GoogleCodeExporter commented 9 years ago
I have added code to read the `ProxyCommand` setting from `~/.ssh/config` and 
use that.

Could you please try out the latest "trunk" code (SVN r4150) and tell me if it 
fixes this issue?

Original comment by riccardo.murri@gmail.com on 10 Feb 2015 at 3:03

GoogleCodeExporter commented 9 years ago
It doesn't work yet and I think I found another related issue. 

As I understand, an SshTransport object is created for each available resource. 
In case we spawn a VM it happens right after the gc3pie sends a request to the 
EC2 but by that time there is no ip address associated with the VM yet, so, the 
remote_frontend parameter in the __init__ method of the SshTransport class is 
empty. I don't know how it works normally, but in my case, because of that it 
is impossible to have a correct parsing of the "~/.ssh/config" file; hence, we 
have an empty ssh_options dictionary; hence, we have the proxy_command variable 
with None value. 
Later, when it calls the connect method, there is no proxycommand available for 
the object, so, it doesn't work.

Original comment by Karanda...@gmail.com on 12 Mar 2015 at 10:44