fix controller expand volume logic for SCALE
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
339bfa6ba6
commit
22f4486e8a
|
|
@ -201,9 +201,8 @@ class FreeNASSshDriver extends ControllerZfsSshBaseDriver {
|
||||||
share = {
|
share = {
|
||||||
nfs_paths: [properties.mountpoint.value],
|
nfs_paths: [properties.mountpoint.value],
|
||||||
nfs_comment: `democratic-csi (${this.ctx.args.csiName}): ${datasetName}`,
|
nfs_comment: `democratic-csi (${this.ctx.args.csiName}): ${datasetName}`,
|
||||||
nfs_network: this.options.nfs.shareAllowedNetworks.join(
|
nfs_network:
|
||||||
","
|
this.options.nfs.shareAllowedNetworks.join(","),
|
||||||
),
|
|
||||||
nfs_hosts: this.options.nfs.shareAllowedHosts.join(","),
|
nfs_hosts: this.options.nfs.shareAllowedHosts.join(","),
|
||||||
nfs_alldirs: this.options.nfs.shareAlldirs,
|
nfs_alldirs: this.options.nfs.shareAlldirs,
|
||||||
nfs_ro: false,
|
nfs_ro: false,
|
||||||
|
|
@ -633,11 +632,10 @@ class FreeNASSshDriver extends ControllerZfsSshBaseDriver {
|
||||||
? this.options.iscsi.extentBlocksize
|
? this.options.iscsi.extentBlocksize
|
||||||
: 512;
|
: 512;
|
||||||
|
|
||||||
const extentDisablePhysicalBlocksize = this.options.iscsi.hasOwnProperty(
|
const extentDisablePhysicalBlocksize =
|
||||||
"extentDisablePhysicalBlocksize"
|
this.options.iscsi.hasOwnProperty("extentDisablePhysicalBlocksize")
|
||||||
)
|
? this.options.iscsi.extentDisablePhysicalBlocksize
|
||||||
? this.options.iscsi.extentDisablePhysicalBlocksize
|
: true;
|
||||||
: true;
|
|
||||||
|
|
||||||
const extentRpm = this.options.iscsi.hasOwnProperty("extentRpm")
|
const extentRpm = this.options.iscsi.hasOwnProperty("extentRpm")
|
||||||
? this.options.iscsi.extentRpm
|
? this.options.iscsi.extentRpm
|
||||||
|
|
@ -1605,6 +1603,7 @@ class FreeNASSshDriver extends ControllerZfsSshBaseDriver {
|
||||||
async expandVolume(call, datasetName) {
|
async expandVolume(call, datasetName) {
|
||||||
const driverShareType = this.getDriverShareType();
|
const driverShareType = this.getDriverShareType();
|
||||||
const sshClient = this.getSshClient();
|
const sshClient = this.getSshClient();
|
||||||
|
const zb = await this.getZetabyte();
|
||||||
|
|
||||||
switch (driverShareType) {
|
switch (driverShareType) {
|
||||||
case "iscsi":
|
case "iscsi":
|
||||||
|
|
@ -1612,7 +1611,29 @@ class FreeNASSshDriver extends ControllerZfsSshBaseDriver {
|
||||||
let command;
|
let command;
|
||||||
let reload = false;
|
let reload = false;
|
||||||
if (isScale) {
|
if (isScale) {
|
||||||
command = sshClient.buildCommand("systemctl", ["reload", "scst"]);
|
let properties;
|
||||||
|
properties = await zb.zfs.get(datasetName, [
|
||||||
|
FREENAS_ISCSI_ASSETS_NAME_PROPERTY_NAME,
|
||||||
|
]);
|
||||||
|
properties = properties[datasetName];
|
||||||
|
this.ctx.logger.debug("zfs props data: %j", properties);
|
||||||
|
let iscsiName =
|
||||||
|
properties[FREENAS_ISCSI_ASSETS_NAME_PROPERTY_NAME].value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* command = sshClient.buildCommand("systemctl", ["reload", "scst"]);
|
||||||
|
* does not help ^
|
||||||
|
*
|
||||||
|
* echo 1 > /sys/kernel/scst_tgt/devices/${iscsiName}/resync_size
|
||||||
|
* works ^
|
||||||
|
*
|
||||||
|
* scstadmin -resync_dev ${iscsiName}
|
||||||
|
* works but always give a exit code of 1 ^
|
||||||
|
*/
|
||||||
|
command = sshClient.buildCommand("sh", [
|
||||||
|
"-c",
|
||||||
|
`echo 1 > /sys/kernel/scst_tgt/devices/${iscsiName}/resync_size`,
|
||||||
|
]);
|
||||||
reload = true;
|
reload = true;
|
||||||
} else {
|
} else {
|
||||||
command = sshClient.buildCommand("/etc/rc.d/ctld", ["reload"]);
|
command = sshClient.buildCommand("/etc/rc.d/ctld", ["reload"]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue