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
This commit is contained in:
Felipe Rodrigues 2022-09-14 23:31:09 -03:00
parent 6e8ed59a91
commit 3bd8fe3cfe
3 changed files with 17 additions and 2 deletions

View File

@ -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.

View File

@ -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 = (

View File

@ -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 <https://bugs.launchpad.net/manila/+bug/1918845>`_