Commit 050e8cd
Simplify logic around udev rules
ParallelCluster uses udev to trigger a Python script upon EBS attachment. Specifically, when it detects an attach from a device (e.g. /dev/xvdb), ParallelCluster udev rule creates a symbolic link from `/dev/disk/by-ebs-volumeid` (e.g. `/dev/disk/by-ebs-volumeid/vol-123456`) to the device name (/dev/xvdb). Then, our cookbook checks the device under `/dev/disk/by-ebs-volumeid` is ready.
Prior to this commit, ParallelCluster udev script used boto3 calls to retrieve volume id from device name.
Seems starting from RHEL 9, the scripts triggered by udev no long have network access for security reasons. Therefore, this commit removes the boto3 calls and get the volume id from `/dev/disk/by-ebs-volumeid/parallelcluster_dev_id_mapping`, which is a file ParallelCluster cookbook writes to. Although the logic could be further simplified by not using the udev rule at all, this commit takes the first step of improvement without spending too much time to reach the absolute simplicity.
Moreover, prior to this commit, a service was created to trigger `udevadm trigger`. `udevadm trigger` is used to refresh udev system after udev rules changes. It is unnecessary to have a service trigger the command. Therefore, this commit deletes the service and triggers the command once after the rules changes.
Signed-off-by: Hanwen <[email protected]>1 parent d586522 commit 050e8cd
File tree
13 files changed
+28
-376
lines changed- cookbooks/aws-parallelcluster-environment
- files
- default/ec2_udev_rules
- ubuntu/ec2_udev_rules
- resources/ec2_udev_rules
- partial
- spec/unit/resources
- templates/ec2_udev_rules
- test/controls
- test/unit/ec2_udev_rules
13 files changed
+28
-376
lines changedLines changed: 8 additions & 84 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | 9 | | |
30 | 10 | | |
31 | 11 | | |
| |||
66 | 46 | | |
67 | 47 | | |
68 | 48 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 49 | | |
111 | 50 | | |
112 | 51 | | |
| |||
115 | 54 | | |
116 | 55 | | |
117 | 56 | | |
118 | | - | |
119 | 57 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
141 | 65 | | |
142 | 66 | | |
143 | 67 | | |
| |||
Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
136 | 148 | | |
137 | 149 | | |
138 | 150 | | |
| |||
Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | 26 | | |
29 | 27 | | |
Lines changed: 2 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 50 | | |
60 | 51 | | |
61 | 52 | | |
| |||
67 | 58 | | |
68 | 59 | | |
69 | 60 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 61 | + | |
| 62 | + | |
73 | 63 | | |
74 | 64 | | |
Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 0 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 49 | | |
57 | 50 | | |
58 | 51 | | |
59 | 52 | | |
60 | 53 | | |
61 | 54 | | |
62 | 55 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 56 | | |
89 | 57 | | |
90 | 58 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
0 commit comments