/[smeserver]/cdrom.image/updates/raid.py
ViewVC logotype

Diff of /cdrom.image/updates/raid.py

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.2 by slords, Wed Apr 5 01:20:27 2006 UTC Revision 1.3 by slords, Wed Apr 5 21:11:51 2006 UTC
# Line 25  from rhpl.log import log Line 25  from rhpl.log import log
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.
# Line 90  def scanForRaid(drives): Line 90  def scanForRaid(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
# Line 161  def get_raid_min_members(raidlevel): Line 172  def get_raid_min_members(raidlevel):
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    


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed