From 01a9016779fc4cc1b974e0e878deda08bc970206 Mon Sep 17 00:00:00 2001 From: Christopher Dearborn Date: Tue, 12 Jun 2018 16:08:54 -0400 Subject: [PATCH] Fix for Unable to create RAID1 on Dell BOSS card This patch changes the RAID configuration schema so that 0 is allowed for size_gb. This allows passing 0 for the size, which the Dell Boot Optimized Storage Solution (BOSS) requires. Change-Id: I57cf290021e32809b248350688c3f83e7bbf7351 Task: #22082 Story: #2002536 Co-Authored-By: Digambar Patil Depends-On: Id149f6250318e6162a168d002671faa2b3a7989b --- ironic/drivers/raid_config_schema.json | 3 +-- ironic/tests/unit/common/test_raid.py | 6 ++++++ ironic/tests/unit/raid_constants.py | 11 +++++++++++ .../notes/raid-dell-boss-e9c5da9ddceedd67.yaml | 4 ++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/raid-dell-boss-e9c5da9ddceedd67.yaml diff --git a/ironic/drivers/raid_config_schema.json b/ironic/drivers/raid_config_schema.json index c7e62357d0..916cc8047e 100644 --- a/ironic/drivers/raid_config_schema.json +++ b/ironic/drivers/raid_config_schema.json @@ -15,8 +15,7 @@ "size_gb": { "anyOf": [{ "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "minimum": 0 }, { "type": "string", diff --git a/ironic/tests/unit/common/test_raid.py b/ironic/tests/unit/common/test_raid.py index 6e2ed519fb..40ae9f400f 100644 --- a/ironic/tests/unit/common/test_raid.py +++ b/ironic/tests/unit/common/test_raid.py @@ -69,6 +69,12 @@ class ValidateRaidConfigurationTestCase(base.TestCase): raid_config, raid_config_schema=self.schema) + def test_validate_configuration_zero_size_gb(self): + raid_config = json.loads(raid_constants.RAID_CONFIG_ZERO_SIZE_GB) + + raid.validate_configuration(raid_config, + raid_config_schema=self.schema) + def test_validate_configuration_max_size_gb(self): raid_config = json.loads(raid_constants.RAID_CONFIG_MAX_SIZE_GB) raid.validate_configuration(raid_config, diff --git a/ironic/tests/unit/raid_constants.py b/ironic/tests/unit/raid_constants.py index ba37f84a73..826d626034 100644 --- a/ironic/tests/unit/raid_constants.py +++ b/ironic/tests/unit/raid_constants.py @@ -84,6 +84,17 @@ RAID_CONFIG_INVALID_SIZE_GB = ''' } ''' +RAID_CONFIG_ZERO_SIZE_GB = ''' +{ + "logical_disks": [ + { + "raid_level": "1", + "size_gb": 0 + } + ] +} +''' + RAID_CONFIG_MAX_SIZE_GB = ''' { "logical_disks": [ diff --git a/releasenotes/notes/raid-dell-boss-e9c5da9ddceedd67.yaml b/releasenotes/notes/raid-dell-boss-e9c5da9ddceedd67.yaml new file mode 100644 index 0000000000..b290b50634 --- /dev/null +++ b/releasenotes/notes/raid-dell-boss-e9c5da9ddceedd67.yaml @@ -0,0 +1,4 @@ +--- +features: + - Adds support for RAID 1 creation on Dell Boot Optimized Storage Solution + (BOSS).