From 9a3c7a16a1b13fed2dc0aaf0ffd96fb2fb6dc838 Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Thu, 7 Jul 2016 09:30:11 -0700 Subject: [PATCH] 3PAR add entry point debug tracing This patch adds the cinder.utils.trace decorator to the 3PAR driver entry points. Change-Id: I5173f97f867fad1dc079bcdeb26d8ead6839bcb4 --- cinder/volume/drivers/hpe/hpe_3par_fc.py | 30 ++++++++++++++++++- cinder/volume/drivers/hpe/hpe_3par_iscsi.py | 33 ++++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/cinder/volume/drivers/hpe/hpe_3par_fc.py b/cinder/volume/drivers/hpe/hpe_3par_fc.py index e106d69c5..553a23597 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_fc.py +++ b/cinder/volume/drivers/hpe/hpe_3par_fc.py @@ -40,6 +40,7 @@ from oslo_utils.excutils import save_and_reraise_exception from cinder import exception from cinder.i18n import _, _LI, _LW, _LE from cinder import interface +from cinder import utils from cinder.volume import driver from cinder.volume.drivers.hpe import hpe_3par_common as hpecommon from cinder.volume.drivers.san import san @@ -111,10 +112,11 @@ class HPE3PARFCDriver(driver.TransferVD, host sees. bug #1577993 3.0.9 - Handling HTTP conflict 409, host WWN/iSCSI name already used by another host, while creating 3PAR FC Host. bug #1597454 + 3.0.10 - Added Entry point tracing """ - VERSION = "3.0.9" + VERSION = "3.0.10" def __init__(self, *args, **kwargs): super(HPE3PARFCDriver, self).__init__(*args, **kwargs) @@ -185,6 +187,7 @@ class HPE3PARFCDriver(driver.TransferVD, """Setup errors are already checked for in do_setup so return pass.""" pass + @utils.trace def create_volume(self, volume): common = self._login() try: @@ -192,6 +195,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_cloned_volume(self, volume, src_vref): common = self._login() try: @@ -199,6 +203,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_volume(self, volume): common = self._login() try: @@ -206,6 +211,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_volume_from_snapshot(self, volume, snapshot): """Create a volume from a snapshot. @@ -217,6 +223,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_snapshot(self, snapshot): common = self._login() try: @@ -224,6 +231,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_snapshot(self, snapshot): common = self._login() try: @@ -231,6 +239,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace @fczm_utils.AddFCZone def initialize_connection(self, volume, connector): """Assigns the volume to a server. @@ -353,6 +362,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace @fczm_utils.RemoveFCZone def terminate_connection(self, volume, connector, **kwargs): """Driver entry point to unattach a volume from an instance.""" @@ -537,6 +547,7 @@ class HPE3PARFCDriver(driver.TransferVD, def remove_export(self, context, volume): pass + @utils.trace def extend_volume(self, volume, new_size): common = self._login() try: @@ -544,6 +555,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_consistencygroup(self, context, group): common = self._login() try: @@ -551,6 +563,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_consistencygroup_from_src(self, context, group, volumes, cgsnapshot=None, snapshots=None, source_cg=None, source_vols=None): @@ -562,6 +575,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_consistencygroup(self, context, group, volumes): common = self._login() try: @@ -569,6 +583,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def update_consistencygroup(self, context, group, add_volumes=None, remove_volumes=None): common = self._login() @@ -578,6 +593,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_cgsnapshot(self, context, cgsnapshot, snapshots): common = self._login() try: @@ -585,6 +601,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_cgsnapshot(self, context, cgsnapshot, snapshots): common = self._login() try: @@ -592,6 +609,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing(self, volume, existing_ref): common = self._login() try: @@ -599,6 +617,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing_snapshot(self, snapshot, existing_ref): common = self._login() try: @@ -606,6 +625,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing_get_size(self, volume, existing_ref): common = self._login() try: @@ -613,6 +633,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing_snapshot_get_size(self, snapshot, existing_ref): common = self._login() try: @@ -621,6 +642,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def unmanage(self, volume): common = self._login() try: @@ -628,6 +650,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def unmanage_snapshot(self, snapshot): common = self._login() try: @@ -635,6 +658,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def retype(self, context, volume, new_type, diff, host): """Convert the volume to be of the new type.""" common = self._login() @@ -643,6 +667,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def migrate_volume(self, context, volume, host): if volume['status'] == 'in-use': protocol = host['capabilities']['storage_protocol'] @@ -657,6 +682,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def update_migrated_volume(self, context, volume, new_volume, original_volume_status): """Update the name of the migrated volume to it's new ID.""" @@ -667,6 +693,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def get_pool(self, volume): common = self._login() try: @@ -678,6 +705,7 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def failover_host(self, context, volumes, secondary_id=None): """Force failover to a secondary replication target.""" common = self._login(timeout=30) diff --git a/cinder/volume/drivers/hpe/hpe_3par_iscsi.py b/cinder/volume/drivers/hpe/hpe_3par_iscsi.py index 43c3414d9..75397502c 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_iscsi.py +++ b/cinder/volume/drivers/hpe/hpe_3par_iscsi.py @@ -40,6 +40,7 @@ from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LE, _LW from cinder import interface +from cinder import utils from cinder.volume import driver from cinder.volume.drivers.hpe import hpe_3par_common as hpecommon from cinder.volume.drivers.san import san @@ -117,10 +118,11 @@ class HPE3PARISCSIDriver(driver.TransferVD, 3.0.10 - Remove metadata that tracks the instance ID. bug #1572665 3.0.11 - _create_3par_iscsi_host() now accepts iscsi_iqn as list only. Bug #1590180 + 3.0.12 - Added entry point tracing """ - VERSION = "3.0.11" + VERSION = "3.0.12" def __init__(self, *args, **kwargs): super(HPE3PARISCSIDriver, self).__init__(*args, **kwargs) @@ -164,6 +166,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, 'san_password'] common.check_flags(self.configuration, required_flags) + @utils.trace def get_volume_stats(self, refresh=False): common = self._login() try: @@ -257,6 +260,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, """Setup errors are already checked for in do_setup so return pass.""" pass + @utils.trace def create_volume(self, volume): common = self._login() try: @@ -264,6 +268,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_cloned_volume(self, volume, src_vref): """Clone an existing volume.""" common = self._login() @@ -272,6 +277,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_volume(self, volume): common = self._login() try: @@ -279,6 +285,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_volume_from_snapshot(self, volume, snapshot): """Creates a volume from a snapshot. @@ -290,6 +297,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_snapshot(self, snapshot): common = self._login() try: @@ -297,6 +305,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_snapshot(self, snapshot): common = self._login() try: @@ -304,6 +313,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def initialize_connection(self, volume, connector): """Assigns the volume to a server. @@ -460,6 +470,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def terminate_connection(self, volume, connector, **kwargs): """Driver entry point to unattach a volume from an instance.""" common = self._login() @@ -665,6 +676,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, return model_update + @utils.trace def create_export(self, context, volume, connector): common = self._login() try: @@ -672,6 +684,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def ensure_export(self, context, volume): """Ensure the volume still exists on the 3PAR. @@ -779,6 +792,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, return current_least_used_nsp + @utils.trace def extend_volume(self, volume, new_size): common = self._login() try: @@ -786,6 +800,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_consistencygroup(self, context, group): common = self._login() try: @@ -793,6 +808,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_consistencygroup_from_src(self, context, group, volumes, cgsnapshot=None, snapshots=None, source_cg=None, source_vols=None): @@ -804,6 +820,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_consistencygroup(self, context, group, volumes): common = self._login() try: @@ -811,6 +828,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def update_consistencygroup(self, context, group, add_volumes=None, remove_volumes=None): common = self._login() @@ -820,6 +838,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def create_cgsnapshot(self, context, cgsnapshot, snapshots): common = self._login() try: @@ -827,6 +846,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def delete_cgsnapshot(self, context, cgsnapshot, snapshots): common = self._login() try: @@ -834,6 +854,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing(self, volume, existing_ref): common = self._login() try: @@ -841,6 +862,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing_snapshot(self, snapshot, existing_ref): common = self._login() try: @@ -848,6 +870,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing_get_size(self, volume, existing_ref): common = self._login() try: @@ -855,6 +878,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def manage_existing_snapshot_get_size(self, snapshot, existing_ref): common = self._login() try: @@ -863,6 +887,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def unmanage(self, volume): common = self._login() try: @@ -870,6 +895,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def unmanage_snapshot(self, snapshot): common = self._login() try: @@ -877,6 +903,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def retype(self, context, volume, new_type, diff, host): """Convert the volume to be of the new type.""" common = self._login() @@ -885,6 +912,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def migrate_volume(self, context, volume, host): if volume['status'] == 'in-use': protocol = host['capabilities']['storage_protocol'] @@ -899,6 +927,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def update_migrated_volume(self, context, volume, new_volume, original_volume_status): """Update the name of the migrated volume to it's new ID.""" @@ -909,6 +938,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def get_pool(self, volume): common = self._login() try: @@ -920,6 +950,7 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) + @utils.trace def failover_host(self, context, volumes, secondary_id=None): """Force failover to a secondary replication target.""" common = self._login(timeout=30)