From 3bd8fe3cfe5f9e9bffb18f0a6ae669bc83c1c665 Mon Sep 17 00:00:00 2001 From: Felipe Rodrigues Date: Wed, 14 Sep 2022 23:31:09 -0300 Subject: [PATCH] Fix Create From Snapshot with Server Limits Share Server limits must be ignored in case the new share is from a snapshot and same host as the parent, since they must be in the same server. Closes-bug: #1918845 Change-Id: I1c611f4a7f3590b571f75ceca17c2fc3d8f3ad7a --- .../admin/shared-file-systems-share-server-management.rst | 6 ++++++ manila/share/manager.py | 6 ++++-- ...eating-from-snapshot-server-limit-7b575c7cbf081efc.yaml | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-creating-from-snapshot-server-limit-7b575c7cbf081efc.yaml diff --git a/doc/source/admin/shared-file-systems-share-server-management.rst b/doc/source/admin/shared-file-systems-share-server-management.rst index 11f592e06e..78ac44a87e 100644 --- a/doc/source/admin/shared-file-systems-share-server-management.rst +++ b/doc/source/admin/shared-file-systems-share-server-management.rst @@ -211,3 +211,9 @@ their size and amount of built instances. If one of these limits is reached during a request that requires a share server to be provided, manila will create a new share server to place such request. + +.. note:: + The limits can be ignored when placing a new share created from parent + snapshot in the same host as the parent. For this scenario, the share server + must be the same, so it does not take the limit in account, reusing the + share server anyway. diff --git a/manila/share/manager.py b/manila/share/manager.py index 2a7bb49db7..03500fae7d 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -704,13 +704,15 @@ class ShareManager(manager.SchedulerDependentManager): except exception.ShareServerNotFound: available_share_servers = None - compatible_share_server = None - if available_share_servers: + # creating from snapshot in the same host must reuse the server, + # so it ignores the server limits. + if available_share_servers and not parent_share_same_dest: available_share_servers = ( self._check_share_server_backend_limits( context, available_share_servers, share_instance=share_instance)) + compatible_share_server = None if available_share_servers: try: compatible_share_server = ( diff --git a/releasenotes/notes/fix-creating-from-snapshot-server-limit-7b575c7cbf081efc.yaml b/releasenotes/notes/fix-creating-from-snapshot-server-limit-7b575c7cbf081efc.yaml new file mode 100644 index 0000000000..ee383b725a --- /dev/null +++ b/releasenotes/notes/fix-creating-from-snapshot-server-limit-7b575c7cbf081efc.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fix creating from snapshot operation with server limits. If the new share + and parent are in the same host, the share server must be resued, so the + limits must be ignored. For more details, please refer to + `launchpad bug #1918845 `_