]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Improve debug logging of Dell Storage Center driver
authorSean McGinnis <sean_mcginnis@dell.com>
Tue, 20 Jan 2015 22:50:19 +0000 (16:50 -0600)
committerSean McGinnis <sean_mcginnis@dell.com>
Thu, 22 Jan 2015 17:08:39 +0000 (11:08 -0600)
Adding debug message and expanding some existing log statements
to make debugging and auditing easier. Some interesting calls
were not being logged while others had logging that was missing
some relevant arguments.

Change-Id: Iad5ceb9305aa5b03f429a8f624eb7f51d0ca6814

cinder/volume/drivers/dell/dell_storagecenter_api.py
cinder/volume/drivers/dell/dell_storagecenter_common.py

index 7e0060f2021d0bcb7afac3541ed86fc91bbd94b9..5c9d146afb1b0be3a9a2a1c2d64e182f3e58e3d6 100644 (file)
@@ -176,6 +176,7 @@ class StorageCenterApi(object):
             LOG.debug('Unable to find result where %(attr)s is %(val)s',
                       {'attr': attribute,
                        'val': value})
+            LOG.debug('Blob was %(blob)s', {'blob': blob})
         return rsp
 
     def _get_json(self, blob):
@@ -346,7 +347,7 @@ class StorageCenterApi(object):
             # Sort through the servers looking for one with connectivity.
             for scserver in scservers:
                 if scserver.get('status', '').lower() != 'down':
-                    # map to actually create the volume
+                    # Map to actually create the volume
                     self.map_volume(scvolume,
                                     scserver)
                     self.unmap_volume(scvolume,
@@ -939,6 +940,7 @@ class StorageCenterApi(object):
         once marked for expiration we do not return the replay as
         a snapshot.
         '''
+        LOG.debug('Expiring replay %s', replayid)
         replay = self.find_replay(scvolume,
                                   replayid)
         if replay is not None:
index 55c690f3497217c16476b96e4a89b4ad39db3500..bfd181cdaae435da26cd90583d5e6faec685f121 100644 (file)
@@ -86,19 +86,20 @@ class DellCommonDriver(san.SanDriver):
 
     def create_volume(self, volume):
         '''Create a volume.'''
-        LOG.debug('create_volume')
+        volume_name = volume.get('id')
+        volume_size = volume.get('size')
+        LOG.debug('Creating volume %(name)s of size %(size)s',
+                  {'name': volume_name, 'size': volume_size})
         scvolume = None
         with self._client.open_connection() as api:
             try:
                 # we use id as our name as it s unique
-                volume_name = volume['id']
-                volume_size = volume['size']
                 volume_folder = self.configuration.dell_sc_volume_folder
                 ssn = api.find_sc(self.configuration.dell_sc_ssn)
-                LOG.debug('cv: %(name)s : %(size)s : %(ssn)s',
+                LOG.debug('create_volume: %(name)s on %(ssn)s in %(vf)s',
                           {'name': volume_name,
-                           'size': volume_size,
-                           'ssn': ssn})
+                           'ssn': ssn,
+                           'vf': volume_folder})
                 if ssn is not None:
                     scvolume = api.create_volume(volume_name,
                                                  volume_size,
@@ -110,12 +111,13 @@ class DellCommonDriver(san.SanDriver):
                               volume['name'])
         if scvolume is None:
             raise exception.VolumeBackendAPIException(
-                _('unable to create volume'))
+                _('Unable to create volume'))
 
     def delete_volume(self, volume):
         deleted = False
         # we use id as our name as it s unique
         volume_name = volume.get('id')
+        LOG.debug('Deleting volume %s', volume_name)
         with self._client.open_connection() as api:
             try:
                 ssn = api.find_sc(self.configuration.dell_sc_ssn)
@@ -138,6 +140,8 @@ class DellCommonDriver(san.SanDriver):
         # our volume name is the volume id
         volume_name = snapshot.get('volume_id')
         snapshot_id = snapshot.get('id')
+        LOG.debug('Creating snapshot %(snap)s on volume %(vol)s',
+                  {'snap': snapshot_id, 'vol': volume_name})
         with self._client.open_connection() as api:
             ssn = api.find_sc(self.configuration.dell_sc_ssn)
             if ssn is not None:
@@ -164,6 +168,12 @@ class DellCommonDriver(san.SanDriver):
         src_volume_name = snapshot.get('volume_id')
         snapshot_id = snapshot.get('id')
         volume_name = volume.get('id')
+        LOG.debug(
+            'Creating new volume %(vol)s from snapshot %(snap)s '
+            'from vol %(src)s',
+            {'vol': volume_name,
+             'snap': snapshot_id,
+             'src': src_volume_name})
         with self._client.open_connection() as api:
             try:
                 volume_folder = self.configuration.dell_sc_volume_folder
@@ -192,10 +202,12 @@ class DellCommonDriver(san.SanDriver):
 
     def create_cloned_volume(self, volume, src_vref):
         '''Creates a clone of the specified volume.'''
-        LOG.debug('create_cloned_volume')
         scvolume = None
         src_volume_name = src_vref.get('id')
         volume_name = volume.get('id')
+        LOG.debug('Creating cloned volume %(clone)s from volume %(vol)s',
+                  {'clone': volume_name,
+                   'vol': src_volume_name})
         with self._client.open_connection() as api:
             try:
                 volume_folder = self.configuration.dell_sc_volume_folder
@@ -222,6 +234,9 @@ class DellCommonDriver(san.SanDriver):
         '''delete_snapshot'''
         volume_name = snapshot.get('volume_id')
         snapshot_id = snapshot.get('id')
+        LOG.debug('Deleting snapshot %(snap)s from volume %(vol)s',
+                  {'snap': snapshot_id,
+                   'vol': volume_name})
         with self._client.open_connection() as api:
             ssn = api.find_sc(self.configuration.dell_sc_ssn)
             if ssn is not None:
@@ -252,6 +267,7 @@ class DellCommonDriver(san.SanDriver):
         '''
         scvolume = None
         volume_name = volume.get('id')
+        LOG.debug('Checking existence of volume %s', volume_name)
         with self._client.open_connection() as api:
             try:
                 ssn = api.find_sc(self.configuration.dell_sc_ssn)
@@ -277,6 +293,8 @@ class DellCommonDriver(san.SanDriver):
     def extend_volume(self, volume, new_size):
         '''Extend the size of the volume.'''
         volume_name = volume.get('id')
+        LOG.debug('Extending volume %(vol)s to %(size)s',
+                  {'vol': volume_name, 'size': new_size})
         if volume is not None:
             with self._client.open_connection() as api:
                 ssn = api.find_sc(self.configuration.dell_sc_ssn)