diff --git a/README.md b/README.md index 3cee2a3..c18e630 100644 --- a/README.md +++ b/README.md @@ -336,8 +336,9 @@ with much older versions as well. 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` 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 -following known issues: +mind, any ssh/shell/etc requirements below can be safely ignored. The minimum +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://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 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 -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 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 -container by the orchestration system will impact any ability to use caching -features, etc of objectivefs. +container by the orchestration system will impact any ability to use the +caching, etc features of objectivefs. +- https://objectivefs.com/howto/objectivefs-admin-key-setup - https://objectivefs.com/features#filesystem-pool - https://objectivefs.com/howto/how-to-create-a-filesystem-with-an-existing-empty-bucket diff --git a/src/driver/index.js b/src/driver/index.js index 242b5bb..caab90d 100644 --- a/src/driver/index.js +++ b/src/driver/index.js @@ -912,12 +912,15 @@ class CsiBaseDriver { ); } + const sessionParsedPortal = iscsi.parsePortal(session.portal); + // rescan in scenarios when login previously occurred but volumes never appeared await iscsi.iscsiadm.rescanSession(session); // find device name - device = iscsi.devicePathByPortalIQNLUN( - iscsiConnection.portal, + device = await iscsi.devicePathByPortalIQNLUN( + //iscsiConnection.portal, + `${sessionParsedPortal.host}:${sessionParsedPortal.port}`, iscsiConnection.iqn, iscsiConnection.lun ); diff --git a/src/utils/iscsi.js b/src/utils/iscsi.js index faf4226..b5f5bee 100644 --- a/src/utils/iscsi.js +++ b/src/utils/iscsi.js @@ -583,11 +583,12 @@ class ISCSI { }; } - devicePathByPortalIQNLUN(portal, iqn, lun) { + async devicePathByPortalIQNLUN(portal, iqn, lun, options = {}) { const parsedPortal = this.parsePortal(portal); - const portalHost = parsedPortal.host - .replaceAll("[", "") - .replaceAll("]", ""); + let portalHost = parsedPortal.host.replaceAll("[", "").replaceAll("]", ""); + if (options.hostname_lookup && net.isIP(portalHost) == 0) { + portalHost = (await hostname_lookup(portalHost)) || portalHost; + } return `/dev/disk/by-path/ip-${portalHost}:${parsedPortal.port}-iscsi-${iqn}-lun-${lun}`; }