Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cinder/scheduler/host_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,25 @@ def update_pools(self, capability: Optional[dict], service) -> None:
self.pools[pool_name] = cur_pool
cur_pool.update_from_volume_capability(pool_cap, service)

active_pools.add(pool_name)
elif isinstance(pools, list) and len(pools) == 0:
# Driver supports pools but reported none (e.g. vCenter
# connectivity issue). Preserve existing pools but mark
# them down so the scheduler won't place volumes on them.
# Without this branch, an empty list [] evaluates to False
# and skips the first branch, but is not None so skips
# the legacy branch too -- leaving active_pools empty and
# wiping all cached pools. On the next stats report, if
# pools is still empty or None, the legacy path creates a
# single synthetic pool named after volume_backend_name
# (e.g. #vmware). Volumes scheduled to this synthetic
# pool can never be created because it does not correspond
# to any real datastore.
LOG.warning("Backend %(host)s reported an empty pools list. "
"Marking all pools as down.",
{'host': self.host})
for pool_name, pool in self.pools.items():
pool.pool_state = 'down'
active_pools.add(pool_name)
elif pools is None:
# To handle legacy driver that doesn't report pool
Expand Down