From b27512c431fe344564f3813308b9bdccce66a02e Mon Sep 17 00:00:00 2001 From: Eugenio Grosso Date: Mon, 20 Apr 2026 22:50:09 +0000 Subject: [PATCH] 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. --- .../AdaptiveDataStoreLifeCycleImpl.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/plugins/storage/volume/adaptive/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/AdaptiveDataStoreLifeCycleImpl.java b/plugins/storage/volume/adaptive/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/AdaptiveDataStoreLifeCycleImpl.java index 771f79887e0..42c832ec1e4 100644 --- a/plugins/storage/volume/adaptive/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/AdaptiveDataStoreLifeCycleImpl.java +++ b/plugins/storage/volume/adaptive/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/AdaptiveDataStoreLifeCycleImpl.java @@ -179,7 +179,7 @@ public class AdaptiveDataStoreLifeCycleImpl extends BasePrimaryDataStoreLifeCycl parameters.setHost(uri.getHost()); parameters.setPort(uri.getPort()); parameters.setPath(uri.getPath() + "?" + uri.getQuery()); - parameters.setType(StoragePoolType.FiberChannel); + parameters.setType(pickPoolType(uri)); parameters.setZoneId(zoneId); parameters.setPodId(podId); parameters.setClusterId(clusterId); @@ -401,4 +401,26 @@ public class AdaptiveDataStoreLifeCycleImpl extends BasePrimaryDataStoreLifeCycl logger.info("Disabling storage pool {}", store); _dataStoreHelper.disable(store); } + + /** + * Resolve the CloudStack StoragePoolType from the provider URL. Adaptive + * plugins advertise the underlying fabric via a {@code transport=} query + * parameter on the URL; when absent we keep the legacy FiberChannel + * default for backwards compatibility with adapters that still assume it. + */ + private static StoragePoolType pickPoolType(java.net.URL uri) { + String query = uri.getQuery(); + if (query != null) { + for (String tok : query.split("&")) { + int i = tok.indexOf('='); + if (i > 0 && "transport".equalsIgnoreCase(tok.substring(0, i))) { + String value = tok.substring(i + 1); + if ("nvme-tcp".equalsIgnoreCase(value)) { + return StoragePoolType.NVMeTCP; + } + } + } + } + return StoragePoolType.FiberChannel; + } }