Hi, I'm interested in recent launch of Pulumi comm...
# getting-started
b
Hi, I'm interested in recent launch of Pulumi commands provider. However, I'm unable to understand few concepts on it from the Docs. Mainly on the purpose of create and delete and whether it is possible to execute custom commands like ls, cat etc. on the created resource (mostly the VM). Can someone help me out
m
Hi @broad-lifeguard-10744, these things are indeed possible. Does this example help you, mainly the
remote
and
local
commands from line 51?
b
@melodic-tomato-39005 Thanks for your reply. I was able to browse through the Internet and find some examples in Python (since I'm much familiar in that). However, I'm hitting with a SSH Handshake problem that I can't figure out how to solve.
vm_connection = command.remote.ConnectionArgs( host="x.x.x.x", user="saran", password="1Failure" ) command.remote.Command("check-cloud-init-setup", connection=vm_connection, create="until grep -q \"The system is finally up\" /var/log/cloud-init-output.log; do sleep 1;done" )
This is the sample remote commands setup I'm running in Python. I'm able to connect to this VM from my machine through CLI SSH, however the remote commands failing with the error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
I also copied my ssh public key inside the VM, but still no success
From whatever, I researched the remote commands should attempt to connect through publickey setup. But why does my attempted methods list only 'none' ?
BTW I'm using :
Copy code
pulumi : 3.6.8
Copy code
pulumi_command: 0.7.2
m
Did you configure your EC2 instance with the matching
keyName
and did you configure the Pulumi
connection
like in the example?
b
I'm sorry, I should have informed this. I'm trying to connect to a local Ubuntu VM created through pulumi libvirt in Python. The connection arguments are created with the
command.remote.ConnectionArgs
as I sent to you previously.
As I told, I have no problem SSH into that VM from my server CLI, and since I've moved by public key also to the authorized list in the VM, it's not asking for password when I SSH through CLI. However,
command.remote.Command
is failing with Handshake error
m
Pulumi won’t attempt to use the key because the connection is only configured to use a password (the one you pasted above). I’m not sure why the password wouldn’t work, though.
b
So, the attempted methods has only none because I haven't supplied the private key of my server in my connection.
Yes, that's even I thought when supplying the password. Is there any way to debug the Pulumi remote APIs to see what's happening
m
You could enable verbose logging as described here.
b
Thanks for troubleshooting guide @melodic-tomato-39005. PFA the pulumi up for the above remote command in -v=9 verbose.
m
These logs confirm that SSH auth is not even attempted but don’t say why. Would you mind opening an issue at https://github.com/pulumi/pulumi-command/issues?
b
@melodic-tomato-39005 Sorry for the delay in response. I've fixed the issue. The problem was with the default SSH configuration that comes with Ubuntu cloud image.
The config had
PasswordAuthentication
and
PubkeyAuthentication
as NO. This is why the Remote Command SSH was failing. Once I fixed this, it started working.