Merge "Fix Create From Snapshot with Server Limits"

This commit is contained in:
Zuul 2022-09-16 00:00:36 +00:00 committed by Gerrit Code Review
commit f8f89548f3
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 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 server to be provided, manila will create a new share server to place such
request. 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: except exception.ShareServerNotFound:
available_share_servers = None available_share_servers = None
compatible_share_server = None # creating from snapshot in the same host must reuse the server,
if available_share_servers: # so it ignores the server limits.
if available_share_servers and not parent_share_same_dest:
available_share_servers = ( available_share_servers = (
self._check_share_server_backend_limits( self._check_share_server_backend_limits(
context, available_share_servers, context, available_share_servers,
share_instance=share_instance)) share_instance=share_instance))
compatible_share_server = None
if available_share_servers: if available_share_servers:
try: try:
compatible_share_server = ( 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>`_