25 |
|
|
26 |
# these arches can have their /boot on RAID and not have their |
# these arches can have their /boot on RAID and not have their |
27 |
# boot loader blow up |
# boot loader blow up |
28 |
raidBootArches = [ "i386", "x86_64" ] |
raidBootArches = [ "i386", "x86_64", "ppc" ] |
29 |
|
|
30 |
def scanForRaid(drives): |
def scanForRaid(drives): |
31 |
"""Scans for raid devices on drives. |
"""Scans for raid devices on drives. |
90 |
raidList = [] |
raidList = [] |
91 |
for key in raidSets.keys(): |
for key in raidSets.keys(): |
92 |
(level, totalDisks, mdMinor, devices) = raidSets[key] |
(level, totalDisks, mdMinor, devices) = raidSets[key] |
93 |
if len(devices) < totalDisks: |
if len(devices) == totalDisks - 1 and level in (1, 5, 6): |
94 |
log("missing components of raid device md%d. The " |
log("missing components of raid device md%d. The " |
95 |
"raid device needs %d drive(s) and only %d (was/were) found. " |
"raid device needs %d drive(s) and only %d (was/were) found. " |
96 |
"This raid device will be started in degraded mode.", mdMinor, |
"This raid device will be started in degraded mode.", mdMinor, |
97 |
totalDisks, len(devices)) |
totalDisks, len(devices)) |
98 |
|
elif len(devices) == totalDisks - 2 and level == 6: |
99 |
|
log("missing components of raid device md%d. The " |
100 |
|
"raid device needs %d drive(s) and only %d (was/were) found. " |
101 |
|
"This raid device will be started in degraded mode.", mdMinor, |
102 |
|
totalDisks, len(devices)) |
103 |
|
elif len(devices) < totalDisks: |
104 |
|
log("missing components of raid device md%d. The " |
105 |
|
"raid device needs %d drive(s) and only %d (was/were) found. " |
106 |
|
"This raid device will not be started.", mdMinor, |
107 |
|
totalDisks, len(devices)) |
108 |
|
continue |
109 |
raidList.append((mdMinor, devices, level, totalDisks)) |
raidList.append((mdMinor, devices, level, totalDisks)) |
110 |
|
|
111 |
return raidList |
return raidList |
172 |
elif isRaid1(raidlevel): |
elif isRaid1(raidlevel): |
173 |
return 1 |
return 1 |
174 |
elif isRaid5(raidlevel): |
elif isRaid5(raidlevel): |
175 |
return 3 |
return 2 |
176 |
elif isRaid6(raidlevel): |
elif isRaid6(raidlevel): |
177 |
return 4 |
return 2 |
178 |
else: |
else: |
179 |
raise ValueError, "invalid raidlevel in get_raid_min_members" |
raise ValueError, "invalid raidlevel in get_raid_min_members" |
180 |
|
|