Adding Timing metrics for DRAC drivers.
This change adds timing metrics for method in the bios, deploy, inspect, management, power, raid, vendor_passthru modules Change-Id: Ib301f203badecf4834dae5bba35175d13c4545cf Closes-Bug: #1611555
This commit is contained in:
parent
70b992ca57
commit
f91d83a56e
@ -15,6 +15,8 @@
|
|||||||
DRAC deploy interface
|
DRAC deploy interface
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from ironic_lib import metrics_utils
|
||||||
|
|
||||||
from ironic.drivers.modules import deploy_utils
|
from ironic.drivers.modules import deploy_utils
|
||||||
from ironic.drivers.modules import iscsi_deploy
|
from ironic.drivers.modules import iscsi_deploy
|
||||||
|
|
||||||
@ -23,9 +25,12 @@ _OOB_CLEAN_STEPS = [
|
|||||||
{'interface': 'raid', 'step': 'delete_configuration'}
|
{'interface': 'raid', 'step': 'delete_configuration'}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DracDeploy(iscsi_deploy.ISCSIDeploy):
|
class DracDeploy(iscsi_deploy.ISCSIDeploy):
|
||||||
|
|
||||||
|
@METRICS.timer('DracDeploy.prepare_cleaning')
|
||||||
def prepare_cleaning(self, task):
|
def prepare_cleaning(self, task):
|
||||||
"""Prepare environment for cleaning
|
"""Prepare environment for cleaning
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
DRAC inspection interface
|
DRAC inspection interface
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from ironic_lib import metrics_utils
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
from oslo_utils import units
|
from oslo_utils import units
|
||||||
@ -33,6 +34,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DracInspect(base.InspectInterface):
|
class DracInspect(base.InspectInterface):
|
||||||
|
|
||||||
@ -43,6 +46,7 @@ class DracInspect(base.InspectInterface):
|
|||||||
"""
|
"""
|
||||||
return drac_common.COMMON_PROPERTIES
|
return drac_common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('DracInspect.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
"""Validate the driver-specific info supplied.
|
"""Validate the driver-specific info supplied.
|
||||||
|
|
||||||
@ -57,6 +61,7 @@ class DracInspect(base.InspectInterface):
|
|||||||
"""
|
"""
|
||||||
return drac_common.parse_driver_info(task.node)
|
return drac_common.parse_driver_info(task.node)
|
||||||
|
|
||||||
|
@METRICS.timer('DracInspect.inspect_hardware')
|
||||||
def inspect_hardware(self, task):
|
def inspect_hardware(self, task):
|
||||||
"""Inspect hardware.
|
"""Inspect hardware.
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
DRAC management interface
|
DRAC management interface
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from ironic_lib import metrics_utils
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
|
|
||||||
@ -34,6 +35,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
_BOOT_DEVICES_MAP = {
|
_BOOT_DEVICES_MAP = {
|
||||||
boot_devices.DISK: 'HardDisk',
|
boot_devices.DISK: 'HardDisk',
|
||||||
boot_devices.PXE: 'NIC',
|
boot_devices.PXE: 'NIC',
|
||||||
@ -123,6 +126,7 @@ class DracManagement(base.ManagementInterface):
|
|||||||
"""Return the properties of the interface."""
|
"""Return the properties of the interface."""
|
||||||
return drac_common.COMMON_PROPERTIES
|
return drac_common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('DracManagement.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
"""Validate the driver-specific info supplied.
|
"""Validate the driver-specific info supplied.
|
||||||
|
|
||||||
@ -137,6 +141,7 @@ class DracManagement(base.ManagementInterface):
|
|||||||
"""
|
"""
|
||||||
return drac_common.parse_driver_info(task.node)
|
return drac_common.parse_driver_info(task.node)
|
||||||
|
|
||||||
|
@METRICS.timer('DracManagement.get_supported_boot_devices')
|
||||||
def get_supported_boot_devices(self, task):
|
def get_supported_boot_devices(self, task):
|
||||||
"""Get a list of the supported boot devices.
|
"""Get a list of the supported boot devices.
|
||||||
|
|
||||||
@ -147,6 +152,7 @@ class DracManagement(base.ManagementInterface):
|
|||||||
"""
|
"""
|
||||||
return list(_BOOT_DEVICES_MAP.keys())
|
return list(_BOOT_DEVICES_MAP.keys())
|
||||||
|
|
||||||
|
@METRICS.timer('DracManagement.get_boot_device')
|
||||||
def get_boot_device(self, task):
|
def get_boot_device(self, task):
|
||||||
"""Get the current boot device for a node.
|
"""Get the current boot device for a node.
|
||||||
|
|
||||||
@ -169,6 +175,7 @@ class DracManagement(base.ManagementInterface):
|
|||||||
|
|
||||||
return _get_boot_device(node)
|
return _get_boot_device(node)
|
||||||
|
|
||||||
|
@METRICS.timer('DracManagement.set_boot_device')
|
||||||
@task_manager.require_exclusive_lock
|
@task_manager.require_exclusive_lock
|
||||||
def set_boot_device(self, task, device, persistent=False):
|
def set_boot_device(self, task, device, persistent=False):
|
||||||
"""Set the boot device for a node.
|
"""Set the boot device for a node.
|
||||||
@ -205,6 +212,7 @@ class DracManagement(base.ManagementInterface):
|
|||||||
node.driver_internal_info = driver_internal_info
|
node.driver_internal_info = driver_internal_info
|
||||||
node.save()
|
node.save()
|
||||||
|
|
||||||
|
@METRICS.timer('DracManagement.get_sensors_data')
|
||||||
def get_sensors_data(self, task):
|
def get_sensors_data(self, task):
|
||||||
"""Get sensors data.
|
"""Get sensors data.
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
DRAC power interface
|
DRAC power interface
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from ironic_lib import metrics_utils
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
|
|
||||||
@ -31,6 +32,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
if drac_constants:
|
if drac_constants:
|
||||||
POWER_STATES = {
|
POWER_STATES = {
|
||||||
drac_constants.POWER_ON: states.POWER_ON,
|
drac_constants.POWER_ON: states.POWER_ON,
|
||||||
@ -119,6 +122,7 @@ class DracPower(base.PowerInterface):
|
|||||||
"""Return the properties of the interface."""
|
"""Return the properties of the interface."""
|
||||||
return drac_common.COMMON_PROPERTIES
|
return drac_common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('DracPower.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
"""Validate the driver-specific Node power info.
|
"""Validate the driver-specific Node power info.
|
||||||
|
|
||||||
@ -132,6 +136,7 @@ class DracPower(base.PowerInterface):
|
|||||||
"""
|
"""
|
||||||
return drac_common.parse_driver_info(task.node)
|
return drac_common.parse_driver_info(task.node)
|
||||||
|
|
||||||
|
@METRICS.timer('DracPower.get_power_state')
|
||||||
def get_power_state(self, task):
|
def get_power_state(self, task):
|
||||||
"""Return the power state of the node.
|
"""Return the power state of the node.
|
||||||
|
|
||||||
@ -143,6 +148,7 @@ class DracPower(base.PowerInterface):
|
|||||||
"""
|
"""
|
||||||
return _get_power_state(task.node)
|
return _get_power_state(task.node)
|
||||||
|
|
||||||
|
@METRICS.timer('DracPower.set_power_state')
|
||||||
@task_manager.require_exclusive_lock
|
@task_manager.require_exclusive_lock
|
||||||
def set_power_state(self, task, power_state):
|
def set_power_state(self, task, power_state):
|
||||||
"""Set the power state of the node.
|
"""Set the power state of the node.
|
||||||
@ -155,6 +161,7 @@ class DracPower(base.PowerInterface):
|
|||||||
"""
|
"""
|
||||||
_set_power_state(task.node, power_state)
|
_set_power_state(task.node, power_state)
|
||||||
|
|
||||||
|
@METRICS.timer('DracPower.reboot')
|
||||||
@task_manager.require_exclusive_lock
|
@task_manager.require_exclusive_lock
|
||||||
def reboot(self, task):
|
def reboot(self, task):
|
||||||
"""Perform a reboot of the task's node.
|
"""Perform a reboot of the task's node.
|
||||||
|
@ -18,6 +18,7 @@ DRAC RAID specific methods
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
from futurist import periodics
|
from futurist import periodics
|
||||||
|
from ironic_lib import metrics_utils
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
from oslo_utils import units
|
from oslo_utils import units
|
||||||
@ -37,6 +38,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
RAID_LEVELS = {
|
RAID_LEVELS = {
|
||||||
'0': {
|
'0': {
|
||||||
'min_disks': 1,
|
'min_disks': 1,
|
||||||
@ -663,6 +666,7 @@ class DracRAID(base.RAIDInterface):
|
|||||||
"""Return the properties of the interface."""
|
"""Return the properties of the interface."""
|
||||||
return drac_common.COMMON_PROPERTIES
|
return drac_common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('DracRAID.create_configuration')
|
||||||
@base.clean_step(priority=0, abortable=False, argsinfo={
|
@base.clean_step(priority=0, abortable=False, argsinfo={
|
||||||
'create_root_volume': {
|
'create_root_volume': {
|
||||||
'description': (
|
'description': (
|
||||||
@ -740,6 +744,7 @@ class DracRAID(base.RAIDInterface):
|
|||||||
|
|
||||||
return _commit_to_controllers(node, list(controllers))
|
return _commit_to_controllers(node, list(controllers))
|
||||||
|
|
||||||
|
@METRICS.timer('DracRAID.delete_configuration')
|
||||||
@base.clean_step(priority=0)
|
@base.clean_step(priority=0)
|
||||||
def delete_configuration(self, task):
|
def delete_configuration(self, task):
|
||||||
"""Delete the RAID configuration.
|
"""Delete the RAID configuration.
|
||||||
@ -758,6 +763,7 @@ class DracRAID(base.RAIDInterface):
|
|||||||
|
|
||||||
return _commit_to_controllers(node, list(controllers))
|
return _commit_to_controllers(node, list(controllers))
|
||||||
|
|
||||||
|
@METRICS.timer('DracRAID.get_logical_disks')
|
||||||
def get_logical_disks(self, task):
|
def get_logical_disks(self, task):
|
||||||
"""Get the RAID configuration of the node.
|
"""Get the RAID configuration of the node.
|
||||||
|
|
||||||
@ -783,6 +789,7 @@ class DracRAID(base.RAIDInterface):
|
|||||||
|
|
||||||
return {'logical_disks': logical_disks}
|
return {'logical_disks': logical_disks}
|
||||||
|
|
||||||
|
@METRICS.timer('DracRAID._query_raid_config_job_status')
|
||||||
@periodics.periodic(
|
@periodics.periodic(
|
||||||
spacing=CONF.drac.query_raid_config_job_status_interval)
|
spacing=CONF.drac.query_raid_config_job_status_interval)
|
||||||
def _query_raid_config_job_status(self, manager, context):
|
def _query_raid_config_job_status(self, manager, context):
|
||||||
@ -816,6 +823,7 @@ class DracRAID(base.RAIDInterface):
|
|||||||
"%(node)s was already locked by another process. "
|
"%(node)s was already locked by another process. "
|
||||||
"Skip."), {'node': node_uuid})
|
"Skip."), {'node': node_uuid})
|
||||||
|
|
||||||
|
@METRICS.timer('DracRAID._check_node_raid_jobs')
|
||||||
def _check_node_raid_jobs(self, task):
|
def _check_node_raid_jobs(self, task):
|
||||||
"""Check the progress of running RAID config jobs of a node."""
|
"""Check the progress of running RAID config jobs of a node."""
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
DRAC vendor-passthru interface
|
DRAC vendor-passthru interface
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from ironic_lib import metrics_utils
|
||||||
|
|
||||||
from ironic.common.i18n import _
|
from ironic.common.i18n import _
|
||||||
from ironic.conductor import task_manager
|
from ironic.conductor import task_manager
|
||||||
from ironic.drivers import base
|
from ironic.drivers import base
|
||||||
@ -22,6 +24,8 @@ from ironic.drivers.modules.drac import bios as drac_bios
|
|||||||
from ironic.drivers.modules.drac import common as drac_common
|
from ironic.drivers.modules.drac import common as drac_common
|
||||||
from ironic.drivers.modules.drac import job as drac_job
|
from ironic.drivers.modules.drac import job as drac_job
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DracVendorPassthru(base.VendorInterface):
|
class DracVendorPassthru(base.VendorInterface):
|
||||||
"""Interface for DRAC specific methods."""
|
"""Interface for DRAC specific methods."""
|
||||||
@ -30,6 +34,7 @@ class DracVendorPassthru(base.VendorInterface):
|
|||||||
"""Return the properties of the interface."""
|
"""Return the properties of the interface."""
|
||||||
return drac_common.COMMON_PROPERTIES
|
return drac_common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('DracVendorPassthru.validate')
|
||||||
def validate(self, task, **kwargs):
|
def validate(self, task, **kwargs):
|
||||||
"""Validate the driver-specific info supplied.
|
"""Validate the driver-specific info supplied.
|
||||||
|
|
||||||
@ -44,6 +49,7 @@ class DracVendorPassthru(base.VendorInterface):
|
|||||||
"""
|
"""
|
||||||
return drac_common.parse_driver_info(task.node)
|
return drac_common.parse_driver_info(task.node)
|
||||||
|
|
||||||
|
@METRICS.timer('DracVendorPassthru.get_bios_config')
|
||||||
@base.passthru(['GET'], async=False,
|
@base.passthru(['GET'], async=False,
|
||||||
description=_("Returns a dictionary containing the BIOS "
|
description=_("Returns a dictionary containing the BIOS "
|
||||||
"settings from a node."))
|
"settings from a node."))
|
||||||
@ -65,6 +71,7 @@ class DracVendorPassthru(base.VendorInterface):
|
|||||||
|
|
||||||
return bios_attrs
|
return bios_attrs
|
||||||
|
|
||||||
|
@METRICS.timer('DracVendorPassthru.set_bios_config')
|
||||||
@base.passthru(['POST'], async=False,
|
@base.passthru(['POST'], async=False,
|
||||||
description=_("Change the BIOS configuration on a node. "
|
description=_("Change the BIOS configuration on a node. "
|
||||||
"Required argument : a dictionary of "
|
"Required argument : a dictionary of "
|
||||||
@ -88,6 +95,7 @@ class DracVendorPassthru(base.VendorInterface):
|
|||||||
"""
|
"""
|
||||||
return drac_bios.set_config(task, **kwargs)
|
return drac_bios.set_config(task, **kwargs)
|
||||||
|
|
||||||
|
@METRICS.timer('DracVendorPassthru.commit_bios_config')
|
||||||
@base.passthru(['POST'], async=False,
|
@base.passthru(['POST'], async=False,
|
||||||
description=_("Commit a BIOS configuration job submitted "
|
description=_("Commit a BIOS configuration job submitted "
|
||||||
"through set_bios_config(). Required "
|
"through set_bios_config(). Required "
|
||||||
@ -119,6 +127,7 @@ class DracVendorPassthru(base.VendorInterface):
|
|||||||
job_id = drac_bios.commit_config(task, reboot=reboot)
|
job_id = drac_bios.commit_config(task, reboot=reboot)
|
||||||
return {'job_id': job_id, 'reboot_required': not reboot}
|
return {'job_id': job_id, 'reboot_required': not reboot}
|
||||||
|
|
||||||
|
@METRICS.timer('DracVendorPassthru.abandon_bios_config')
|
||||||
@base.passthru(['DELETE'], async=False,
|
@base.passthru(['DELETE'], async=False,
|
||||||
description=_("Abandon a BIOS configuration job previously "
|
description=_("Abandon a BIOS configuration job previously "
|
||||||
"submitted through set_bios_config()."))
|
"submitted through set_bios_config()."))
|
||||||
|
4
releasenotes/notes/bug-1611555-de1ec64ba46982ec.yaml
Normal file
4
releasenotes/notes/bug-1611555-de1ec64ba46982ec.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Adds timing metrics to DRAC drivers.
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user