Merge "Add some debug logs to storage model"

This commit is contained in:
Zuul
2025-10-09 14:23:51 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -475,6 +475,8 @@ class StorageModelRoot(nx.DiGraph, base.Model):
try:
return self._get_by_uuid(uuid)
except exception.StorageResourceNotFound:
LOG.debug("Volume %(volume)s not found in the model",
dict(volume=uuid))
raise exception.VolumeNotFound(name=uuid)
def _get_by_uuid(self, uuid):
@@ -519,7 +521,8 @@ class StorageModelRoot(nx.DiGraph, base.Model):
pool = self._get_by_name(p)
if isinstance(pool, element.Pool):
return pool
raise exception.PoolNotFound(name=volume.uuid)
msg = f"for volume {volume.uuid}"
raise exception.PoolNotFound(name=msg)
@lockutils.synchronized("storage_model")
def get_all_volumes(self):

View File

@@ -143,6 +143,8 @@ class CinderNotification(base.NotificationEndpoint):
try:
return self.cluster_data_model.get_volume_by_uuid(volume_id)
except exception.VolumeNotFound:
LOG.debug("Volume %(volume)s not found in the model, creating it",
dict(volume=volume_id))
# The volume didn't exist yet so we create a new volume object
volume = element.Volume(uuid=volume_id)
self.cluster_data_model.add_volume(volume)