Skip to content

Commit

Permalink
detect: Detecting non-contiguous disks on megacli
Browse files Browse the repository at this point in the history
On some systems, we have non-contiguous slots like in :
                     info = megacli.pdinfo(ctrl,

[root@ceph01-prv src]# megacli -PdList -aAll | grep -i Slot
Slot Number: 0
Slot Number: 1
Slot Number: 2
Slot Number: 3
Slot Number: 4
Slot Number: 5
Slot Number: 6
Slot Number: 7
Slot Number: 8
Slot Number: 9
Slot Number: 10
Slot Number: 11
Slot Number: 12
Slot Number: 13
Slot Number: 22
Slot Number: 23

The existing code was looking slots up to the number of disks while it should consider the number of slots.
  • Loading branch information
Erwan Velu committed Oct 1, 2014
1 parent 4084501 commit 8099ef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def detect_megacli(hw_lst):
if ctrl_num > 0:
for ctrl in range(ctrl_num):
for enc in megacli.enc_info(ctrl):
for disk_num in range(enc['NumberOfPhysicalDrives']):
for disk_num in range(enc['NumberOfSlots']):
disk_count += 1
disk = 'disk%d' % disk_num
info = megacli.pdinfo(ctrl,
Expand Down

0 comments on commit 8099ef6

Please sign in to comment.