Merge "Do not validate root partition size for whole disk images in iscsi deploy"

changes/00/533700/1
Zuul 5 years ago committed by Gerrit Code Review
commit e9425da77e
  1. 7
      ironic/drivers/modules/iscsi_deploy.py
  2. 11
      ironic/tests/unit/drivers/modules/test_iscsi_deploy.py
  3. 6
      releasenotes/notes/iscsi-whole-disk-cd464d589d029b01.yaml

@ -88,10 +88,17 @@ def _save_disk_layout(node, i_info):
def check_image_size(task):
"""Check if the requested image is larger than the root partition size.
Does nothing for whole-disk images.
:param task: a TaskManager instance containing the node to act on.
:raises: InstanceDeployFailure if size of the image is greater than root
partition.
"""
if task.node.driver_internal_info['is_whole_disk_image']:
# The root partition is already created and populated, no use
# validating its size
return
i_info = deploy_utils.parse_instance_info(task.node)
image_path = _get_image_file_path(task.node.uuid)
image_mb = disk_utils.get_image_mb(image_path)

@ -117,6 +117,17 @@ class IscsiDeployMethodsTestCase(db_base.DbTestCase):
get_image_mb_mock.assert_called_once_with(
iscsi_deploy._get_image_file_path(task.node.uuid))
@mock.patch.object(disk_utils, 'get_image_mb', autospec=True)
def test_check_image_size_whole_disk_image(self, get_image_mb_mock):
get_image_mb_mock.return_value = 1025
with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task:
task.node.instance_info['root_gb'] = 1
task.node.driver_internal_info['is_whole_disk_image'] = True
# No error for whole disk images
iscsi_deploy.check_image_size(task)
self.assertFalse(get_image_mb_mock.called)
@mock.patch.object(disk_utils, 'get_image_mb', autospec=True)
def test_check_image_size_fails(self, get_image_mb_mock):
get_image_mb_mock.return_value = 1025

@ -0,0 +1,6 @@
---
fixes:
- |
No longer validates requested root partition size for whole-disk images
using ``iscsi`` deploy interface, see `bug 1742451
<https://bugs.launchpad.net/ironic/+bug/1742451>`_ for details.
Loading…
Cancel
Save