Should instance creation fail if key-pair injection fails

Asked by Unmesh Gurjar

While launching an instance with a key-pair specified, even if the key-pair injection fails, the instance comes up active and running. The user comes to know of this (unless Compute logs are being monitored), only when he is unable to ssh into the instance using the specified key-pair.

What should be the behavior in such a scenario? Should instance creation fail?

Question information

English Edit question
OpenStack Compute (nova) Edit question
No assignee Edit question
Solved by:
Unmesh Gurjar
Last query:
Last reply:
Revision history for this message
Unmesh Gurjar (unmesh-gurjar) said :

The root password can be set for an instance using the change password API. However, that feature is not supported for KVM.
Therefore I think the instance creation should fail if key injection fails.

Revision history for this message
Tom Fifield (fifieldt) said :

Hi Umesh,

Does this comment from Vish Ishaya (Nova core developer) in the associated bug ( answer your question:

Keypair injection is for developer convenience. The guest can still set up keypairs via the metadata server via cloud_init. In general we lean towards not messing with guest instances, so it should be the responsibility of the guest to setup keypairs. In fact, keypair injection should be optional and I would expect most cloud providers to turn it off.

By the way, libvirt can try to inject passwords as well via the config option:





Revision history for this message
Unmesh Gurjar (unmesh-gurjar) said :

I agree that key injection should not be fatal.