[nova-api] Inject public key without create key pair in nova ?

smooney at redhat.com smooney at redhat.com
Mon Aug 21 11:59:37 UTC 2023


On Mon, 2023-08-21 at 10:11 +0000, Pureewat Kaewpoi wrote:
> Hi OpenStack Community
> 
> We have some requirements that need to create instance via API. However nova-api is accept only key_name of key pair
> created earlier.
> Can we create instance by passing only public key data without creating a key pair in nova ?
you have 2 options.
either you can upload only the public key to nova api,
it does not need to create the private and public key you can just import an existing public key.
Your second option is to not use the api to inject the public key and instead use user_data.
Effectively you could embed the public key in the cloud-init userdata and install it your self via user_data
and cloud init.
> 
> Thank you.




More information about the openstack-discuss mailing list