Skip to content

Commit b27512c

Browse files
author
Eugenio Grosso
committed
adaptive: pick NVMeTCP pool type when transport=nvme-tcp
The adaptive storage framework hard-coded FiberChannel as the KVM-side pool type for every provider it fronts. With a separate NVMeTCP pool type now available (and a dedicated NVMe-oF adapter on the KVM side), teach the lifecycle to route a pool to the right adapter based on a transport= URL parameter: https://user:pass@host/api?...&transport=nvme-tcp -> StoragePoolType.NVMeTCP -> NVMeTCPAdapter on the KVM host When the query parameter is absent the default stays FiberChannel, so existing FC deployments on Primera or FlashArray continue to work unchanged. The choice is made in the shared AdaptiveDataStoreLifeCycleImpl rather than inside each vendor plugin so every adaptive provider (FlashArray, Primera, any future one) speaks the same configuration vocabulary.
1 parent 20ba972 commit b27512c

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

plugins/storage/volume/adaptive/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/AdaptiveDataStoreLifeCycleImpl.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public DataStore initialize(Map<String, Object> dsInfos) {
179179
parameters.setHost(uri.getHost());
180180
parameters.setPort(uri.getPort());
181181
parameters.setPath(uri.getPath() + "?" + uri.getQuery());
182-
parameters.setType(StoragePoolType.FiberChannel);
182+
parameters.setType(pickPoolType(uri));
183183
parameters.setZoneId(zoneId);
184184
parameters.setPodId(podId);
185185
parameters.setClusterId(clusterId);
@@ -401,4 +401,26 @@ public void disableStoragePool(DataStore store) {
401401
logger.info("Disabling storage pool {}", store);
402402
_dataStoreHelper.disable(store);
403403
}
404+
405+
/**
406+
* Resolve the CloudStack StoragePoolType from the provider URL. Adaptive
407+
* plugins advertise the underlying fabric via a {@code transport=} query
408+
* parameter on the URL; when absent we keep the legacy FiberChannel
409+
* default for backwards compatibility with adapters that still assume it.
410+
*/
411+
private static StoragePoolType pickPoolType(java.net.URL uri) {
412+
String query = uri.getQuery();
413+
if (query != null) {
414+
for (String tok : query.split("&")) {
415+
int i = tok.indexOf('=');
416+
if (i > 0 && "transport".equalsIgnoreCase(tok.substring(0, i))) {
417+
String value = tok.substring(i + 1);
418+
if ("nvme-tcp".equalsIgnoreCase(value)) {
419+
return StoragePoolType.NVMeTCP;
420+
}
421+
}
422+
}
423+
}
424+
return StoragePoolType.FiberChannel;
425+
}
404426
}

0 commit comments

Comments
 (0)