From 21f6799a19e5684059a1cc14d3a27efdd33fb5c3 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Fri, 24 Apr 2015 11:18:17 +0100 Subject: [PATCH] Improve iSCSI deployment logs This patch just add some DEBUG and INFO logs for the iSCSI deployment methodology, so that the operator knows what's the steps the ramdisk is taken by looking at the conductor logs. The patch add logs for Ironic when working with both supported ramdisks DIB and IPA. Change-Id: Iaee09643b03877a1a735b6019def47445bf3e16f --- ironic/drivers/modules/agent_base_vendor.py | 4 ++++ ironic/drivers/modules/iscsi_deploy.py | 5 ++++- ironic/drivers/modules/pxe.py | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ironic/drivers/modules/agent_base_vendor.py b/ironic/drivers/modules/agent_base_vendor.py index 3097b91f98..539d1f06ba 100644 --- a/ironic/drivers/modules/agent_base_vendor.py +++ b/ironic/drivers/modules/agent_base_vendor.py @@ -469,6 +469,7 @@ class BaseAgentVendor(base.VendorInterface): node = task.node if not node.driver_internal_info.get( 'is_whole_disk_image') and root_uuid: + LOG.debug('Installing the bootloader on node %s', node.uuid) result = self._client.install_bootloader( node, root_uuid=root_uuid, efi_system_part_uuid=efi_system_part_uuid) @@ -487,3 +488,6 @@ class BaseAgentVendor(base.VendorInterface): {'boot_dev': boot_devices.DISK, 'node': node.uuid, 'error': e}) self._log_and_raise_deployment_error(task, msg) + + LOG.info(_LI('Bootloader successfully installed on node %s'), + node.uuid) diff --git a/ironic/drivers/modules/iscsi_deploy.py b/ironic/drivers/modules/iscsi_deploy.py index ac7315d33a..6e6ea04fd4 100644 --- a/ironic/drivers/modules/iscsi_deploy.py +++ b/ironic/drivers/modules/iscsi_deploy.py @@ -591,14 +591,17 @@ def validate_bootloader_install_status(task, input_params): :raises: InstanceDeployFailure, if bootloader installation was reported from ramdisk as failure. """ + node = task.node if input_params['status'] != 'SUCCEEDED': msg = (_('Failed to install bootloader on node %(node)s. ' 'Error: %(error)s.') % - {'node': task.node.uuid, 'error': input_params.get('error')}) + {'node': node.uuid, 'error': input_params.get('error')}) LOG.error(msg) deploy_utils.set_failed_state(task, msg) raise exception.InstanceDeployFailure(msg) + LOG.info(_LI('Bootloader successfully installed on node %s'), node.uuid) + def finish_deploy(task, address): """Notifies the ramdisk to reboot the node and makes the instance active. diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py index b6402f82f5..066d76e2d1 100644 --- a/ironic/drivers/modules/pxe.py +++ b/ironic/drivers/modules/pxe.py @@ -576,6 +576,7 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor): 'address': The IP address of the ramdisk """ task.process_event('resume') + LOG.debug('Continuing the deployment on node %s', task.node.uuid) iscsi_deploy.validate_bootloader_install_status(task, kwargs) iscsi_deploy.finish_deploy(task, kwargs['address']) @@ -593,6 +594,7 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor): """ node = task.node task.process_event('resume') + LOG.debug('Continuing the deployment on node %s', node.uuid) _destroy_token_file(node) is_whole_disk_image = node.driver_internal_info['is_whole_disk_image'] @@ -622,6 +624,8 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor): # 'pass_bootloader_install_info', if it's not a # whole disk image. if not is_whole_disk_image: + LOG.debug('Installing the bootloader on node %s', + node.uuid) deploy_utils.notify_ramdisk_to_proceed(kwargs['address']) task.process_event('wait') return