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

Rename sdc #153

Merged
merged 14 commits into from
Feb 1, 2023
Merged

Rename sdc #153

merged 14 commits into from
Feb 1, 2023

Conversation

khareRajshree
Copy link
Contributor

@khareRajshree khareRajshree commented Jan 23, 2023

Description

Add support for Rename SDC operation from CSI-PowerFlex driver

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#402

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Unit testing (Refer GitHub workflow for more details)
  • Functional testing

Renaming SDC with name set as "prefix-hostname"
1b

Renaming SDC with name set as "hostname"
2b

@JacobGros
Copy link
Collaborator

seeing
systemID not found: 000000000001
in unit test failures. Can you make the corresponding changes to goscaleio and update go.mod to point to it for the checks?

@khareRajshree
Copy link
Contributor Author

seeing systemID not found: 000000000001 in unit test failures. Can you make the corresponding changes to goscaleio and update go.mod to point to it for the checks?

updated the go.mod with the latest goscaleio commit.

@JacobGros
Copy link
Collaborator

JacobGros commented Jan 24, 2023

I think case 3 should be dropped:
// case3: if IsSdcRenameEnabled=false and no prefix given then use the SDC ID for sdc name.
Reason:

  1. If SdcRenameEnabled=false, customer probably doesn't want SDC to be named
  2. Since Name = SDC ID, there will be no difference to customer, at least from GUI standpoint
  3. Ask is to rename SDC, not name SDC, and if SDC name = null and we assign a name=ID to name, we're naming it.
  • Technically we're also naming SDC in cases 1 and 2, but in those cases, there is a visible difference to customer

@khareRajshree
Copy link
Contributor Author

I think case 3 should be dropped: // case3: if IsSdcRenameEnabled=false and no prefix given then use the SDC ID for sdc name. Reason:

  1. If SdcRenameEnabled=false, customer probably doesn't want SDC to be named
  2. Since Name = SDC ID, there will be no difference to customer, at least from GUI standpoint
  3. Ask is to rename SDC, not name SDC, and if SDC name = null and we assign a name=ID to name, we're naming it.
  • Technically we're also naming SDC in cases 1 and 2, but in those cases, there is a visible difference to customer

Addressed this, thanks.

@bharathsreekanth
Copy link
Collaborator

Is there a downside to renaming SDC always and add only a SDCPrefix if a customer specifies a prefix?

@JacobGros
Copy link
Collaborator

Is there a downside to renaming SDC always and add only a SDCPrefix if a customer specifies a prefix?

iirc: back when this was being planned, we wanted the driver behavior to match earlier versions by default

@@ -942,3 +942,21 @@ Feature: VxFlex OS CSI interface
When I call Probe
And I call setQoSParameters with systemID "15dbbf5617523655" sdcID "d0f055a700000000" bandwidthLimit "10240" iopsLimit "10" volumeName "k8s-a031818af5" csiVolID "15dbbf5617523655-456ca4fc00000009" nodeID "9E56672F-2F4B-4A42-BFF4-88B6846FBFDA"
Then the error contains "error setting QoS parameters"

Copy link
Collaborator

Choose a reason for hiding this comment

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

These look good, but I think we should add some negative test cases

Copy link
Contributor

Choose a reason for hiding this comment

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

Negative test cases are added.

service/node.go Outdated
// fetch hostname
hostName, ok := os.LookupEnv("HOSTNAME")
if !ok {
Log.Infof("%s not set\n", "HOSTNAME")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this block should be hit, but if it is, should we exit here?
If there's no hostname and no prefix, SDC name will = ""

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, We should not hit this case. Now I have made the changes to return an error if the HOSTNAME is not. We wont hit this case at all, But added it for safe side.

@bharathsreekanth
Copy link
Collaborator

Is there a downside to renaming SDC always and add only a SDCPrefix if a customer specifies a prefix?

iirc: back when this was being planned, we wanted the driver behavior to match earlier versions by default

I understand, but I was thinking if we can improve SDC names by renaming them to be more legible as opposed to what we had earlier, would that have any negative impact? would that cause any volumes mapped via the SDC to fail when users upgrade to newer version of the driver.

@JacobGros
Copy link
Collaborator

Is there a downside to renaming SDC always and add only a SDCPrefix if a customer specifies a prefix?

iirc: back when this was being planned, we wanted the driver behavior to match earlier versions by default

I understand, but I was thinking if we can improve SDC names by renaming them to be more legible as opposed to what we had earlier, would that have any negative impact? would that cause any volumes mapped via the SDC to fail when users upgrade to newer version of the driver.

What if a customer already named their SDCs based on their own convention and then updated driver? Their old SDC names will get replaced and they will probably be confused as to why that happened. I think in general, we should not alter anything on their pflex array unless they request it via enable value.

@JacobGros
Copy link
Collaborator

Looks good, outside of some quick comments, my two main questions are:

  1. Are these changes coming to CSM-Operator and CSI-Operator as well?
  2. Is there a doc PR to review?
    Thanks

@bharathsreekanth
Copy link
Collaborator

Is there a downside to renaming SDC always and add only a SDCPrefix if a customer specifies a prefix?

iirc: back when this was being planned, we wanted the driver behavior to match earlier versions by default

I understand, but I was thinking if we can improve SDC names by renaming them to be more legible as opposed to what we had earlier, would that have any negative impact? would that cause any volumes mapped via the SDC to fail when users upgrade to newer version of the driver.

What if a customer already named their SDCs based on their own convention and then updated driver? Their old SDC names will get replaced and they will probably be confused as to why that happened. I think in general, we should not alter anything on their pflex array unless they request it via enable value.

If customers already renamed, I guess this might be a concern. Thanks for explaining.

@khareRajshree
Copy link
Contributor Author

Is there a downside to renaming SDC always and add only a SDCPrefix if a customer specifies a prefix?

iirc: back when this was being planned, we wanted the driver behavior to match earlier versions by default

I understand, but I was thinking if we can improve SDC names by renaming them to be more legible as opposed to what we had earlier, would that have any negative impact? would that cause any volumes mapped via the SDC to fail when users upgrade to newer version of the driver.

What if a customer already named their SDCs based on their own convention and then updated driver? Their old SDC names will get replaced and they will probably be confused as to why that happened. I think in general, we should not alter anything on their pflex array unless they request it via enable value.

If customers already renamed, I guess this might be a concern. Thanks for explaining.

If customer upgraded the driver from 2.5 to 2.6 suppose, then in that case rename would not happen on its own unless they have enabled it from values.yaml, so whatever was the previous name it would still stay the same for them.

@VamsiSiddu-7
Copy link
Contributor

sdcID := sdc.Sdc.ID

var newName string
if len(opts.SdcPrefix) > 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can simplify code here if you would like (nothing wrong with what you have).
newName = hostName
if (sdcPrefix > 0) newName = opts.SdcPrefix + "_" + newName.
Basically remove the else clause. Not major, I am fine with as is.

Copy link
Collaborator

@JacobGros JacobGros left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants