1

I need help! I am trying to create sshKeys(protocol pub_key username) for gce instance using libcloud API create_node with parameter ex_metadata while creating an instance. But username value is not getting saved when I check in google cloud console after the creation of instance.

Is there any different format to send sshKeys for metadata? I am sending data like this,

metadata = {"items": [{"value": value, "key": "sshKeys"}]}
Alex
  • 781
  • 10
  • 23
hebbar10
  • 13
  • 2

1 Answers1

2

I'm not familiar with libcloud, however if you were using the gcloud compute instances create and you want to pass SSH keys with the flag --metadata KEY=VALUE, you need to do it as

-–metadata “sshKeys=username:ssh-rsaAAAAADAQABA.....".

So it might be something like:

metadata = {"items": [{"value": username:ssh-rsaAAAAADAQABA....., "key": "sshKeys"}]}
Marilu
  • 963
  • 6
  • 7