cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

Creating VM: Key pair not found... #56

Closed pako-grape closed 8 years ago

pako-grape commented 8 years ago

I am trying to deploy bosh to CityCloud OpenStack. Stemcell was successfully uploaded, but there's an error when creating VM:

Command 'deploy' failed:
  Deploying:
    Creating instance 'bosh/0':
      Creating VM:
        Creating vm with stemcell cid 'b8d5b160-1f95-4dd9-9bb6-f5eedf958578':
          CPI 'create_vm' method responded with error: CmdError{"type":"Bosh::Clouds::CloudError","message":"Key-pair `grape' not found","ok_to_retry":false}

Part of bosh.yml file:

openstack: &openstack
      auth_url: https://identity1.citycloud.com:5000/v3/
      project: MY_PROJECT_NAME
      username: MY_USERNAME
      api_key: MY_PASSWORD
      default_key_name: grape
      default_security_groups: [open]
      domain: MY_DOMAIN_NAME
      region: Lon1

But this key exists and I can use it to connect to instances created from dashboard. Have anyone an idea what can be wrong here?

pako-grape commented 8 years ago

Problem was rather solved... I had to create key-pair using nova client instead of dashboard.

cppforlife commented 8 years ago

@voelzmo might be worth to include it in the openstack errors doc section. wdyt?

Sent from my iPhone

On Nov 18, 2015, at 3:38 AM, pawel2-grape notifications@github.com wrote:

Problem was rather solved... I had to create key-pair using nova client instead of dashboard.

— Reply to this email directly or view it on GitHub.

voelzmo commented 8 years ago

That's interesting, I've never that before. Especially, if creating VMs from the dashboard worked out for you with the key generated from the dashboard, @pawel2-grape.

Using a key generated from Horizon for deploying bosh works perfectly fine for me. If you don't mind, could you do a cross-check and try to nova boot an instance with a key generated from the dashboard? If that doesn't work, it seems like a problem with CityCloud rather than a generic problem. In theory, those two ways of creating a VM should be using the same API (as the OpenStack CPI as well), so either all or none of these ways should work.

pako-grape commented 8 years ago

Like can be expected:) In horizon I have created key-pair (I can launch an instance from horizon with this key). Launching nova boot:

ERROR (BadRequest): Invalid key_name provided. (HTTP 400)

So like @voelzmo said, there must be something wrong with CityCloud.

Thanks for your responses :)

stardust85 commented 7 years ago

Make sure that the same username was used for creating the key and creating the instance. The keypairs aren't shared between users.