azurelustre

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeContextMGSIPAddress = "mgs-ip-address"
	VolumeContextFSName       = "fs-name"
	VolumeContextSubDir       = "sub-dir"
)
View Source
const (
	// DefaultDriverName holds the name of the csi-driver
	DefaultDriverName = "azurelustre.csi.azure.com"
)

Variables

This section is empty.

Functions

func GetUserAgent

func GetUserAgent(driverName, customUserAgent, userAgentSuffix string) string

GetUserAgent returns user agent of the driver

func GetVersionYAML

func GetVersionYAML(driverName string) (string, error)

GetVersionYAML returns the version information of the driver in YAML format

func IsCorruptedDir

func IsCorruptedDir(dir string) bool

Types

type Driver

type Driver struct {
	csicommon.CSIDriver
	csicommon.DefaultIdentityServer
	csicommon.DefaultControllerServer
	csicommon.DefaultNodeServer
	// contains filtered or unexported fields
}

Driver implements all interfaces of CSI drivers

func NewDriver

func NewDriver(options *DriverOptions) *Driver

NewDriver Creates a NewCSIDriver object. Assumes vendor version is equal to driver version & does not support optional driver plugin info manifest field. Refer to CSI spec for more details.

func (*Driver) ControllerGetCapabilities

ControllerGetCapabilities returns the capabilities of the Controller plugin

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(
	_ context.Context,
	req *csi.CreateVolumeRequest,
) (*csi.CreateVolumeResponse, error)

CreateVolume provisions a volume

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(
	_ context.Context, req *csi.DeleteVolumeRequest,
) (*csi.DeleteVolumeResponse, error)

DeleteVolume delete a volume

func (*Driver) GetPluginCapabilities

GetPluginCapabilities returns the capabilities of the plugin

func (*Driver) GetPluginInfo

GetPluginInfo return the version and name of the plugin

func (*Driver) NodeGetCapabilities

NodeGetCapabilities return the capabilities of the Node plugin

func (*Driver) NodeGetInfo

NodeGetInfo return info of the node on which this plugin is running

func (*Driver) NodeGetVolumeStats

NodeGetVolumeStats get volume stats

func (*Driver) NodePublishVolume

NodePublishVolume mount the volume from staging to target path

func (*Driver) NodeStageVolume added in v0.1.13

Staging and Unstaging is not able to be supported with how Lustre is mounted

This was discovered during a proof of concept implementation and the issue is as follows:

When the kubelet process attempts to unstage / unmount a Lustre mount that has been staged to a global mount point, it performs extra checks to ensure that the same device is not mounted anywhere else in the filesystem. For usual configurations, this would be a reasonable check to ensure that we aren't trying to remove something that is still in use elsewhere in the system. However, the way Lustre mounts are configured is not compatible with the check it performs.

The kubelet process does this by checking all of the mount points on the node to see if any have the following: 1) The same 'root' value of the mount that is being cleaned 2) The same device number of the mount that is being cleaned And that those mounts are in a different path tree. If so, it returns this error: "the device mount path %q is still mounted by other references %v", deviceMountPath, refs) and fails the unmount. See pkg/volume/util/operationexecutor/operation_generator.go calling GetDeviceMountRefs(deviceMountPath) around line 947.

All Lustre mounts on a system, no matter where in the lustrefs they are mounted to, all have '/' as the root and they all have the same major and minor device numbers, so as far as this check is concerned, every lustre mount is the same device, even though individual Lustre mount points can be unmounted without affecting others and should not be a concern.

With a single Lustre volume mount, this works fine. It stages to a globalpath dir, pods can bind mount into that, and when the last pod is done, unstage is called and the global mount point can be cleaned up, because that is the only lustre mount so kubelet has no issue with 'other mounts' on the same node.

The problem occurs when two different volumes are trying to mount a Lustre cluster. In that case, pods for the first volume can come up as expected with their global mount path, then pods for the second volume with their global mount path. The error occurs when the pods for one of these volumes are deleted and an unstage action should occur, because the other volume has its own Lustre mount, so it fails this check. For example, it's trying to unmount /var/...<firstvolume>.../globalpath, but there's another volume at /var/...<secondvolume>.../globalpath with the same root '/' and major and minor device numbers.

It errors out, fails the unmount, and never calls unstage, even though all of the pods using that volume have already been deleted. This leaves the box with as many global mount directories still mounted to the Lustre cluster as you've ever staged, but without any way to see this other than looking at the mounts on the node or in the kubelet logs.

func (*Driver) NodeUnpublishVolume

NodeUnpublishVolume unmount the volume from the target path

func (*Driver) NodeUnstageVolume added in v0.1.13

Staging and Unstaging is not able to be supported with how Lustre is mounted

See NodeStageVolume for more details

func (*Driver) Probe

Probe check whether the plugin is running or not. This method does not need to return anything. Currently the spec does not dictate what you should return either. Hence, return an empty response

func (*Driver) Run

func (d *Driver) Run(endpoint string, testBool bool)

Run driver initialization

func (*Driver) ValidateVolumeCapabilities

ValidateVolumeCapabilities return the capabilities of the volume

type DriverOptions

type DriverOptions struct {
	NodeID                     string
	DriverName                 string
	EnableAzureLustreMockMount bool
	WorkingMountDir            string
}

DriverOptions defines driver parameters specified in driver deployment

type VersionInfo

type VersionInfo struct {
	DriverName    string `json:"Driver Name"`
	DriverVersion string `json:"Driver Version"`
	GitCommit     string `json:"Git Commit"`
	BuildDate     string `json:"Build Date"`
	GoVersion     string `json:"Go Version"`
	Compiler      string `json:"Compiler"`
	Platform      string `json:"Platform"`
}

VersionInfo holds the version information of the driver

func GetVersion

func GetVersion(driverName string) VersionInfo

GetVersion returns the version information of the driver

Jump to

Keyboard shortcuts

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