RAID creation fails with 'ilo5' RAID interface

RAID interface methods do not clear driver_internal_info properly
leads to failure of RAID operation when they are attempted again.

Change-Id: I3cd133fb700ec4946471d9e4cbebeab4bded4540
Story: 2006321
Task: 36052
This commit is contained in:
Shivanand Tendulker 2019-08-01 08:48:57 -04:00
parent af61985d03
commit 6305ea7007
3 changed files with 28 additions and 30 deletions

View File

@ -127,6 +127,8 @@ class Ilo5RAID(base.RAIDInterface):
create_nonroot_volumes=create_nonroot_volumes)
driver_internal_info = node.driver_internal_info
driver_internal_info['target_raid_config'] = target_raid_config
node.driver_internal_info = driver_internal_info
node.save()
LOG.debug("Calling OOB RAID create_configuration for node %(node)s "
"with the following target RAID configuration: %(target)s",
{'node': node.uuid, 'target': target_raid_config})
@ -149,17 +151,13 @@ class Ilo5RAID(base.RAIDInterface):
{'uuid': node.uuid})
self._pop_driver_internal_values(
task, 'ilo_raid_create_in_progress',
'cleaning_reboot', 'skip_current_clean_step')
node.driver_internal_info = driver_internal_info
node.save()
'skip_current_clean_step')
else:
# Raid configuration failed
msg = "Unable to create raid"
self._pop_driver_internal_values(
task, 'ilo_raid_create_in_progress',
'cleaning_reboot', 'skip_current_clean_step')
node.driver_internal_info = driver_internal_info
node.save()
'skip_current_clean_step')
raise exception.NodeCleaningFailure(
"Clean step create_configuration failed "
"on node %(node)s with error: %(err)s" %
@ -169,10 +167,7 @@ class Ilo5RAID(base.RAIDInterface):
% node.uuid)
self._pop_driver_internal_values(task,
'ilo_raid_create_in_progress',
'cleaning_reboot',
'skip_current_clean_step')
node.driver_internal_info = driver_internal_info
node.save()
self._set_clean_failed(task, operation, ilo_exception)
@METRICS.timer('Ilo5RAID.delete_configuration')
@ -204,18 +199,14 @@ class Ilo5RAID(base.RAIDInterface):
{'uuid': node.uuid})
self._pop_driver_internal_values(
task, 'ilo_raid_delete_in_progress',
'cleaning_reboot', 'skip_current_clean_step')
node.driver_internal_info = driver_internal_info
node.save()
'skip_current_clean_step')
else:
# Raid configuration failed
msg = ("Unable to delete this logical disks: %s" %
raid_conf['logical_disks'])
self._pop_driver_internal_values(
task, 'ilo_raid_delete_in_progress',
'cleaning_reboot', 'skip_current_clean_step')
node.driver_internal_info = driver_internal_info
node.save()
'skip_current_clean_step')
raise exception.NodeCleaningFailure(
"Clean step delete_configuration failed "
"on node %(node)s with error: %(err)s" %
@ -228,8 +219,5 @@ class Ilo5RAID(base.RAIDInterface):
% node.uuid)
self._pop_driver_internal_values(task,
'ilo_raid_delete_in_progress',
'cleaning_reboot',
'skip_current_clean_step')
node.driver_internal_info = driver_internal_info
node.save()
self._set_clean_failed(task, operation, ilo_exception)

View File

@ -127,7 +127,10 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
u'volume_name': u'0006EB7BPDVTF0BRH5L0EAEDDA'}]
}
ilo_mock_object = ilo_mock.return_value
self.node.driver_internal_info = {'ilo_raid_create_in_progress': True}
driver_internal_info = self.node.driver_internal_info
driver_internal_info['ilo_raid_create_in_progress'] = True
driver_internal_info['skip_current_clean_step'] = False
self.node.driver_internal_info = driver_internal_info
self.node.save()
with task_manager.acquire(self.context, self.node.uuid) as task:
filter_target_raid_config_mock.return_value = (
@ -137,8 +140,6 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
update_raid_mock.assert_called_once_with(task.node, raid_conf)
self.assertNotIn('ilo_raid_create_in_progress',
task.node.driver_internal_info)
self.assertNotIn('cleaning_reboot',
task.node.driver_internal_info)
self.assertNotIn('skip_current_clean_step',
task.node.driver_internal_info)
@ -147,7 +148,10 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
def test_create_configuration_with_read_raid_failed(
self, ilo_mock, filter_target_raid_config_mock):
raid_conf = {u'logical_disks': []}
self.node.driver_internal_info = {'ilo_raid_create_in_progress': True}
driver_internal_info = self.node.driver_internal_info
driver_internal_info['ilo_raid_create_in_progress'] = True
driver_internal_info['skip_current_clean_step'] = False
self.node.driver_internal_info = driver_internal_info
self.node.save()
ilo_mock_object = ilo_mock.return_value
with task_manager.acquire(self.context, self.node.uuid) as task:
@ -158,8 +162,6 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
task.driver.raid.create_configuration, task)
self.assertNotIn('ilo_raid_create_in_progress',
task.node.driver_internal_info)
self.assertNotIn('cleaning_reboot',
task.node.driver_internal_info)
self.assertNotIn('skip_current_clean_step',
task.node.driver_internal_info)
@ -287,7 +289,10 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
@mock.patch.object(ilo_common, 'get_ilo_object', autospec=True)
def test_delete_configuration_with_read_raid(self, ilo_mock):
raid_conf = {u'logical_disks': []}
self.node.driver_internal_info = {'ilo_raid_delete_in_progress': True}
driver_internal_info = self.node.driver_internal_info
driver_internal_info['ilo_raid_delete_in_progress'] = True
driver_internal_info['skip_current_clean_step'] = False
self.node.driver_internal_info = driver_internal_info
self.node.save()
ilo_mock_object = ilo_mock.return_value
with task_manager.acquire(self.context, self.node.uuid) as task:
@ -296,8 +301,6 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
self.assertEqual(self.node.raid_config, {})
self.assertNotIn('ilo_raid_delete_in_progress',
task.node.driver_internal_info)
self.assertNotIn('cleaning_reboot',
task.node.driver_internal_info)
self.assertNotIn('skip_current_clean_step',
task.node.driver_internal_info)
@ -306,7 +309,10 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
raid_conf = {u'logical_disks': [{'size_gb': 200,
'raid_level': 0,
'is_root_volume': True}]}
self.node.driver_internal_info = {'ilo_raid_delete_in_progress': True}
driver_internal_info = self.node.driver_internal_info
driver_internal_info['ilo_raid_delete_in_progress'] = True
driver_internal_info['skip_current_clean_step'] = False
self.node.driver_internal_info = driver_internal_info
self.node.save()
ilo_mock_object = ilo_mock.return_value
with task_manager.acquire(self.context, self.node.uuid) as task:
@ -315,8 +321,6 @@ class Ilo5RAIDTestCase(db_base.DbTestCase):
task.driver.raid.delete_configuration, task)
self.assertNotIn('ilo_raid_delete_in_progress',
task.node.driver_internal_info)
self.assertNotIn('cleaning_reboot',
task.node.driver_internal_info)
self.assertNotIn('skip_current_clean_step',
task.node.driver_internal_info)

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes an issue in creation of RAID for ``ilo5`` RAID interface
wherein second time RAID creation fails. See `story 2006321
<https://storyboard.openstack.org/#!/story/2006321>`__ for details.