It is key_name! No recognized column names in ['keypair']. Recognized columns are ('OS-DCF:diskConfig', 'OS-EXT-AZ:availability_zone', 'OS-EXT-SRV-ATTR:host', 'OS-EXT-SRV-ATTR:hypervisor_hostname', 'OS-EXT-SRV-ATTR:instance_name', 'OS-EXT-STS:power_state', 'OS-EXT-STS:task_state', 'OS-EXT-STS:vm_state', 'OS-SRV-USG:launched_at', 'OS-SRV-USG:terminated_at', 'accessIPv4', 'accessIPv6', 'addresses', 'config_drive', 'created', 'flavor', 'hostId', 'id', 'image', 'key_name', 'name', 'progress', 'project_id', 'properties', 'security_groups', 'status', 'updated', 'user_id', 'volumes_attached'). On Thu, May 27, 2021 at 3:07 PM Mauricio Tavares <raubvogel@gmail.com> wrote:
Funny you mentioned [1]; that is what I have been trying to use and could not find an option to get the name of the keypair.
On Thu, May 27, 2021 at 1:44 PM melanie witt <melwittt@gmail.com> wrote:
On 5/27/21 07:44, Mauricio Tavares wrote:
Is there a way to query openstack about which ssh pubkey was used with a given server?
Yes, you show the details for the server (openstack server show) [1][2] to get the name of the keypair and then you show the details for the keypair (openstack keypair show) [3][4]. By default, you have to be admin to show the details of keypairs.
HTH, -melanie
[1] https://docs.openstack.org/python-openstackclient/latest/cli/command-objects... [2] https://docs.openstack.org/api-ref/compute/?expanded=show-server-details-det... [3] https://docs.openstack.org/python-openstackclient/latest/cli/command-objects... [4] https://docs.openstack.org/api-ref/compute/?expanded=show-keypair-details-de...