Merge "Timing metrics: OneView drivers"
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
import abc
|
import abc
|
||||||
|
|
||||||
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
|
||||||
import six
|
import six
|
||||||
|
|
||||||
@@ -31,6 +32,8 @@ from ironic import objects
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
CONF = common.CONF
|
CONF = common.CONF
|
||||||
|
|
||||||
|
|
||||||
@@ -223,6 +226,7 @@ class OneViewIscsiDeploy(iscsi_deploy.ISCSIDeploy, OneViewPeriodicTasks):
|
|||||||
def get_properties(self):
|
def get_properties(self):
|
||||||
deploy_utils.get_properties()
|
deploy_utils.get_properties()
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewIscsiDeploy.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
common.verify_node_info(task.node)
|
common.verify_node_info(task.node)
|
||||||
try:
|
try:
|
||||||
@@ -231,22 +235,26 @@ class OneViewIscsiDeploy(iscsi_deploy.ISCSIDeploy, OneViewPeriodicTasks):
|
|||||||
raise exception.InvalidParameterValue(oneview_exc)
|
raise exception.InvalidParameterValue(oneview_exc)
|
||||||
super(OneViewIscsiDeploy, self).validate(task)
|
super(OneViewIscsiDeploy, self).validate(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewIscsiDeploy.prepare')
|
||||||
def prepare(self, task):
|
def prepare(self, task):
|
||||||
if common.is_dynamic_allocation_enabled(task.node):
|
if common.is_dynamic_allocation_enabled(task.node):
|
||||||
deploy_utils.prepare(task)
|
deploy_utils.prepare(task)
|
||||||
super(OneViewIscsiDeploy, self).prepare(task)
|
super(OneViewIscsiDeploy, self).prepare(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewIscsiDeploy.tear_down')
|
||||||
def tear_down(self, task):
|
def tear_down(self, task):
|
||||||
if (common.is_dynamic_allocation_enabled(task.node) and
|
if (common.is_dynamic_allocation_enabled(task.node) and
|
||||||
not CONF.conductor.automated_clean):
|
not CONF.conductor.automated_clean):
|
||||||
deploy_utils.tear_down(task)
|
deploy_utils.tear_down(task)
|
||||||
super(OneViewIscsiDeploy, self).tear_down(task)
|
super(OneViewIscsiDeploy, self).tear_down(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewIscsiDeploy.prepare_cleaning')
|
||||||
def prepare_cleaning(self, task):
|
def prepare_cleaning(self, task):
|
||||||
if common.is_dynamic_allocation_enabled(task.node):
|
if common.is_dynamic_allocation_enabled(task.node):
|
||||||
deploy_utils.prepare_cleaning(task)
|
deploy_utils.prepare_cleaning(task)
|
||||||
return super(OneViewIscsiDeploy, self).prepare_cleaning(task)
|
return super(OneViewIscsiDeploy, self).prepare_cleaning(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewIscsiDeploy.tear_down_cleaning')
|
||||||
def tear_down_cleaning(self, task):
|
def tear_down_cleaning(self, task):
|
||||||
if common.is_dynamic_allocation_enabled(task.node):
|
if common.is_dynamic_allocation_enabled(task.node):
|
||||||
deploy_utils.tear_down_cleaning(task)
|
deploy_utils.tear_down_cleaning(task)
|
||||||
@@ -261,6 +269,7 @@ class OneViewAgentDeploy(agent.AgentDeploy, OneViewPeriodicTasks):
|
|||||||
def get_properties(self):
|
def get_properties(self):
|
||||||
deploy_utils.get_properties()
|
deploy_utils.get_properties()
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewAgentDeploy.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
common.verify_node_info(task.node)
|
common.verify_node_info(task.node)
|
||||||
try:
|
try:
|
||||||
@@ -269,22 +278,26 @@ class OneViewAgentDeploy(agent.AgentDeploy, OneViewPeriodicTasks):
|
|||||||
raise exception.InvalidParameterValue(oneview_exc)
|
raise exception.InvalidParameterValue(oneview_exc)
|
||||||
super(OneViewAgentDeploy, self).validate(task)
|
super(OneViewAgentDeploy, self).validate(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewAgentDeploy.prepare')
|
||||||
def prepare(self, task):
|
def prepare(self, task):
|
||||||
if common.is_dynamic_allocation_enabled(task.node):
|
if common.is_dynamic_allocation_enabled(task.node):
|
||||||
deploy_utils.prepare(task)
|
deploy_utils.prepare(task)
|
||||||
super(OneViewAgentDeploy, self).prepare(task)
|
super(OneViewAgentDeploy, self).prepare(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewAgentDeploy.tear_down')
|
||||||
def tear_down(self, task):
|
def tear_down(self, task):
|
||||||
if (common.is_dynamic_allocation_enabled(task.node) and
|
if (common.is_dynamic_allocation_enabled(task.node) and
|
||||||
not CONF.conductor.automated_clean):
|
not CONF.conductor.automated_clean):
|
||||||
deploy_utils.tear_down(task)
|
deploy_utils.tear_down(task)
|
||||||
super(OneViewAgentDeploy, self).tear_down(task)
|
super(OneViewAgentDeploy, self).tear_down(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewAgentDeploy.prepare_cleaning')
|
||||||
def prepare_cleaning(self, task):
|
def prepare_cleaning(self, task):
|
||||||
if common.is_dynamic_allocation_enabled(task.node):
|
if common.is_dynamic_allocation_enabled(task.node):
|
||||||
deploy_utils.prepare_cleaning(task)
|
deploy_utils.prepare_cleaning(task)
|
||||||
return super(OneViewAgentDeploy, self).prepare_cleaning(task)
|
return super(OneViewAgentDeploy, self).prepare_cleaning(task)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewAgentDeploy.tear_down_cleaning')
|
||||||
def tear_down_cleaning(self, task):
|
def tear_down_cleaning(self, task):
|
||||||
if common.is_dynamic_allocation_enabled(task.node):
|
if common.is_dynamic_allocation_enabled(task.node):
|
||||||
deploy_utils.tear_down_cleaning(task)
|
deploy_utils.tear_down_cleaning(task)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@@ -29,6 +30,8 @@ from ironic.conf import CONF
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
oneview_exception = importutils.try_import('oneview_client.exceptions')
|
oneview_exception = importutils.try_import('oneview_client.exceptions')
|
||||||
oneview_utils = importutils.try_import('oneview_client.utils')
|
oneview_utils = importutils.try_import('oneview_client.utils')
|
||||||
|
|
||||||
@@ -39,6 +42,7 @@ class OneViewInspect(inspector.Inspector):
|
|||||||
def get_properties(self):
|
def get_properties(self):
|
||||||
return common.COMMON_PROPERTIES
|
return common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewInspect.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
"""Checks required info on 'driver_info' and validates node with OneView
|
"""Checks required info on 'driver_info' and validates node with OneView
|
||||||
|
|
||||||
@@ -60,6 +64,7 @@ class OneViewInspect(inspector.Inspector):
|
|||||||
except exception.OneViewError as oneview_exc:
|
except exception.OneViewError as oneview_exc:
|
||||||
raise exception.InvalidParameterValue(oneview_exc)
|
raise exception.InvalidParameterValue(oneview_exc)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewInspect.inspect_hardware')
|
||||||
def inspect_hardware(self, task):
|
def inspect_hardware(self, task):
|
||||||
profile_name = 'Ironic Inspecting [%s]' % task.node.uuid
|
profile_name = 'Ironic Inspecting [%s]' % task.node.uuid
|
||||||
deploy_utils.allocate_server_hardware_to_ironic(
|
deploy_utils.allocate_server_hardware_to_ironic(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
@@ -27,6 +28,8 @@ from ironic.drivers.modules.oneview import deploy_utils
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
BOOT_DEVICE_MAPPING_TO_OV = {
|
BOOT_DEVICE_MAPPING_TO_OV = {
|
||||||
boot_devices.DISK: 'HardDisk',
|
boot_devices.DISK: 'HardDisk',
|
||||||
boot_devices.PXE: 'PXE',
|
boot_devices.PXE: 'PXE',
|
||||||
@@ -46,6 +49,7 @@ class OneViewManagement(base.ManagementInterface):
|
|||||||
def get_properties(self):
|
def get_properties(self):
|
||||||
return common.COMMON_PROPERTIES
|
return common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewManagement.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
"""Checks required info on 'driver_info' and validates node with OneView
|
"""Checks required info on 'driver_info' and validates node with OneView
|
||||||
|
|
||||||
@@ -73,6 +77,7 @@ class OneViewManagement(base.ManagementInterface):
|
|||||||
except exception.OneViewError as oneview_exc:
|
except exception.OneViewError as oneview_exc:
|
||||||
raise exception.InvalidParameterValue(oneview_exc)
|
raise exception.InvalidParameterValue(oneview_exc)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewManagement.get_supported_boot_devices')
|
||||||
def get_supported_boot_devices(self, task):
|
def get_supported_boot_devices(self, task):
|
||||||
"""Gets a list of the supported boot devices.
|
"""Gets a list of the supported boot devices.
|
||||||
|
|
||||||
@@ -83,6 +88,7 @@ class OneViewManagement(base.ManagementInterface):
|
|||||||
|
|
||||||
return sorted(BOOT_DEVICE_MAPPING_TO_OV.keys())
|
return sorted(BOOT_DEVICE_MAPPING_TO_OV.keys())
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewManagement.set_boot_device')
|
||||||
@task_manager.require_exclusive_lock
|
@task_manager.require_exclusive_lock
|
||||||
@common.node_has_server_profile
|
@common.node_has_server_profile
|
||||||
def set_boot_device(self, task, device, persistent=False):
|
def set_boot_device(self, task, device, persistent=False):
|
||||||
@@ -121,6 +127,7 @@ class OneViewManagement(base.ManagementInterface):
|
|||||||
)
|
)
|
||||||
raise exception.OneViewError(error=msg)
|
raise exception.OneViewError(error=msg)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewManagement.get_boot_device')
|
||||||
@common.node_has_server_profile
|
@common.node_has_server_profile
|
||||||
def get_boot_device(self, task):
|
def get_boot_device(self, task):
|
||||||
"""Get the current boot device for the task's node.
|
"""Get the current boot device for the task's node.
|
||||||
@@ -164,6 +171,7 @@ class OneViewManagement(base.ManagementInterface):
|
|||||||
|
|
||||||
return boot_device
|
return boot_device
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewManagement.get_sensors_data')
|
||||||
def get_sensors_data(self, task):
|
def get_sensors_data(self, task):
|
||||||
"""Get sensors data.
|
"""Get sensors data.
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
@@ -24,9 +25,10 @@ from ironic.conductor import task_manager
|
|||||||
from ironic.drivers import base
|
from ironic.drivers import base
|
||||||
from ironic.drivers.modules.oneview import common
|
from ironic.drivers.modules.oneview import common
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
|
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
|
||||||
|
|
||||||
|
|
||||||
@@ -35,6 +37,7 @@ class OneViewPower(base.PowerInterface):
|
|||||||
def get_properties(self):
|
def get_properties(self):
|
||||||
return common.COMMON_PROPERTIES
|
return common.COMMON_PROPERTIES
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewPower.validate')
|
||||||
def validate(self, task):
|
def validate(self, task):
|
||||||
"""Checks required info on 'driver_info' and validates node with OneView
|
"""Checks required info on 'driver_info' and validates node with OneView
|
||||||
|
|
||||||
@@ -58,6 +61,7 @@ class OneViewPower(base.PowerInterface):
|
|||||||
except exception.OneViewError as oneview_exc:
|
except exception.OneViewError as oneview_exc:
|
||||||
raise exception.InvalidParameterValue(oneview_exc)
|
raise exception.InvalidParameterValue(oneview_exc)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewPower.get_power_state')
|
||||||
def get_power_state(self, task):
|
def get_power_state(self, task):
|
||||||
"""Gets the current power state.
|
"""Gets the current power state.
|
||||||
|
|
||||||
@@ -82,6 +86,7 @@ class OneViewPower(base.PowerInterface):
|
|||||||
raise exception.OneViewError(error=oneview_exc)
|
raise exception.OneViewError(error=oneview_exc)
|
||||||
return common.translate_oneview_power_state(power_state)
|
return common.translate_oneview_power_state(power_state)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewPower.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):
|
||||||
"""Turn the current power state on or off.
|
"""Turn the current power state on or off.
|
||||||
@@ -119,6 +124,7 @@ class OneViewPower(base.PowerInterface):
|
|||||||
_("Error setting power state: %s") % exc
|
_("Error setting power state: %s") % exc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@METRICS.timer('OneViewPower.reboot')
|
||||||
@task_manager.require_exclusive_lock
|
@task_manager.require_exclusive_lock
|
||||||
def reboot(self, task):
|
def reboot(self, task):
|
||||||
"""Reboot the node
|
"""Reboot the node
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from ironic_lib import metrics_utils
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import retrying
|
import retrying
|
||||||
|
|
||||||
@@ -25,6 +26,9 @@ from ironic.drivers.modules import agent_base_vendor
|
|||||||
from ironic.drivers.modules import deploy_utils
|
from ironic.drivers.modules import deploy_utils
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
METRICS = metrics_utils.get_metrics_logger(__name__)
|
||||||
|
|
||||||
CONF = agent.CONF
|
CONF = agent.CONF
|
||||||
|
|
||||||
|
|
||||||
@@ -36,6 +40,7 @@ CONF = agent.CONF
|
|||||||
# TODO(thiagop): remove this interface once bug/1503855 is fixed
|
# TODO(thiagop): remove this interface once bug/1503855 is fixed
|
||||||
class AgentVendorInterface(agent.AgentVendorInterface):
|
class AgentVendorInterface(agent.AgentVendorInterface):
|
||||||
|
|
||||||
|
@METRICS.timer('AgentVendorInterface.reboot_to_instance')
|
||||||
def reboot_to_instance(self, task, **kwargs):
|
def reboot_to_instance(self, task, **kwargs):
|
||||||
task.process_event('resume')
|
task.process_event('resume')
|
||||||
node = task.node
|
node = task.node
|
||||||
@@ -63,6 +68,7 @@ class AgentVendorInterface(agent.AgentVendorInterface):
|
|||||||
if task.driver.boot:
|
if task.driver.boot:
|
||||||
task.driver.boot.clean_up_ramdisk(task)
|
task.driver.boot.clean_up_ramdisk(task)
|
||||||
|
|
||||||
|
@METRICS.timer('AgentVendorInterface.reboot_and_finish_deploy')
|
||||||
def reboot_and_finish_deploy(self, task):
|
def reboot_and_finish_deploy(self, task):
|
||||||
"""Helper method to trigger reboot on the node and finish deploy.
|
"""Helper method to trigger reboot on the node and finish deploy.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Adds timing metrics to OneView drivers.
|
||||||
Reference in New Issue
Block a user