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: Add NVMe and SDC storage connectors #14710

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

Conversation

MusicDin
Copy link
Member

@MusicDin MusicDin commented Dec 20, 2024

This PR contains cherry-picks from #14700 to include only connectors and PowerFlex changes (without Pure Storage bits)

The aim of the connector is to handle connections with the target storage. Currently, connectors support NVMe, and SDC.

Closes #14708

@MusicDin
Copy link
Member Author

MusicDin commented Dec 20, 2024

As previously discussed with @roosterfish, I have also replaced nvme "disconnect-all" and "connect-all" by connecting to just a specific target. This prevents disconnecting all nvme volumes, which would affect other storage drivers as well. However, needs to be checked that NQN is correctly parsed and passed to the connector.

Copy link
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

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

Thanks for this, looking great already.

I'll grab your branch and make some tests on the PowerFlex cluster for validation. I think the only change that has to be performed upfront is using the actual (Connect|Disconnect)All funcs to resemble the original behavior.
When we have merged the PR I can take care of switching to the Connect/Disconnect instead.

lxd/storage/connectors/connector_nvme.go Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex_utils.go Outdated Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex.go Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex_utils.go Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex_utils.go Outdated Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex_utils.go Outdated Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex_utils.go Outdated Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex_utils.go Outdated Show resolved Hide resolved
lxd/storage/drivers/driver_powerflex_utils.go Outdated Show resolved Hide resolved
@MusicDin MusicDin force-pushed the feat/storage-connector branch from 67f9bf3 to 4846572 Compare December 20, 2024 18:19
@MusicDin
Copy link
Member Author

@roosterfish Thanks for the comments. I've addressed all of them, and reverted fixes for ConnectAll -> Connect, and DisconnectAll -> Disconnect to retain the previous implementation.

@roosterfish
Copy link
Contributor

I've addressed all of them, and reverted fixes

Thanks, I'll run it through some tests on the PowerFlex env and report back here.

lxd/storage/connectors/utils.go Outdated Show resolved Hide resolved
}

// Skip volumes that do not contain the desired name suffix.
if !strings.HasSuffix(diskPath, diskNameSuffix) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Before this was using !strings.Contains() because there are characters after the PowerFlex volume ID.

This breaks the disk discovery. I have just tested it in our PowerFlex lab and this is the first issue I saw.

Maybe should findDiskDevicePath accept a func(string) bool instead so the caller can pass an arbitrary validator that either checks Contains or HasSuffix depending on the individual format of the disk name under by-id/?

Copy link
Contributor

Choose a reason for hiding this comment

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

As an example when creating a disk in PowerFlex it's name will be /dev/disk/by-id/nvme-eui.b526f9710000000064b94e07b19c1c0f.
In this case b526f97100000000 is the volume id.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, accepting an arbitrary function also seems versatile solution for any potential upcoming storage drivers

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added the devicePathFilter which is a function that accepts device path, and returns bool indicating whether the path matches the required criteria.

@MusicDin MusicDin force-pushed the feat/storage-connector branch from 4846572 to 0e0ad2b Compare January 10, 2025 13:00
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.

3 participants