diff --git a/CHANGELOG.md b/CHANGELOG.md index 021937b..8f29d9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Version 0.6.1 - **Fixes**: ---------- - [**Controller**] Fixed device count on controller.create_vd. Requested in [#2](https://github.com/Naudit/pystorcli2/issues/2) + - [**Controller**] Fixed default pd on controller.create_vd in some scenarios. Requested in [#2](https://github.com/Naudit/pystorcli2/issues/2) Version 0.6.0 ============= diff --git a/pystorcli2/controller.py b/pystorcli2/controller.py index 93d6b93..3a58435 100644 --- a/pystorcli2/controller.py +++ b/pystorcli2/controller.py @@ -314,13 +314,21 @@ def create_vd(self, name: str, raid: str, drives: str, strip: str = '64', PDperA # The format of the drives argument is e:s|e:s-x|e:s-x,y;e:s-x,y,z numDrives = common.count_drives(drives) - PDperArray = numDrives//2 + + if numDrives % 2 != 0 and numDrives % 3 == 0: + # In some scenarios, such as 9 drives with raid 60, 3 is a good pd number but 4 is not + # Must check for similar scenarios + # BTW we don't clearly understand what PDperArray is for and what exactly it does under the hood. More investigation is needed + PDperArray = numDrives//3 + else: + PDperArray = numDrives//2 except ValueError: pass - if raid == '00' and PDperArray is None: - PDperArray = 1 + finally: + if raid == '00' and PDperArray is None: + PDperArray = 1 if PDperArray is not None: args.append('PDperArray={0}'.format(PDperArray))