Fix manage_existing API behaving wrongly with storage pools
When the requested host specifies a pool, Cinder needs to
validate that specified pool in the scheduler
and assign the 'host' attribute appropriately.
Closes-Bug:
@@ -1693,11 +1693,16 @@ class API(base.Base):
if availability_zone is None:
availability_zone = service.availability_zone
+ if not cluster_name and bool(volume_utils.extract_host(host, 'pool')):
+ manage_host = host
+ else:
+ manage_host = service.host
+
manage_what = {
'context': context,
'name': name,
'description': description,
- 'host': service.host,
+ 'host': manage_host,
'cluster_name': service.cluster_name,
'ref': ref,
'volume_type': volume_type,
