Grid Dynamics Team

Improving novaclient CLI. Boot server with specific key.

Before now there was only one way to specify ssh-key when booting a new server: by passing path to the public key file in the local machine (if you don’t specify that path then taking public key file from the /home/.ssh/ directory occurs). That way you couldn’t use keypairs which you have created earlier by nova add-keypair command. But starting from now you can do it!

$ nova list – show available servers. Check the status of the newly created server and if it is BUILD (creating in progress) perform this command until the status becomes ACTIVE. After that you can connect to the server by ssh. Let’s say servers’s ip is 172.30.254.4 (You can find out ip from the same table as the status).

$ ssh -i private_key_file root@172.30.254.4 — it is done — you are in the created server’s shell.

What version of OpenStack does support “nova add-keypairs” command? I’m trying to use it with Diablo release, getting “‘add-keypairs’ is not a valid subcommand”. Also there’s no “–key-name” parameter for “boot” command in my version.

All our changes are accessible from the repositories mentioned above. But some command options described in this post were changed during pull request acceptance. We fixed command examples in the text. Thanks for pointing that. The command “nova add-keypairs” is named as “nova keypair-add” now.