Possible to change key_name on a already booted instance?

asked 2015-06-26 01:22:37 -0500

slmingol gravatar image

I inherited an OpenStack environment that included several already running VM's that I do not possess the SSH keys to get into. I'd like to change the key_name that's associated to these but haven't figured out if that's entirely possible or how to do it.

The output of nova show <vm UUID>shows an attribute called key_name, that's already set to another user's SSH key. Can I can change this to mine? I'm assuming I'd need to change the user_id as well that's associated with the instance, but again, wasn't sure how to do this. Looking at the commands associated to nova I did not see any that appeared to let me do this.

$ nova show 937f7b60-9cd7-48ff-9a33-4c22c6f0f2da | grep key_name
| key_name                             | user123_key                                  |
edit retag flag offensive close merge delete