Repository navigation
Commit 826ea7a
committed
server: Avoid device id collision between config drive ISO and data volumes on KVM
ConfigDriveNetworkElement hardcodes disk sequence 4 (CONFIGDRIVEDISKSEQ) for
the config drive ISO, but the volume device-id allocators
(VolumeApiServiceImpl.getDeviceId, KVMGuru.getNextAvailableDeviceId) only
look at persisted VolumeVO rows and have no knowledge that slot 4 is
reserved by the config drive. When a VM using ConfigDrive already has data
disks on device ids 1 and 2, attaching a 3rd data disk gets assigned device
id 4 as well, producing two disks with the same libvirt target device
(e.g. "sde") once both end up on the same bus namespace, as happens with
Q35/UEFI machine types.
Both allocators now skip CONFIGDRIVEDISKSEQ when the VM has a config drive
(detected via the existing CONFIG_DRIVE_LOCATION vm detail), the same way
they already permanently reserve device id 3 for the CD-ROM slot.1 parent 2b3cca6 commit 826ea7a
3 files changed
Lines changed: 19 additions & 5 deletions
File tree
- server/src/main/java/com/cloud
- hypervisor
- network/element
- storage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | | - | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
371 | 379 | | |
372 | 380 | | |
373 | 381 | | |
374 | | - | |
| 382 | + | |
375 | 383 | | |
376 | 384 | | |
377 | 385 | | |
| |||
389 | 397 | | |
390 | 398 | | |
391 | 399 | | |
392 | | - | |
| 400 | + | |
393 | 401 | | |
394 | 402 | | |
395 | 403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
5042 | 5043 | | |
5043 | 5044 | | |
5044 | 5045 | | |
| 5046 | + | |
5045 | 5047 | | |
5046 | | - | |
| 5048 | + | |
| 5049 | + | |
5047 | 5050 | | |
5048 | 5051 | | |
5049 | 5052 | | |
| |||
5058 | 5061 | | |
5059 | 5062 | | |
5060 | 5063 | | |
| 5064 | + | |
| 5065 | + | |
| 5066 | + | |
5061 | 5067 | | |
5062 | 5068 | | |
5063 | 5069 | | |
| |||
0 commit comments