Browse Source

(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
Scott Hussey 6 months ago
parent
commit
e45306b598

+ 7
- 8
python/drydock_provisioner/drivers/node/maasdriver/actions/node.py View File

@@ -1814,11 +1814,7 @@ class ApplyNodeStorage(BaseMaasAction):
1814 1814
     # for the partition table and once the table is written, there is not
1815 1815
     # enough space for the 'full size' partition. So reserve the below
1816 1816
     # when calculating 'rest of device' sizing w/ the '>' operator
1817
-    #
1818
-    # This size is based on documentation that for backwards compatability
1819
-    # the first partition should start on LBA 63 and we'll assume 4096 byte
1820
-    # blocks, thus 63 (add one for safety) x 4096 = 258048
1821
-    PART_TABLE_RESERVATION = 258048
1817
+    PART_TABLE_RESERVATION = 1024 * 1024 * 4  # 4MB reservation for partition size
1822 1818
 
1823 1819
     def start(self):
1824 1820
         try:
@@ -1945,9 +1941,12 @@ class ApplyNodeStorage(BaseMaasAction):
1945 1941
                         n.get_logicalname(d.name)
1946 1942
                     })
1947 1943
                     if maas_dev is None:
1948
-                        self.logger.warning(
1949
-                            "Dev %s (%s) not found on node %s" %
1950
-                            (d.name, n.get_logicalname(d.name), n.name))
1944
+                        msg = "Dev %s (%s) not found on node %s" % (
1945
+                                d.name, n.get_logicalname(d.name), n.name)
1946
+                        self.logger.warning(msg)
1947
+                        self.task.add_status_msg(
1948
+                            msg=msg, error=True, ctx=n.name, ctx_type='node')
1949
+                        self.task.failure(focus=n.get_id())
1951 1950
                         continue
1952 1951
 
1953 1952
                     if d.volume_group is not None:

Loading…
Cancel
Save