mirror of https://github.com/apache/cloudstack.git
adapter: add NVMETCP address type and FlashArrayConnection.nsid
Preparatory data-model changes for NVMe-TCP support on the adaptive
storage framework. No behaviour change for existing Fibre Channel
users - the extra enum value, field, and getter/setter are only
exercised by callers that explicitly use them.
ProviderVolume.AddressType gains a NVMETCP value alongside FIBERWWN,
so adapters can declare that a volume is addressed by an NVMe EUI-128
(NGUID) rather than a SCSI WWN.
FlashArrayVolume.getAddress() produces the NGUID layout expected by
the Linux kernel for a FlashArray NVMe namespace:
00 + serial[0:14] + 24a937 (Pure 6-hex OUI) + serial[14:24]
which matches the /dev/disk/by-id/nvme-eui.<id> symlink emitted by
udev. Fibre Channel callers (addressType != NVMETCP) still get the
existing 6 + 24a9370 + serial form.
FlashArrayConnection gains a nsid field to carry the namespace id the
FlashArray REST API attaches to host-group-scoped NVMe connections,
when it is present.
This commit is contained in:
parent
3166e64891
commit
c3c0f0cedd
|
|
@ -35,6 +35,7 @@ public interface ProviderVolume {
|
|||
public String getExternalName();
|
||||
public String getExternalConnectionId();
|
||||
public enum AddressType {
|
||||
FIBERWWN
|
||||
FIBERWWN,
|
||||
NVMETCP
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ public class FlashArrayConnection {
|
|||
private FlashArrayVolume volume;
|
||||
@JsonProperty("lun")
|
||||
private Integer lun;
|
||||
@JsonProperty("nsid")
|
||||
private Integer nsid;
|
||||
|
||||
public FlashArrayConnectionHostgroup getHostGroup() {
|
||||
return hostGroup;
|
||||
|
|
@ -64,5 +66,12 @@ public class FlashArrayConnection {
|
|||
this.lun = lun;
|
||||
}
|
||||
|
||||
public Integer getNsid() {
|
||||
return nsid;
|
||||
}
|
||||
|
||||
public void setNsid(Integer nsid) {
|
||||
this.nsid = nsid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class FlashArrayVolume implements ProviderSnapshot {
|
||||
public static final String PURE_OUI = "24a9370";
|
||||
// The 3-byte OUI as it appears inside an NVMe EUI-128 (no trailing nibble).
|
||||
// FC WWNs use a 7-hex-digit Pure OUI; NVMe NGUIDs embed the same vendor
|
||||
// prefix in its raw 6-hex-digit form.
|
||||
public static final String PURE_OUI_EUI = "24a937";
|
||||
|
||||
@JsonProperty("destroyed")
|
||||
private Boolean destroyed;
|
||||
|
|
@ -107,6 +111,13 @@ public class FlashArrayVolume implements ProviderSnapshot {
|
|||
@JsonIgnore
|
||||
public String getAddress() {
|
||||
if (serial == null) return null;
|
||||
if (AddressType.NVMETCP.equals(addressType)) {
|
||||
// EUI-128 layout for FlashArray NVMe namespaces:
|
||||
// 00 + serial[0:14] + <Pure OUI (24a937)> + serial[14:24]
|
||||
// This is the value the Linux kernel exposes as
|
||||
// /dev/disk/by-id/nvme-eui.<result>
|
||||
return ("00" + serial.substring(0, 14) + PURE_OUI_EUI + serial.substring(14)).toLowerCase();
|
||||
}
|
||||
return ("6" + PURE_OUI + serial).toLowerCase();
|
||||
}
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue