-
Notifications
You must be signed in to change notification settings - Fork 1.4k
flasharray/kvm/adaptive: NVMe-TCP transport for FlashArray primary storage #13061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e861680
b6fe9f4
11aa58d
07be549
578c933
f192351
77dc400
cc360cf
deb7a3e
f3804b8
81147db
ca9ca20
43a15b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| package com.cloud.hypervisor.kvm.storage; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| import org.apache.cloudstack.utils.qemu.QemuImg; | ||
| import org.apache.cloudstack.utils.qemu.QemuImg.PhysicalDiskFormat; | ||
| import org.joda.time.Duration; | ||
|
|
||
| import com.cloud.agent.api.to.HostTO; | ||
| import com.cloud.hypervisor.kvm.resource.KVMHABase.HAStoragePool; | ||
| import com.cloud.storage.Storage; | ||
| import com.cloud.storage.Storage.ProvisioningType; | ||
|
|
||
| /** | ||
| * KVMStoragePool for NVMe-over-Fabrics pools. Mirror of | ||
| * {@link MultipathSCSIPool} for adapters based on | ||
| * {@link MultipathNVMeOFAdapterBase}. Every data operation is delegated | ||
| * back to the adapter; the pool itself only tracks addressing/identity. | ||
| */ | ||
| public class MultipathNVMeOFPool implements KVMStoragePool { | ||
| private final String uuid; | ||
| private final String sourceHost; | ||
| private final int sourcePort; | ||
| private final String sourceDir; | ||
| private final Storage.StoragePoolType storagePoolType; | ||
| private final StorageAdaptor storageAdaptor; | ||
| private final Map<String, String> details; | ||
| private long capacity; | ||
| private long used; | ||
| private long available; | ||
|
|
||
| public MultipathNVMeOFPool(String uuid, String host, int port, String path, | ||
| Storage.StoragePoolType poolType, Map<String, String> poolDetails, StorageAdaptor adaptor) { | ||
| this.uuid = uuid; | ||
| this.sourceHost = host; | ||
| this.sourcePort = port; | ||
| this.sourceDir = path; | ||
| this.storagePoolType = poolType; | ||
| this.storageAdaptor = adaptor; | ||
| this.details = poolDetails; | ||
| this.capacity = 0; | ||
| this.used = 0; | ||
| this.available = 0; | ||
| } | ||
|
|
||
| public MultipathNVMeOFPool(String uuid, StorageAdaptor adaptor) { | ||
| this.uuid = uuid; | ||
| this.sourceHost = null; | ||
| this.sourcePort = -1; | ||
| this.sourceDir = null; | ||
| this.storagePoolType = Storage.StoragePoolType.NVMeTCP; | ||
| this.storageAdaptor = adaptor; | ||
| this.details = new HashMap<>(); | ||
| this.capacity = 0; | ||
| this.used = 0; | ||
| this.available = 0; | ||
| } | ||
|
|
||
| @Override | ||
| public KVMPhysicalDisk createPhysicalDisk(String volumeUuid, ProvisioningType provisioningType, long size, byte[] passphrase) { | ||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
| public KVMPhysicalDisk createPhysicalDisk(String volumeUuid, PhysicalDiskFormat format, ProvisioningType provisioningType, long size, byte[] passphrase) { | ||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean connectPhysicalDisk(String volumeUuid, Map<String, String> details) { | ||
| return storageAdaptor.connectPhysicalDisk(volumeUuid, this, details, false); | ||
| } | ||
|
|
||
| @Override | ||
| public KVMPhysicalDisk getPhysicalDisk(String volumeId) { | ||
| return storageAdaptor.getPhysicalDisk(volumeId, this); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean disconnectPhysicalDisk(String volumeUuid) { | ||
| return storageAdaptor.disconnectPhysicalDisk(volumeUuid, this); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean deletePhysicalDisk(String volumeUuid, Storage.ImageFormat format) { | ||
| return true; | ||
| } | ||
|
Comment on lines
+103
to
+106
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to keep this one as It matches the sibling adapter. Nothing is actually leaked here. For managed storage the namespace is deleted on the provider side: the management server drives Worth noting too that all three in-tree callers ignore the return value — Happy to switch both classes together if a maintainer would rather have the stricter contract — I just don't want to introduce a new failure mode in this PR for a path I can't exercise. |
||
|
|
||
| @Override | ||
| public List<KVMPhysicalDisk> listPhysicalDisks() { | ||
| return null; | ||
| } | ||
|
DaanHoogland marked this conversation as resolved.
|
||
|
|
||
| @Override | ||
| public String getUuid() { | ||
| return uuid; | ||
| } | ||
|
|
||
| public void setCapacity(long capacity) { this.capacity = capacity; } | ||
| @Override public long getCapacity() { return this.capacity; } | ||
| public void setUsed(long used) { this.used = used; } | ||
| @Override public long getUsed() { return this.used; } | ||
| public void setAvailable(long available) { this.available = available; } | ||
| @Override public long getAvailable() { return this.available; } | ||
|
|
||
| @Override public boolean refresh() { return false; } | ||
| @Override public boolean isExternalSnapshot() { return true; } | ||
| @Override public String getLocalPath() { return null; } | ||
| @Override public String getSourceHost() { return this.sourceHost; } | ||
| @Override public String getSourceDir() { return this.sourceDir; } | ||
| @Override public int getSourcePort() { return this.sourcePort; } | ||
| @Override public String getAuthUserName() { return null; } | ||
| @Override public String getAuthSecret() { return null; } | ||
| @Override public Storage.StoragePoolType getType() { return storagePoolType; } | ||
| @Override public boolean delete() { return false; } | ||
| @Override public QemuImg.PhysicalDiskFormat getDefaultFormat() { return QemuImg.PhysicalDiskFormat.RAW; } | ||
| @Override public boolean createFolder(String path) { return false; } | ||
| @Override public boolean supportsConfigDriveIso() { return false; } | ||
| @Override public Map<String, String> getDetails() { return this.details; } | ||
| @Override public boolean isPoolSupportHA() { return false; } | ||
| @Override public String getHearthBeatPath() { return null; } | ||
|
|
||
| @Override | ||
| public String createHeartBeatCommand(HAStoragePool primaryStoragePool, String hostPrivateIp, boolean hostValidation) { | ||
| return null; | ||
| } | ||
|
|
||
| @Override public String getStorageNodeId() { return null; } | ||
|
|
||
| @Override | ||
| public Boolean hasHeartBeat(HAStoragePool pool, HostTO host) { return null; } | ||
|
|
||
| @Override | ||
| public Boolean hasVmActivity(HAStoragePool pool, HostTO host, Duration activityScriptTimeout, | ||
| String volumeUUIDListString, String vmActivityCheckPath, long duration) { | ||
| return null; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| package com.cloud.hypervisor.kvm.storage; | ||
|
|
||
| import com.cloud.storage.Storage; | ||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
|
|
||
| /** | ||
| * StorageAdaptor for the {@link Storage.StoragePoolType#NVMeTCP} pool type. | ||
| * All operational logic lives in {@link MultipathNVMeOFAdapterBase}; this | ||
| * class just binds that logic to a pool type so | ||
| * {@link KVMStoragePoolManager} can find it via reflection. | ||
| */ | ||
| public class NVMeTCPAdapter extends MultipathNVMeOFAdapterBase { | ||
| private static final Logger LOGGER = LogManager.getLogger(NVMeTCPAdapter.class); | ||
|
|
||
| public NVMeTCPAdapter() { | ||
| LOGGER.info("Loaded NVMeTCPAdapter for StorageLayer"); | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return "NVMeTCPAdapter"; | ||
| } | ||
|
|
||
| @Override | ||
| public Storage.StoragePoolType getStoragePoolType() { | ||
| return Storage.StoragePoolType.NVMeTCP; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isStoragePoolTypeSupported(Storage.StoragePoolType type) { | ||
| return Storage.StoragePoolType.NVMeTCP.equals(type); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.