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

kubeapi for matching pv/pvc to /dev/sd devices #4378

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewd-zededa
Copy link
Contributor

@andrewd-zededa andrewd-zededa commented Oct 17, 2024

This will be used in an upcoming PR to create DiskMetric objects for cluster PVCs.

When a cluster volume is created it will show on the controller as the PVC name. This PVC(PersistentVolumeClaim) has a linked PV(PersistentVolume) which is the name of a block device under /dev/longhorn/ which itself shares the same major:minor pair as one /dev/sdX device. Volumemgr will use this API to map from PVC->PV->/dev/sdX device to link from existing sdX DiskMetric object to a cluster volume DiskMetric if it is currently attached on this node.

This will be used in an upcoming PR to
create DiskMetric objects for cluster PVCs.

Signed-off-by: Andrew Durbin <[email protected]>
}

for _, devEnt := range blockDevs {
if !strings.HasPrefix(devEnt.Name(), "sd") {
Copy link
Contributor

Choose a reason for hiding this comment

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

@andrewd-zededa , why are you considering only sdX devices? What about devices that have NVMes that will be named into something like nvme0n1, nvme0n1p1, nvme0n1p2, nvme0n1p3?

Copy link
Contributor

Choose a reason for hiding this comment

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

And also eMMCs, that in this case will be named as something like mmcblk0p1, mmcblk0p2, etc...

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