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

Unable to add ssh-key when provisioning a new instance #362

Closed
EUGinsane opened this issue Jun 21, 2018 · 4 comments
Closed

Unable to add ssh-key when provisioning a new instance #362

EUGinsane opened this issue Jun 21, 2018 · 4 comments
Labels

Comments

@EUGinsane
Copy link

Hi all,
When new instance with:

 server = connection.servers.create(
    :name => "fog-smoke-test-#{Time.now.to_i}",
    :disks => [disk],
    :machine_type => "n1-standard-1",
    :private_key_path => File.expand_path("~/.ssh/id_rsa"),
    :public_key_path => File.expand_path("~/.ssh/id_rsa.pub"),
    :zone => "us-central1-f",
    :username => ENV["USER"],
    :tags => ["fog"],
    :service_accounts => { :scopes => %w(sql-admin bigquery https://www.googleapis.com/auth/compute) }
  )

I generated SSH key and new instance is suscess but I dont see any ssh key for VM instance. Please help me recheck.

Uploading ssh_key.PNG…
Thanks

@Temikus
Copy link
Member

Temikus commented Jun 22, 2018

@EUGinsane Thank you for filing this!!! I found a regression, will fix it soon.
Until then you can workaround by doing this after create:

server.add_ssh_key(ENV["USER"], File.expand_path("~/.ssh/id_rsa.pub"))

Apologies for the hassle m(_ _)m

@Temikus
Copy link
Member

Temikus commented Jun 23, 2018

Fix has been pushed, this will be released with 1.6.0

@Temikus Temikus added the bug label Jun 23, 2018
@EUGinsane
Copy link
Author

Thanks @Temikus ,
I want to ask one question. When I created Windows instance, how to connection to this vm ?

@Temikus
Copy link
Member

Temikus commented Jun 26, 2018

@EUGinsane This isn't implemented directly in fog, I'm afraid.
There are 2 ways to connect - PowerShell and RDP[1]

If you go RDP route you can add an exec() in your script/app that will call the rdp client of choice.
Concerning powershell, I'm not sure.

[1] https://cloud.google.com/compute/docs/instances/connecting-to-instance

@icco icco closed this as completed Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants