@@ -6,14 +6,20 @@ Configure SSH between compute nodes
6
6
7
7
.. todo ::
8
8
9
- Consider merging this into a larger "live- migration" document or to the
9
+ Consider merging this into a larger "migration" document or to the
10
10
installation guide
11
11
12
12
If you are resizing or migrating an instance between hypervisors, you might
13
13
encounter an SSH (Permission denied) error. Ensure that each node is configured
14
14
with SSH key authentication so that the Compute service can use SSH to move
15
15
disks to other nodes.
16
16
17
+ .. note ::
18
+
19
+ It is not necessary that all the compute nodes share the same key pair.
20
+ However for the ease of the configuration, this document only utilizes a
21
+ single key pair for communication between compute nodes.
22
+
17
23
To share a key pair between compute nodes, complete the following steps:
18
24
19
25
#. On the first node, obtain a key pair (public key and private key). Use the
@@ -28,44 +34,36 @@ To share a key pair between compute nodes, complete the following steps:
28
34
29
35
# usermod -s /bin/bash nova
30
36
31
- Switch to the nova account.
37
+ Ensure you can switch to the nova account:
32
38
33
39
.. code-block :: console
34
40
35
- # su nova
41
+ # su - nova
36
42
37
43
#. As root, create the folder that is needed by SSH and place the private key
38
- that you obtained in step 1 into this folder:
44
+ that you obtained in step 1 into this folder, and add the pub key to the
45
+ authorized_keys file:
39
46
40
47
.. code-block :: console
41
48
42
49
mkdir -p /var/lib/nova/.ssh
43
50
cp <private key> /var/lib/nova/.ssh/id_rsa
44
51
echo 'StrictHostKeyChecking no' >> /var/lib/nova/.ssh/config
45
52
chmod 600 /var/lib/nova/.ssh/id_rsa /var/lib/nova/.ssh/authorized_keys
53
+ echo <pub key> >> /var/lib/nova/.ssh/authorized_keys
46
54
47
- #. Repeat steps 2-4 on each node.
48
-
49
- .. note ::
50
-
51
- The nodes must share the same key pair, so do not generate a new key pair
52
- for any subsequent nodes.
53
-
54
- #. From the first node, where you created the SSH key, run:
55
+ #. Copy the whole folder created in step 4 to the rest of the nodes:
55
56
56
57
.. code-block :: console
57
58
58
- ssh-copy-id -i <pub key> nova@remote-host
59
-
60
- This command installs your public key in a remote machine's
61
- ``authorized_keys `` folder.
59
+ # scp -r /var/lib/nova/.ssh remote-host:/var/lib/nova/
62
60
63
61
#. Ensure that the nova user can now log in to each node without using a
64
62
password:
65
63
66
64
.. code-block :: console
67
65
68
- # su nova
66
+ # su - nova
69
67
$ ssh *computeNodeAddress*
70
68
$ exit
71
69
0 commit comments