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 boot <server_name> --image <image_id> --flavor <flavor_id> [--key_path [<path_to_the_public_key>], --key_name <keypair_name>]
As you can see you are free to use both methods (old and new) and it is up to you what the way you go.
Here is a sample sequence of commands to work with the new feature:
$ nova keypair-add key1 > private_key_file — save returned private key to the file.
$ chmod 600 private_key_file — only owner shoud have access to the private key
$ nova boot <server_name> --image 3 --flavor 1 --key_name key1 — boot new server with specified image id, flavor id and also inject previously created private key by its name.
$ 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 email@example.com — it is done — you are in the created server’s shell.
You can see sources on
or binaries for RHEL
and for CentOS