Ask Your Question

Keystone API v3 and problem with "key_name" in body of POST request creating server

asked 2016-04-26 11:58:03 -0500

jasonwg gravatar image

Issue comes up in CLI request and Google REST Client. Presence of "key_name" in request causes request to fail with message "wrong value of key_name" , but value is correct. Removing "key_name" makes POST request working via CLI and REST Client. Not sure how to manage.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2016-04-26 14:21:02 -0500

dbaxps gravatar image

updated 2016-04-28 11:42:05 -0500

UPDATE 04/28/2016

  Having previously assigned admin role for user admin on project demo,
  I created ssh keypair sourcing keystonerc_admin. 
   Then creating server for tenant demo I submitted to Chrome REST Client Raw payload:-
   "key_name" : "oskey_created_by_admin_for_admin". Value was accepted. 
   Been logged as demo I saw server created with   "oskey_created_by_admin_for_admin"
   File  oskey_created_by_admin_for_admin.pem provides login to server(instance) been launched

In meantime as follows ( having same issue )

[boris@fedora23wks ~]$ ssh-keygen
[boris@fedora23wks ~]$ cd .ssh
[boris@fedora23wks .ssh]$ ls -l
total 12
-rw-------. 1 boris boris 1675 Apr 26 23:49 id_rsa
-rw-r--r--. 1 boris boris  399 Apr 26 23:49
-rw-r--r--. 1 boris boris 2280 Apr 27 01:03 known_hosts
[boris@fedora23wks .ssh]$ cat
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuoS/L0ESzNV0nKCsHDip0XjcWZ36dT0xyD75Lyb47Q77CL0v6UZCLbu1mwa4fD5NuxZl54EnE3jVO3GBsHQP7ALlsPMbDV/D+Q1n95ntno+4iq0r/8j20OMDTNcKvqVx8ITvTvw21O9PvG7kSoZmXgwXDRWxWrmHHn+ojruPvwvBf33ckGMyA+hjHyniDTl8F4SlIWoYRU+HsmEAOc3XacekC8j1arkWwc2QmoMCwd6+loY/A2vETLrjEKLGlJo9ZxNNoJ9NE/k9VMbze2CXKNOmcEjSv+NeJIDKbqKdAapf01Jwip4WiN0qGUUl9x8d0PAJ1+WdktTeCTfi3eAkr boris@fedora23wks

Then add one more #cloud-config script to image
[root@fedora23wks Downloads]# guestfish --rw -a xenial-server-cloudimg-amd64-disk1.img

    Welcome to guestfish, the guest filesystem shell for
    editing virtual machine filesystems and disk images.

    Type: 'help' for help on commands
          'man' to read the manual
          'quit' to quit the shell

><fs> run
     100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ --:--
><fs> mount /dev/sda1 /
><fs> ls  /etc/cloud/cloud.cfg.d
><fs> cp  /etc/cloud/cloud.cfg.d/05_logging.cfg  /etc/cloud/cloud.cfg.d/91_logging.cfg
><fs> edit  /etc/cloud/cloud.cfg.d/91_logging.cfg
><fs> cat  /etc/cloud/cloud.cfg.d/91_logging.cfg
  - name: ubuntu
    groups: sudo
    shell: /bin/bash
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuoS/L0ESzNV0nKCsHDip0XjcWZ36dT0xyD75Lyb47Q77CL0v6UZCLbu1mwa4fD5NuxZl54EnE3jVO3GBsHQP7ALlsPMbDV/D+Q1n95ntno+4iq0r/8j20OMDTNcKvqVx8ITvTvw21O9PvG7kSoZmXgwXDRWxWrmHHn+ojruPvwvBf33ckGMyA+hjHyniDTl8F4SlIWoYRU+HsmEAOc3XacekC8j1arkWwc2QmoMCwd6+loY/A2vETLrjEKLGlJo9ZxNNoJ9NE/k9VMbze2CXKNOmcEjSv+NeJIDKbqKdAapf01Jwip4WiN0qGUUl9x8d0PAJ1+WdktTeCTfi3eAkr boris@fedora23wks
edit flag offensive delete link more


Got it. It's not just sample , it's solution - to add user's generated keys to ~ubuntu/.ssh/authorized-keys on server.

jasonwg gravatar imagejasonwg ( 2016-04-27 09:44:43 -0500 )edit

answered 2016-04-26 13:26:11 -0500

soumitrakarmakar gravatar image

try key_pair

edit flag offensive delete link more


Seems to work in Client. However, no appearance in horizon and no help to login to Server via *.pem file. Still asking password.

jasonwg gravatar imagejasonwg ( 2016-04-26 14:14:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2016-04-26 11:58:03 -0500

Seen: 212 times

Last updated: Apr 28 '16