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

Storage: Powerflex use Connect and Disconnect for NVMe/TCP #14900

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

roosterfish
Copy link
Contributor

@roosterfish roosterfish commented Jan 31, 2025

Closes #14814

This aligns the PowerFlex driver with the implementation of Pure in #14599 to use the NVMe/TCP Connect and Disconnect functions instead of their (Connect|Disconnect)All counterparts.

Furthermore a patch is introduced to remove the powerflex.sdt config key from already existing storage pools.
Currently only a single address is stored in the key and using nvme connect-all all of the other targets (SDTs) are discovered anyway.
As the driver is now querying for all the SDTs in case powerflex.sdt config key is not set, the behavior is the exact same.
In addition powerflex.sdt now accepts multiple addresses separated by comma which allows overriding the addresses discovered by asking the PowerFlex REST API.

Some additional minor tweaks have been put into place to make more consistent use of the connector's LoadModules in case of SDC and to clean up some error messages.

@github-actions github-actions bot added the Documentation Documentation needs updating label Jan 31, 2025
Copy link
Member

@MusicDin MusicDin left a comment

Choose a reason for hiding this comment

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

Already looking good, just a few early comments/questions from my side.

@@ -858,6 +858,11 @@ func (d *powerflex) deleteNVMeHost() error {
return client.deleteHost(host.ID)
}

// targetQN returns the unique NQN of the target SDTs using PowerFlex's system ID.
func (d *powerflex) targetQN(systemID string) string {
return fmt.Sprintf("nqn.1988-11.com.dell:powerflex:00:%s", systemID)
Copy link
Member

Choose a reason for hiding this comment

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

I guess the nqn prefix is the same for all PF system, just wanted to point out if we are sure this is true? Because if the prefix does not match, the connection will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had the same thoughts. Unfortunately this string doesn't seem to be returned by any PowerFlex API. I tried querying the relevant ones with no luck.

Also all the online examples always use nqn.1988-11.com.dell:powerflex:00: so I suspect this to be the same every time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC in case of pure you get it straight from the API right?

Copy link
Member

Choose a reason for hiding this comment

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

IIRC in case of pure you get it straight from the API right?

Yes.

Unfortunately this string doesn't seem to be returned by any PowerFlex API. I tried querying the relevant ones with no luck.

I think the prefix should be the same on all PF arrays, as the prefix is constructed as:
<protocol>.<year_of_company_creation?>.<domain_in_reverse>:<system_id>

Just not sure if this is really a standard, or if it can vary for unknown reasons

Copy link
Contributor Author

@roosterfish roosterfish Jan 31, 2025

Choose a reason for hiding this comment

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

An alternative would be to keep ConnectAll to make use of the discovery. This way we don't need to craft the target's nqn as we get it from NVMe discovery.
But then ConnectAll should support multiple addresses, the same as Connect in case one of them is down.

And Disconnect already supports just providing a string that is contained in any of the current session so in case of PowerFlex we can just pass the system id.

lxd/storage/drivers/driver_powerflex_utils.go Outdated Show resolved Hide resolved
lxd/storage/connectors/connector.go Outdated Show resolved Hide resolved
Signed-off-by: Julian Pelizäus <[email protected]>
Instead of ConnectAll and DisconnectAll use the Connect and Disconnect functions
to connect and disconnect to and from individual NVMe/TCP targets (SDTs).

If no SDTs (powerflex.sdt) are provided discover them by querying the PowerFlex REST API.

Signed-off-by: Julian Pelizäus <[email protected]>
…g key

Don't anymore set powerflex.sdt config key if not provided.
If it's not set the driver will discover the list of NVMe/TCP targets (SDTs) from the PowerFlex REST API.

Signed-off-by: Julian Pelizäus <[email protected]>
This allows using the connectors functionality to conveniently check if
the respective SDC kernel module got already loaded outside of LXD.

Signed-off-by: Julian Pelizäus <[email protected]>
…ation

Rely on the already existing check in Validate() to check if the SDC
kernel module got loaded outside of LXD.

Signed-off-by: Julian Pelizäus <[email protected]>
Signed-off-by: Julian Pelizäus <[email protected]>
@roosterfish roosterfish force-pushed the powerflex_connect branch 3 times, most recently from ec263cc to ae4cc7c Compare February 6, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let PowerFlex disconnect from specific targets instead of all
3 participants