better iscsi device path logic
This commit is contained in:
parent
536f954e0a
commit
f607c2a6d5
17
README.md
17
README.md
|
|
@ -336,8 +336,9 @@ with much older versions as well.
|
||||||
The various `freenas-api-*` drivers are currently EXPERIMENTAL and can only be
|
The various `freenas-api-*` drivers are currently EXPERIMENTAL and can only be
|
||||||
used with SCALE 21.08+. Fundamentally these drivers remove the need for `ssh`
|
used with SCALE 21.08+. Fundamentally these drivers remove the need for `ssh`
|
||||||
connections and do all operations entirely with the TrueNAS api. With that in
|
connections and do all operations entirely with the TrueNAS api. With that in
|
||||||
mind, any ssh/shell/etc requirements below can be safely ignored. Also note the
|
mind, any ssh/shell/etc requirements below can be safely ignored. The minimum
|
||||||
following known issues:
|
volume size through the api is `1G` so beware that requested volumes with a
|
||||||
|
size small will be increased to `1G`. Also note the following known issues:
|
||||||
|
|
||||||
- https://jira.ixsystems.com/browse/NAS-111870
|
- https://jira.ixsystems.com/browse/NAS-111870
|
||||||
- https://github.com/democratic-csi/democratic-csi/issues/112
|
- https://github.com/democratic-csi/democratic-csi/issues/112
|
||||||
|
|
@ -539,15 +540,21 @@ Ensure iscsi manager has been installed and is generally setup/configured. DSM 6
|
||||||
|
|
||||||
### objectivefs (objectivefs)
|
### objectivefs (objectivefs)
|
||||||
|
|
||||||
|
ObjectiveFS requires the use of an _Admin Key_ to properly automate the
|
||||||
|
lifecycle of filesystems. Each deployment of the driver will point to a single
|
||||||
|
`pool` (bucket) and create individual `filesystems` within that bucket
|
||||||
|
on-demand.
|
||||||
|
|
||||||
Ensure the config value used for `pool` is an existing bucket. Be sure the
|
Ensure the config value used for `pool` is an existing bucket. Be sure the
|
||||||
bucket is NOT being used in fs mode (ie: the whole bucket is a single fs).
|
bucket is _NOT_ being used in fs mode (ie: the whole bucket is a single fs).
|
||||||
|
|
||||||
The `democratic-csi` `node` container will host the fuse mount process so
|
The `democratic-csi` `node` container will host the fuse mount process so
|
||||||
be careful to only upgrade when all relevant workloads have been drained from
|
be careful to only upgrade when all relevant workloads have been drained from
|
||||||
the respective node. Also beware that any cpu/memory limits placed on the
|
the respective node. Also beware that any cpu/memory limits placed on the
|
||||||
container by the orchestration system will impact any ability to use caching
|
container by the orchestration system will impact any ability to use the
|
||||||
features, etc of objectivefs.
|
caching, etc features of objectivefs.
|
||||||
|
|
||||||
|
- https://objectivefs.com/howto/objectivefs-admin-key-setup
|
||||||
- https://objectivefs.com/features#filesystem-pool
|
- https://objectivefs.com/features#filesystem-pool
|
||||||
- https://objectivefs.com/howto/how-to-create-a-filesystem-with-an-existing-empty-bucket
|
- https://objectivefs.com/howto/how-to-create-a-filesystem-with-an-existing-empty-bucket
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -912,12 +912,15 @@ class CsiBaseDriver {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sessionParsedPortal = iscsi.parsePortal(session.portal);
|
||||||
|
|
||||||
// rescan in scenarios when login previously occurred but volumes never appeared
|
// rescan in scenarios when login previously occurred but volumes never appeared
|
||||||
await iscsi.iscsiadm.rescanSession(session);
|
await iscsi.iscsiadm.rescanSession(session);
|
||||||
|
|
||||||
// find device name
|
// find device name
|
||||||
device = iscsi.devicePathByPortalIQNLUN(
|
device = await iscsi.devicePathByPortalIQNLUN(
|
||||||
iscsiConnection.portal,
|
//iscsiConnection.portal,
|
||||||
|
`${sessionParsedPortal.host}:${sessionParsedPortal.port}`,
|
||||||
iscsiConnection.iqn,
|
iscsiConnection.iqn,
|
||||||
iscsiConnection.lun
|
iscsiConnection.lun
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -583,11 +583,12 @@ class ISCSI {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
devicePathByPortalIQNLUN(portal, iqn, lun) {
|
async devicePathByPortalIQNLUN(portal, iqn, lun, options = {}) {
|
||||||
const parsedPortal = this.parsePortal(portal);
|
const parsedPortal = this.parsePortal(portal);
|
||||||
const portalHost = parsedPortal.host
|
let portalHost = parsedPortal.host.replaceAll("[", "").replaceAll("]", "");
|
||||||
.replaceAll("[", "")
|
if (options.hostname_lookup && net.isIP(portalHost) == 0) {
|
||||||
.replaceAll("]", "");
|
portalHost = (await hostname_lookup(portalHost)) || portalHost;
|
||||||
|
}
|
||||||
return `/dev/disk/by-path/ip-${portalHost}:${parsedPortal.port}-iscsi-${iqn}-lun-${lun}`;
|
return `/dev/disk/by-path/ip-${portalHost}:${parsedPortal.port}-iscsi-${iqn}-lun-${lun}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue