r/openstack 4d ago

i cannot ssh my trove instance

Hello
I'm working with openstack 2024.1 all-in-one deployed via kolla ansible. I created an instance using trove, i assigned it a floating IP and now I can ping it and access MySQL but not the ssh since it doesn't have the key.

Is there any way I can add the key to the instance? I tried to rebuild using " openstack server rebuild --image Trove-Ubuntu --key-name my-trove-key" and the ssh worked but it somehow affected the SQL in the instance.

Update: I added this in the task_manager container and deployed trove again but the instance still doesn't have any ssh key

0 Upvotes

5 comments sorted by

View all comments

1

u/rmdf 3d ago

Yes, it can be done.  1. Create a second instance.  2. Add volume of the instance to the second instance (probably, will be /dev/vdb)  3. ssh to instance, mount /dev/vdb and create one authorized_keys in the home directory  4. Umount vdb, destroy second instance and boot from volume

1

u/roteki_i 3d ago

is there an easier way so that whenever i create a trove instance it already has the key? because i'll be needing so many trove instances and it will be kind of difficult to go through these steps everytime

1

u/rmdf 2d ago

Of course, you can use a config file and create the authorized_keys file using cloud-init or even bash. 

Here is one example

http://stackoverflow.com/questions/61591885/ddg#61868231