devicepathresolver

package
v2.855.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NVMeDevicePattern is a glob pattern matching NVMe namespace devices.
	NVMeDevicePattern = "/dev/nvme*n1"

	// NVMeDevicePathPrefix is the common prefix for NVMe device paths.
	// Used to detect if a device path is an NVMe device.
	NVMeDevicePathPrefix = "/dev/nvme"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DevicePathResolver

type DevicePathResolver interface {
	GetRealDevicePath(diskSettings boshsettings.DiskSettings) (realPath string, timedOut bool, err error)
}

func NewFallbackDevicePathResolver added in v2.815.0

func NewFallbackDevicePathResolver(
	primary DevicePathResolver,
	secondary DevicePathResolver,
	logger boshlog.Logger,
) DevicePathResolver

func NewIDDevicePathResolver

func NewIDDevicePathResolver(
	diskWaitTimeout time.Duration,
	udev boshudev.UdevDevice,
	fs boshsys.FileSystem,
	DiskIDTransformPattern string,
	DiskIDTransformReplacement string,
	logger boshlog.Logger,
) DevicePathResolver

func NewIdentityDevicePathResolver

func NewIdentityDevicePathResolver() DevicePathResolver

func NewIscsiDevicePathResolver

func NewIscsiDevicePathResolver(
	diskWaitTimeout time.Duration,
	runner boshsys.CmdRunner,
	openiscsi boshopeniscsi.OpenIscsi,
	fs boshsys.FileSystem,
	dirProvider boshdirs.Provider,
	logger boshlog.Logger,
) DevicePathResolver

func NewMappedDevicePathResolver

func NewMappedDevicePathResolver(
	diskWaitTimeout time.Duration,
	fs boshsys.FileSystem,
) DevicePathResolver

func NewMultipathDevicePathResolver

func NewMultipathDevicePathResolver(
	idDevicePathResolver DevicePathResolver,
	iscsiDevicePathResolver DevicePathResolver,
	logger boshlog.Logger,
) DevicePathResolver

func NewScsiDevicePathResolver

func NewScsiDevicePathResolver(
	scsiVolumeIDPathResolver DevicePathResolver,
	scsiIDPathResolver DevicePathResolver,
	scsiLunPathResolver DevicePathResolver,
) DevicePathResolver

func NewVirtioDevicePathResolver

func NewVirtioDevicePathResolver(
	idDevicePathResolver DevicePathResolver,
	mappedDevicePathResolver DevicePathResolver,
	logger boshlog.Logger,
) DevicePathResolver

type FallbackDevicePathResolver added in v2.815.0

type FallbackDevicePathResolver struct {
	// contains filtered or unexported fields
}

func (FallbackDevicePathResolver) GetRealDevicePath added in v2.815.0

func (r FallbackDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.DiskSettings) (string, bool, error)

type SCSIIDDevicePathResolver

type SCSIIDDevicePathResolver struct {
	// contains filtered or unexported fields
}

SCSIIDDevicePathResolver resolves device path by performing a SCSI rescan then looking under "/dev/disk/by-id/*uuid" where "uuid" is the cloud ID of the disk

func NewSCSIIDDevicePathResolver

func NewSCSIIDDevicePathResolver(
	diskWaitTimeout time.Duration,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) SCSIIDDevicePathResolver

func (SCSIIDDevicePathResolver) GetRealDevicePath

func (idpr SCSIIDDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.DiskSettings) (string, bool, error)

type SCSILunDevicePathResolver

type SCSILunDevicePathResolver struct {
	// contains filtered or unexported fields
}

func NewSCSILunDevicePathResolver

func NewSCSILunDevicePathResolver(
	diskWaitTimeout time.Duration,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) SCSILunDevicePathResolver

func (SCSILunDevicePathResolver) GetRealDevicePath

func (ldpr SCSILunDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.DiskSettings) (string, bool, error)

type SCSIVolumeIDDevicePathResolver

type SCSIVolumeIDDevicePathResolver struct {
	// contains filtered or unexported fields
}

func NewSCSIVolumeIDDevicePathResolver

func NewSCSIVolumeIDDevicePathResolver(
	diskWaitTimeout time.Duration,
	fs boshsys.FileSystem,
) SCSIVolumeIDDevicePathResolver

func (SCSIVolumeIDDevicePathResolver) GetRealDevicePath

func (devicePathResolver SCSIVolumeIDDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.DiskSettings) (string, bool, error)

type SymlinkDeviceResolver added in v2.855.0

type SymlinkDeviceResolver struct {
	// contains filtered or unexported fields
}

func NewSymlinkDeviceResolver added in v2.855.0

func NewSymlinkDeviceResolver(
	fs boshsys.FileSystem,
	udev boshudev.UdevDevice,
	logger boshlog.Logger,
) *SymlinkDeviceResolver

NewSymlinkDeviceResolver creates a new symlink device resolver.

func (*SymlinkDeviceResolver) FilterDevices added in v2.855.0

func (r *SymlinkDeviceResolver) FilterDevices(allDevices []string, excludeDevices map[string]string) []string

FilterDevices returns devices that are NOT in the exclusion map. This is used to filter out IaaS-managed volumes (EBS, Azure Managed Disks, etc.) from the list of all NVMe devices, leaving only instance/ephemeral storage.

func (*SymlinkDeviceResolver) GetDevicesByPattern added in v2.855.0

func (r *SymlinkDeviceResolver) GetDevicesByPattern(devicePattern string) ([]string, error)

GetDevicesByPattern returns all devices matching the given pattern.

func (*SymlinkDeviceResolver) ResolveSymlinksToDevices added in v2.855.0

func (r *SymlinkDeviceResolver) ResolveSymlinksToDevices(symlinkPattern string) (map[string]string, error)

ResolveSymlinksToDevices resolves all symlinks matching the given pattern and returns a map of resolved device paths -> symlink paths.

udevadm trigger and settle are called before globbing to avoid a race condition: NVMe block devices (/dev/nvme*) appear synchronously at boot, but the /dev/disk/by-id/ symlinks are created asynchronously by udev. Without waiting, globbing may return no symlinks, causing all NVMe devices to be misidentified as instance storage (instead of EBS/managed volumes).

type SymlinkLunDevicePathResolver added in v2.815.0

type SymlinkLunDevicePathResolver struct {
	// contains filtered or unexported fields
}

func NewSymlinkLunDevicePathResolver added in v2.815.0

func NewSymlinkLunDevicePathResolver(
	basePath string,
	diskWaitTimeout time.Duration,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) SymlinkLunDevicePathResolver

func (SymlinkLunDevicePathResolver) GetRealDevicePath added in v2.815.0

func (r SymlinkLunDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.DiskSettings) (string, bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL