Skip to content
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

Installation Wizard: PowerFlex new keys added #809

Merged
merged 14 commits into from
Sep 4, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ description: Release notes for CSM Installation Wizard
- Helm and Operator based manifest file generation is supported for CSM-1.7 and CSM 1.8 releases

- Volume Limit and Storage Capacity Tracking features have been added.
- Rename SDC and approve SDC feature added for CSM-1.7 and CSM-1.8 for CSI-PowerFlex driver.
- NFS volume feature added for CSM-1.8 for CSI-PowerFlex driver.

### Fixed Issues

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ certSecretCount=1
pollRate=60
driverPodLabel=dell-storage
arrayThreshold=3
maxVolumesPerNode=0
maxVolumesPerNode=0
nfsAcls=0777
45 changes: 45 additions & 0 deletions content/docs/deployment/csminstallationwizard/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,27 @@
</div>
</div>

<div class="row mb-4 col-sm-11 rename-sdc-feature">
<div class="col-sm-12">
<input class="form-check-input" type="checkbox" id="rename-sdc" value="" onchange="onRenameSDCChange(driver, CONSTANTS)">
<label for="rename-sdc" class="form-check-label ms-2 text-dark" data-bs-toggle="tooltip" data-bs-placement="right" title="Enable/Disable Rename SDC feature.">Rename SDC</label>
</div>
<div class="was-validated row mt-3 child-level-one sdc-prefix">
<label for="sdc-prefix" class="col-sm-3 col-form-label" data-bs-toggle="tooltip" data-bs-placement="right" title="Prefix to apply for a SDC name">SDC Prefix</label>
<div class="col-sm-9"></div>
<div class="col-sm-2">
<input class="form-control input-lg" type="text" id="sdc-prefix" placeholder="sdc-test" oninput="validateInput(validateForm, CONSTANTS)" required>
</div>
</div>
</div>

<div class="row mb-4 approve-sdc">
<div class="col-sm-12">
<input class="form-check-input" type="checkbox" id="approve-sdc" value="">
<label for="approve-sdc" class="form-check-label ms-2 text-dark" data-bs-toggle="tooltip" data-bs-placement="right" title="Enable/Disable SDC approval">Approve SDC</label>
</div>
</div>

<div class="row mb-4 storage-capacity">
<div class="col-sm-12">
<input class="form-check-input" type="checkbox" id="storage-capacity" value="" checked>
Expand Down Expand Up @@ -375,6 +396,30 @@
</div>
</div>

<div class="row mb-3 nfs-feature">
<div class="col-sm-12 h6">NFS volume operations</div>
<div class="row mb-4 nfs-acls">
<label for="nfs-acls" class="col-sm-2 col-form-label" data-bs-toggle="tooltip" data-bs-placement="right" title="Defines permissions - POSIX mode bits or NFSv4 ACLs, to be set on NFS target mount directory." style="width: 200px;">NFS ACLs</label>
<div class="row">
<div class="col-sm-2">
<input class="form-control input-sm" type="text" id="nfs-acls" placeholder="0777" oninput="validateInput(validateForm, CONSTANTS)">
</div>
<div class="col-sm-4">
<div class="row mt-1">
<a class="reset" id="reset-nfs-acls" onclick="resetNfsAcls(csmMap)">Reset to default</a>
</div>
</div>
</div>
</div>

<div class="row mb-4 enable-quota">
<div class="col-sm-12">
<input class="form-check-input" type="checkbox" id="enable-quota" value="">
<label for="enable-quota" class="form-check-label ms-2 text-dark" data-bs-toggle="tooltip" data-bs-placement="right" title="Enable/Disable quota limits for a newly provisioned NFS volume.">Quota</label>
</div>
</div>
</div>

<hr>
<div class="row mb-3">
<div class="col-sm-12 h5">Other configurations for installation</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ function setValues(csmMapValues, CONSTANTS_PARAM) {
DriverValues.vSphereFCHostName = $("#vSphere-fc-host-name").val();
DriverValues.vSphereVCenterHost = $("#vSphere-vCenter-host").val();
DriverValues.vSphereVCenterCredSecret = $("#vSphere-vCenter-cred-secret").val();
DriverValues.renameSDC = $("#rename-sdc").prop('checked') ? true : false;
DriverValues.sdcPrefix = $("#sdc-prefix").val();
DriverValues.approveSDC = $("#approve-sdc").prop('checked') ? true : false;
DriverValues.nfsAcls = $("#nfs-acls").val();
DriverValues.enableQuota = $("#enable-quota").prop('checked') ? true : false;
return DriverValues
}

Expand Down Expand Up @@ -182,6 +187,11 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM)
yamlTpl = yamlTpl.replaceAll("$NODE_TOLERATIONS", yamlTplValues.nodeTolerations);
yamlTpl = yamlTpl.replaceAll("$TARGET_ARRAY_ID", yamlTplValues.targetArrayID);
yamlTpl = yamlTpl.replaceAll("$TARGET_UNISPHERE", yamlTplValues.targetUnisphere);
yamlTpl = yamlTpl.replaceAll("$RENAME_SDC_ENABLED", yamlTplValues.renameSDC);
yamlTpl = yamlTpl.replaceAll("$SDC_PREFIX", yamlTplValues.sdcPrefix);
yamlTpl = yamlTpl.replaceAll("$APPROVE_SDC_ENABLED", yamlTplValues.approveSDC);
yamlTpl = yamlTpl.replaceAll("$NFS_ACLS", yamlTplValues.nfsAcls);
yamlTpl = yamlTpl.replaceAll("$QUOTA_ENABLED", yamlTplValues.enableQuota);


if (driverParam === CONSTANTS_PARAM.POWERSTORE) {
Expand Down Expand Up @@ -230,7 +240,7 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM)
yamlTpl = yamlTpl.replaceAll("$CERT_MANAGER_ENABLED", yamlTplValues.certManagerEnabled);
yamlTpl = yamlTpl.replaceAll("$OBSERVABILITY_CERT_MANAGER_ENABLED", !yamlTplValues.certManagerEnabled);
yamlTpl = yamlTpl.replaceAll(' - storageArrayId: ""', '# - storageArrayId: ""');
yamlTpl = yamlTpl.replaceAll(' endpoint: ""', '# endpoint: ""');
yamlTpl = yamlTpl.replaceAll(' endpoint: ""', '# endpoint: ""');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line number 243 and 244 are same. Duplicate line can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @niranjan-n1, this is related to a previous PR, #804 for PowerMax replication.

yamlTpl = yamlTpl.replaceAll(' - endpoint: ""', '# - endpoint: ""');
const regex = /\$[a-zA-Z0-9_-]*/g;
yamlTpl = yamlTpl.replaceAll(regex, '""');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ describe("GIVEN setValues function", () => {
<input type="text" id="manage-array-id">
<input type="text" id="manage-array-endpoint-url">
<input type="checkbox" id="topology">
<input type="checkbox" id="rename-sdc">
<input type="text" id="sdc-prefix" value="">
<input type="checkbox" id="approve-sdc">
<input type="text" id="nfs-acls" value="0777">
<input type="checkbox" id="enable-quota">
`;

const expected = {
Expand Down Expand Up @@ -184,6 +189,11 @@ describe("GIVEN setValues function", () => {
observabilityOperatorTopology: false,
topologyEnabled: false,
transportProtocol: "",
renameSDC: false,
sdcPrefix: "",
approveSDC: false,
nfsAcls: "0777",
enableQuota: false,
};

const received = setValues(testCSMMap, CONSTANTS);
Expand Down Expand Up @@ -232,6 +242,11 @@ describe("GIVEN setValues function", () => {
<input type="text" id="manage-array-endpoint-url">
<input type="checkbox" id="topology">
<input type="checkbox" id="leader-election">
<input type="checkbox" id="rename-sdc">
<input type="text" id="sdc-prefix" value="">
<input type="checkbox" id="approve-sdc">
<input type="text" id="nfs-acls" value="0777">
<input type="checkbox" id="enable-quota">
`;

const expected = {
Expand Down Expand Up @@ -301,6 +316,11 @@ describe("GIVEN setValues function", () => {
observabilityOperatorTopology: false,
topologyEnabled: false,
transportProtocol: "",
renameSDC: false,
sdcPrefix: "",
approveSDC: false,
nfsAcls: "0777",
enableQuota: false,
};

const received = setValues(testCSMMap, CONSTANTS);
Expand Down Expand Up @@ -514,6 +534,11 @@ describe("GIVEN createYamlString function", () => {
healthMonitor:
enabled: $HEALTH_MONITOR_ENABLED
nodeSelector: $NODE_POD_NODE_SELECTOR
renameSDC:
enabled: $RENAME_SDC_ENABLED
sdcPrefix: $SDC_PREFIX
approveSDC:
enabled: $APPROVE_SDC_ENABLED
tolerations:
# Uncomment if CSM for Resiliency and CSI Driver pods monitor is enabled
# - key: "offline.vxflexos.storage.dell.com"
Expand Down Expand Up @@ -677,7 +702,10 @@ describe("GIVEN createYamlString function", () => {
vSphereFCHostName: "csi-vsphere-VC-HN",
vSphereVCenterHost: "00.000.000.00",
vSphereVCenterCredSecret: "vcenter-creds",
migration: false
migration: false,
renameSDC: false,
sdcPrefix: "sdc-test",
approveSDC: false
};

test("SHOULD return generated yaml file string for driver csi-powerstore", () => {
Expand Down Expand Up @@ -822,6 +850,11 @@ describe("GIVEN createYamlString function", () => {
healthMonitor:
enabled: false
nodeSelector: false
renameSDC:
enabled: false
sdcPrefix: sdc-test
approveSDC:
enabled: false
tolerations:
# Uncomment if CSM for Resiliency and CSI Driver pods monitor is enabled
# - key: "offline.vxflexos.storage.dell.com"
Expand Down Expand Up @@ -1091,6 +1124,11 @@ describe("GIVEN createYamlString function", () => {
healthMonitor:
enabled: false
nodeSelector: false
renameSDC:
enabled: false
sdcPrefix: sdc-test
approveSDC:
enabled: false
tolerations:
# Uncomment if CSM for Resiliency and CSI Driver pods monitor is enabled
# - key: "offline.vxflexos.storage.dell.com"
Expand Down Expand Up @@ -1361,6 +1399,11 @@ describe("GIVEN createYamlString function", () => {
healthMonitor:
enabled: false
nodeSelector: false
renameSDC:
enabled: false
sdcPrefix: sdc-test
approveSDC:
enabled: false
tolerations:
# Uncomment if CSM for Resiliency and CSI Driver pods monitor is enabled
# - key: "offline.vxflexos.storage.dell.com"
Expand Down Expand Up @@ -1633,6 +1676,11 @@ describe("GIVEN createYamlString function", () => {
healthMonitor:
enabled: false
nodeSelector: false
renameSDC:
enabled: false
sdcPrefix: sdc-test
approveSDC:
enabled: false
tolerations:
# Uncomment if CSM for Resiliency and CSI Driver pods monitor is enabled
# - key: "offline.vxflexos.storage.dell.com"
Expand Down Expand Up @@ -1904,6 +1952,11 @@ describe("GIVEN createYamlString function", () => {
healthMonitor:
enabled: false
nodeSelector: false
renameSDC:
enabled: false
sdcPrefix: sdc-test
approveSDC:
enabled: false
tolerations:
# Uncomment if CSM for Resiliency and CSI Driver pods monitor is enabled
# - key: "offline.vxflexos.storage.dell.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const {
resetControllerCount,
resetVolNamePrefix,
resetSnapNamePrefix,
resetNfsAcls,
resetDriverPodLabel,
resetArrayPollRate,
resetArrayConnectionLossThreshold,
Expand Down Expand Up @@ -464,6 +465,22 @@ describe("GIVEN resetArrayPollRate function", () => {
});
});

describe("GIVEN resetNfsAcls function", () => {
const testCSMMap = new Map([
["nfsAcls", "0777"]
]);

test("SHOULD invoke resetNfsAcls function", () => {
document.body.innerHTML = `
<input type="text" id="nfs-acls">
`;

resetNfsAcls(testCSMMap);

expect(document.getElementById("nfs-acls").value).toEqual("0777");
});
});

describe("GIVEN resetArrayConnectionLossThreshold function", () => {
const testCSMMap = new Map([
["arrayThreshold", "3"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,37 @@ describe("GIVEN validateForm functions", () => {

expect(validateForm(CONSTANT_PARAM)).toBe(true);
});

const powerflexTestHtml = `
<select id="array" value="powerflex">
<option value="powerflex">PowerFlex</option>
</select>
<select id="installation-type" value="helm">
<option value="helm">Helm</option>
</select>
<input type="text" id="image-repository" value="some-value">
<select id="csm-version" value="1.7.0">
<option value="1.7.0" selected>CSM 1.7.0</option>
</select>
<input type="text" id="driver-namespace" value="temp-value">
<input type="number" id="controller-count" value="1">
<input type="number" id="max-volumes-per-node" value="2">
<input type="checkbox" id="rename-sdc">
<input type="text" id="sdc-prefix">
`;

test("SHOULD return true IF rename-sdc value is unchecked", () => {
document.body.innerHTML = powerflexTestHtml;

expect(validateForm(CONSTANT_PARAM)).toBe(true);
});

test("SHOULD return false IF rename-sdc value is checked AND sdc-prefix value is empty", () => {
document.body.innerHTML = powerflexTestHtml;
$("#rename-sdc").prop('checked', true);

expect(validateForm(CONSTANT_PARAM)).toBe(true);
});
});

describe("GIVEN setMap function", () => {
Expand Down Expand Up @@ -315,6 +346,7 @@ describe("GIVEN setDefaultValues function", () => {
<input type="number" id="poll-rate">
<input type="number" id="array-threshold">
<input type="text" id="driver-pod-label">
<input type="text" id="nfs-acls">
`;

const testCSMMap = new Map([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function onArrayChange() {
onVSphereChange();
onReplicationChange(replicationNote);
validateInput(validateForm, CONSTANTS);
onRenameSDCChange(driver, CONSTANTS);
});
}

Expand Down Expand Up @@ -212,6 +213,16 @@ function onNodeSelectorChange(nodeSelectorNoteValue, csmMapValue) {
}
}

function onRenameSDCChange(driverName, CONSTANTS_PARAM) {
if ($("#rename-sdc").prop('checked') === true) {
if (driverName === POWERFLEX){
$('div.sdc-prefix').show();
}
} else {
$('div.sdc-prefix').hide();
}
}

const onCSMVersionChange = () => {
document.getElementById("csm-version").value !== ""? loadTemplate(document.getElementById("array").value, document.getElementById("installation-type").value, document.getElementById("csm-version").value) : null;
displayModules(installationType, driver, CONSTANTS);
Expand Down Expand Up @@ -253,6 +264,10 @@ const resetSnapNamePrefix = csmMapValue => {
document.getElementById("snapshot-prefix").value = String(csmMapValue.get("snapNamePrefix"));
}

const resetNfsAcls = csmMapValue => {
document.getElementById("nfs-acls").value = String(csmMapValue.get("nfsAcls"));
}

const resetNodeSelectorLabel = csmMapValue => {
document.getElementById("node-selector-label").value = String(csmMapValue.get("nodeSelectorLabel"));
}
Expand Down Expand Up @@ -334,6 +349,9 @@ function displayModules(installationType, driverName, CONSTANTS_PARAM) {
$(".replication-operator-clusterid").hide();
$(".replication-helm-arrayid").hide();
$(".replication-helm-unisphere").hide();
$(".rename-sdc-feature").hide();
$(".approve-sdc").hide();
$(".nfs-feature").hide();

switch (driverName) {
case CONSTANTS_PARAM.POWERSTORE:
Expand Down Expand Up @@ -422,6 +440,12 @@ function displayModules(installationType, driverName, CONSTANTS_PARAM) {
$(".cert-secret-count-wrapper").show();
$("div#snap-prefix").hide();
$(".storage-capacity").show();
$(".rename-sdc-feature").show();
$(".approve-sdc").show();
if (document.getElementById("csm-version").value === "1.8.0") {
$(".max-volumes-per-node").show();
$(".nfs-feature").show();
}
document.getElementById("driver-namespace").value = CONSTANTS_PARAM.POWERFLEX_NAMESPACE;
break;
case CONSTANTS_PARAM.UNITY:
Expand Down Expand Up @@ -526,6 +550,7 @@ if (typeof exports !== 'undefined') {
onVSphereChange,
onNodeSelectorChange,
onCopyButtonClickHandler,
onRenameSDCChange,
resetImageRepository,
resetMaxVolumesPerNode,
resetControllerCount,
Expand All @@ -542,6 +567,7 @@ if (typeof exports !== 'undefined') {
hideFields,
validateInput,
resetVolNamePrefix,
resetSnapNamePrefix
resetSnapNamePrefix,
resetNfsAcls
};
}
Loading