From e45306b598becc1828c454d324a1a4bd995481af Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Fri, 5 Oct 2018 14:02:06 -0500 Subject: [PATCH] (fix) Register error for missing disk - When a block device isn't found on a node the failure isn't registered as such Change-Id: Iaeab6d2e797e1d0c6089e26da9abcd1c60f2c5c5 --- .../drivers/node/maasdriver/actions/node.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/python/drydock_provisioner/drivers/node/maasdriver/actions/node.py b/python/drydock_provisioner/drivers/node/maasdriver/actions/node.py index 732aec98..11ccd6b1 100644 --- a/python/drydock_provisioner/drivers/node/maasdriver/actions/node.py +++ b/python/drydock_provisioner/drivers/node/maasdriver/actions/node.py @@ -1814,11 +1814,7 @@ class ApplyNodeStorage(BaseMaasAction): # for the partition table and once the table is written, there is not # enough space for the 'full size' partition. So reserve the below # when calculating 'rest of device' sizing w/ the '>' operator - # - # This size is based on documentation that for backwards compatability - # the first partition should start on LBA 63 and we'll assume 4096 byte - # blocks, thus 63 (add one for safety) x 4096 = 258048 - PART_TABLE_RESERVATION = 258048 + PART_TABLE_RESERVATION = 1024 * 1024 * 4 # 4MB reservation for partition size def start(self): try: @@ -1945,9 +1941,12 @@ class ApplyNodeStorage(BaseMaasAction): n.get_logicalname(d.name) }) if maas_dev is None: - self.logger.warning( - "Dev %s (%s) not found on node %s" % - (d.name, n.get_logicalname(d.name), n.name)) + msg = "Dev %s (%s) not found on node %s" % ( + d.name, n.get_logicalname(d.name), n.name) + self.logger.warning(msg) + self.task.add_status_msg( + msg=msg, error=True, ctx=n.name, ctx_type='node') + self.task.failure(focus=n.get_id()) continue if d.volume_group is not None: