azuredisk

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 51 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// DriverName driver name
	DriverName = "disk.csi.azure.com"

	// LUN lun number
	LUN = "LUN"

	WellKnownTopologyKey = "topology.kubernetes.io/zone"
)
View Source
const (
	PerfProfileNone          = "none"
	PerfProfileBasic         = "basic"
	PremiumAccountPrefix     = "premium"
	StandardSsdAccountPrefix = "standardssd"
)
View Source
const (
	NotFound = "NotFound"
)

Variables

View Source
var (
	DefaultAzureCredentialFileEnv = "AZURE_CREDENTIAL_FILE"
	DefaultCredFilePathLinux      = "/etc/kubernetes/azure.json"
	DefaultCredFilePathWindows    = "C:\\k\\azure.json"
)
View Source
var (
	DiskSkuMap = map[string]map[string]DiskSkuInfo{
		"premium_lrs": {
			"p40": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P40", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 2048},
			"p2":  {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P2", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 8},
			"p3":  {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P3", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 16},
			"p4":  {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P4", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 32},
			"p10": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P10", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 500, MaxBwMbps: 100, MaxBurstBwMbps: 170, MaxSizeGiB: 128},
			"p20": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P20", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 2300, MaxBwMbps: 150, MaxBurstBwMbps: 170, MaxSizeGiB: 512},
			"p80": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P80", MaxAllowedShares: 10, MaxBurstIops: 20000, MaxIops: 20000, MaxBwMbps: 900, MaxBurstBwMbps: 900, MaxSizeGiB: 32767},
			"p6":  {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P6", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 240, MaxBwMbps: 50, MaxBurstBwMbps: 170, MaxSizeGiB: 64},
			"p15": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P15", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 1100, MaxBwMbps: 125, MaxBurstBwMbps: 170, MaxSizeGiB: 256},
			"p30": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P30", MaxAllowedShares: 5, MaxBurstIops: 5000, MaxIops: 5000, MaxBwMbps: 200, MaxBurstBwMbps: 200, MaxSizeGiB: 1024},
			"p50": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P50", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 4096},
			"p70": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P70", MaxAllowedShares: 10, MaxBurstIops: 18000, MaxIops: 18000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 16384},
			"p1":  {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P1", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 4},
			"p60": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P60", MaxAllowedShares: 10, MaxBurstIops: 16000, MaxIops: 16000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 8192},
		},
		"standardssd_lrs": {
			"e70": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E70", MaxAllowedShares: 5, MaxBurstIops: 4000, MaxIops: 4000, MaxBwMbps: 600, MaxBurstBwMbps: 600, MaxSizeGiB: 16384},
			"e2":  {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E2", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 8},
			"e10": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E10", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 128},
			"e80": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E80", MaxAllowedShares: 5, MaxBurstIops: 6000, MaxIops: 6000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 32767},
			"e15": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E15", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 256},
			"e20": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E20", MaxAllowedShares: 2, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 512},
			"e4":  {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E4", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 32},
			"e30": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E30", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 1024},
			"e40": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E40", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 2048},
			"e60": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E60", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 400, MaxBurstBwMbps: 400, MaxSizeGiB: 8192},
			"e1":  {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E1", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4},
			"e3":  {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E3", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 16},
			"e6":  {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E6", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 64},
			"e50": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E50", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4096},
		},
		"ultrassd_lrs": {
			"u": {StorageAccountType: "UltraSSD_LRS", StorageTier: "Ultra", DiskSize: "U", MaxAllowedShares: 5, MaxBurstIops: 0, MaxIops: 0, MaxBwMbps: 0, MaxBurstBwMbps: 0, MaxSizeGiB: 65536},
		},
		"standardssd_zrs": {
			"e1":  {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E1", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4},
			"e10": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E10", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 128},
			"e30": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E30", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 1024},
			"e40": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E40", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 2048},
			"e50": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E50", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4096},
			"e2":  {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E2", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 8},
			"e3":  {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E3", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 16},
			"e4":  {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E4", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 32},
			"e6":  {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E6", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 64},
			"e20": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E20", MaxAllowedShares: 2, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 512},
			"e80": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E80", MaxAllowedShares: 5, MaxBurstIops: 6000, MaxIops: 6000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 32767},
			"e15": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E15", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 256},
			"e60": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E60", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 400, MaxBurstBwMbps: 400, MaxSizeGiB: 8192},
			"e70": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E70", MaxAllowedShares: 5, MaxBurstIops: 4000, MaxIops: 4000, MaxBwMbps: 600, MaxBurstBwMbps: 600, MaxSizeGiB: 16384},
		},
		"premium_zrs": {
			"p2":  {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P2", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 8},
			"p40": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P40", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 2048},
			"p80": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P80", MaxAllowedShares: 10, MaxBurstIops: 20000, MaxIops: 20000, MaxBwMbps: 900, MaxBurstBwMbps: 900, MaxSizeGiB: 32767},
			"p70": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P70", MaxAllowedShares: 10, MaxBurstIops: 18000, MaxIops: 18000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 16384},
			"p3":  {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P3", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 16},
			"p15": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P15", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 1100, MaxBwMbps: 125, MaxBurstBwMbps: 170, MaxSizeGiB: 256},
			"p50": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P50", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 4096},
			"p60": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P60", MaxAllowedShares: 10, MaxBurstIops: 16000, MaxIops: 16000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 8192},
			"p20": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P20", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 2300, MaxBwMbps: 150, MaxBurstBwMbps: 170, MaxSizeGiB: 512},
			"p1":  {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P1", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 4},
			"p4":  {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P4", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 32},
			"p6":  {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P6", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 240, MaxBwMbps: 50, MaxBurstBwMbps: 170, MaxSizeGiB: 64},
			"p10": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P10", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 500, MaxBwMbps: 100, MaxBurstBwMbps: 170, MaxSizeGiB: 128},
			"p30": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P30", MaxAllowedShares: 5, MaxBurstIops: 5000, MaxIops: 5000, MaxBwMbps: 200, MaxBurstBwMbps: 200, MaxSizeGiB: 1024},
		},
		"standard_lrs": {
			"s30": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S30", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 1024},
			"s60": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S60", MaxAllowedShares: 5, MaxBurstIops: 1300, MaxIops: 1300, MaxBwMbps: 300, MaxBurstBwMbps: 300, MaxSizeGiB: 8192},
			"s40": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S40", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 2048},
			"s50": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S50", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4096},
			"s70": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S70", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 16384},
			"s4":  {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S4", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 32},
			"s6":  {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S6", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 64},
			"s10": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S10", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 128},
			"s15": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S15", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 256},
			"s20": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S20", MaxAllowedShares: 2, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 512},
			"s80": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S80", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 32767},
		},
	}

	NodeInfoMap = map[string]NodeInfo{}/* 399 elements not displayed */

)

Functions

func CleanupMountPoint added in v0.7.0

func CleanupMountPoint(path string, m *mount.SafeFormatAndMount, extensiveCheck bool) error

func GetCloudProvider

func GetCloudProvider(kubeconfig string) (*azure.Cloud, error)

GetCloudProvider get Azure Cloud Provider

func GetDiskName added in v0.8.0

func GetDiskName(diskURI string) (string, error)

func GetResourceGroupFromURI added in v0.8.0

func GetResourceGroupFromURI(diskURI string) (string, error)

func GetVersionYAML

func GetVersionYAML() (string, error)

GetVersionYAML returns the version information of the driver in YAML format

func IsAzureStackCloud added in v0.10.0

func IsAzureStackCloud(cloud string, disableAzureStackCloud bool) bool

IsAzureStackCloud decides whether the driver is running on Azure Stack Cloud.

func IsCorruptedDir added in v0.7.0

func IsCorruptedDir(dir string) bool

func IsLinuxOS added in v1.4.0

func IsLinuxOS() bool

IsLinuxOS decides whether the driver is running on linux OS.

func IsWindowsOS added in v1.4.0

func IsWindowsOS() bool

IsWindowsOS decides whether the driver is running on windows OS.

func NewFakeMounter added in v0.10.0

func NewFakeMounter() (*mount.SafeFormatAndMount, error)

func PopulateNodeAndSkuInfo added in v1.4.0

func PopulateNodeAndSkuInfo(d *DriverCore) error

PopulateNodeAndSkuInfo populates Node and Sku related information in memory

Types

type CSIDriver added in v1.1.1

type CSIDriver interface {
	csi.ControllerServer
	csi.NodeServer
	csi.IdentityServer

	Run(endpoint, kubeconfig string, disableAVSetNodes, testMode bool)
}

CSIDriver defines the interface for a CSI driver.

func NewDriver

func NewDriver(nodeID string, enablePerfOptimization bool) CSIDriver

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.

type DeviceHelper added in v1.4.0

type DeviceHelper struct{}

func (*DeviceHelper) DiskSupportsPerfOptimization added in v1.4.0

func (deviceHelper *DeviceHelper) DiskSupportsPerfOptimization(diskPerfProfile, diskAccountType string) bool

func (*DeviceHelper) OptimizeDiskPerformance added in v1.4.0

func (deviceHelper *DeviceHelper) OptimizeDiskPerformance(nodeInfo *NodeInfo, diskSkus map[string]map[string]DiskSkuInfo, devicePath,
	perfProfile, accountType, diskSizeGibStr, diskIopsStr, diskBwMbpsStr string) (err error)

OptimizeDiskPerformance optimizes device performance by setting tuning block device settings

type DiskSkuInfo added in v1.4.0

type DiskSkuInfo struct {
	StorageAccountType string
	StorageTier        string
	DiskSize           string
	MaxAllowedShares   int
	MaxBurstIops       int
	MaxIops            int
	MaxBwMbps          int
	MaxBurstBwMbps     int
	MaxSizeGiB         int
}

DiskSkuInfo stores disk sku information disk sku information is present in sku.json in below format

{
	"resourceType": "disks",
	"name": "Premium_LRS",
	"tier": "Premium",
	"size": "P4",
	"capabilities": [
	 {
	  "name": "MaxSizeGiB",
	  "value": "32"
	 {
	  "name": "MaxIOps",
	  "value": "120"
	 },
	 {
	  "name": "MaxBandwidthMBps",
	  "value": "25"
	 },
	 {
	  "name": "MaxValueOfMaxShares",
	  "value": "1"
	 },
	 {
	  "name": "MaxBurstIops",
	  "value": "3500"
	 },
	 {
	  "name": "MaxBurstBandwidthMBps",
	  "value": "170"
	 }
	]
}

func (*DiskSkuInfo) GetRandomIOLatencyInSec added in v1.4.0

func (sku *DiskSkuInfo) GetRandomIOLatencyInSec() float64

GetRandomIOLatencyInSec gets the estimated random IP latency for a small write for a disk size These latencies are manually calculated and stored ToDo: Make this estimation dynamic

func (*DiskSkuInfo) GetSequentialOLatencyInSec added in v1.4.0

func (sku *DiskSkuInfo) GetSequentialOLatencyInSec() float64

GetSequentialOLatencyInSec gets the estimated sequential IO latency for a disk size These latencies are manually calculated and stored ToDo: Make this estimation dynamic

type Driver

type Driver struct {
	DriverCore
	// contains filtered or unexported fields
}

Driver is the v1 implementation of the Azure Disk CSI Driver.

func (*Driver) ControllerExpandVolume

ControllerExpandVolume controller expand volume

func (*Driver) ControllerGetCapabilities

ControllerGetCapabilities returns the capabilities of the Controller plugin

func (*Driver) ControllerGetVolume added in v0.8.0

ControllerGetVolume get volume

func (*Driver) ControllerPublishVolume

ControllerPublishVolume attach an azure disk to a required node

func (*Driver) ControllerUnpublishVolume

ControllerUnpublishVolume detach an azure disk from a required node

func (*Driver) CreateSnapshot

CreateSnapshot create a snapshot

func (*Driver) CreateVolume

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

CreateVolume provisions an azure disk

func (*Driver) DeleteSnapshot

DeleteSnapshot delete a snapshot

func (*Driver) DeleteVolume

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

DeleteVolume delete an azure disk

func (*Driver) GetCapacity

func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)

GetCapacity returns the capacity of the total available storage pool

func (*Driver) GetPluginCapabilities

GetPluginCapabilities returns the capabilities of the plugin

func (*Driver) GetPluginInfo

func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)

GetPluginInfo return the version and name of the plugin

func (*Driver) GetSourceDiskSize added in v1.0.0

func (d *Driver) GetSourceDiskSize(ctx context.Context, resourceGroup, diskName string, curDepth, maxDepth int) (*int32, error)

GetSourceDiskSize recursively searches for the sourceDisk and returns: sourceDisk disk size, error

func (*Driver) ListSnapshots

func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)

ListSnapshots list all snapshots

func (*Driver) ListVolumes

func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)

ListVolumes return all available volumes

func (*Driver) NodeExpandVolume

NodeExpandVolume node expand volume

func (*Driver) NodeGetCapabilities

NodeGetCapabilities return the capabilities of the Node plugin

func (*Driver) NodeGetInfo

func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

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

func (*Driver) NodeGetVolumeStats

func (*Driver) NodePublishVolume

NodePublishVolume mount the volume from staging to target path

func (*Driver) NodeStageVolume

NodeStageVolume mount disk device to a staging path

func (*Driver) NodeUnpublishVolume

NodeUnpublishVolume unmount the volume from the target path

func (*Driver) NodeUnstageVolume

NodeUnstageVolume unmount disk device from a staging path

func (*Driver) Probe

func (f *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

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, kubeconfig string, disableAVSetNodes, testingMock bool)

Run driver initialization

func (*Driver) ValidateVolumeCapabilities

ValidateVolumeCapabilities return the capabilities of the volume

type DriverCore added in v1.1.1

type DriverCore struct {
	csicommon.CSIDriver
	// contains filtered or unexported fields
}

DriverCore contains fields common to both the V1 and V2 driver, and implements all interfaces of CSI drivers

type FakeDriver added in v1.1.1

type FakeDriver interface {
	CSIDriver

	GetSourceDiskSize(ctx context.Context, resourceGroup, diskName string, curDepth, maxDepth int) (*int32, error)
	// contains filtered or unexported methods
}

FakeDriver defines an interface unit tests use to test either the v1 or v2 implementation of the Azure Disk CSI Driver.

func NewFakeDriver added in v0.7.0

func NewFakeDriver(t *testing.T) (FakeDriver, error)

NewFakeDriver returns a driver implementation suitable for use in unit tests.

type Interface added in v1.4.0

type Interface interface {
	DiskSupportsPerfOptimization(diskPerfProfile, diskAccountType string) bool
	OptimizeDiskPerformance(nodeInfo *NodeInfo, diskSkus map[string]map[string]DiskSkuInfo, devicePath,
		perfProfile, accountType, diskSizeGibStr, diskIopsStr, diskBwMbpsStr string) error
}

This is the interface for DeviceHelper

type NodeInfo added in v1.4.0

type NodeInfo struct {
	SkuName          string
	Zone             string
	Region           string
	MaxDataDiskCount int
	VCpus            int
	MaxBurstIops     int
	MaxIops          int
	MaxBwMbps        int
	MaxBurstBwMbps   int
}

NodeInfo stores VM/Node specific static information VM information is present in sku.json in below format

{
	"resourceType": "virtualmachines",
	"name": "Standard_E16-4ds_v4",
	"tier": "Standard",
	"size": "E16-4ds_v4",
	"capabilities": [
	 {
	  "name": "vCPUs",
	  "value": "16"
	 },
	 {
	  "name": "MemoryGB",
	  "value": "128"
	 },
	 {
	  "name": "MaxDataDiskCount",
	  "value": "32"
	 },
	 {
	  "name": "UncachedDiskIOPS",
	  "value": "25600"
	 },
	 {
	  "name": "UncachedDiskBytesPerSecond",
	  "value": "402653184"
	 }
	]
}

type SafeDeviceHelper added in v1.4.0

type SafeDeviceHelper struct {
	Interface
}

IdentityServer is the server API for Identity service.

func NewSafeDeviceHelper added in v1.4.0

func NewSafeDeviceHelper() *SafeDeviceHelper

func (*SafeDeviceHelper) DeviceSupportsPerfOptimization added in v1.4.0

func (dh *SafeDeviceHelper) DeviceSupportsPerfOptimization(diskPerfProfile, diskAccountType string) bool

func (*SafeDeviceHelper) OptimizeDiskPerformance added in v1.4.0

func (dh *SafeDeviceHelper) OptimizeDiskPerformance(nodeInfo *NodeInfo, diskSkus map[string]map[string]DiskSkuInfo, devicePath,
	perfProfile, accountType, diskSizeGibStr, diskIopsStr, diskBwMbpsStr string) error

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"`
	TopologyKey   string `json:"Topology Key"`
}

VersionInfo holds the version information of the driver

func GetVersion

func GetVersion() VersionInfo

GetVersion returns the version information of the driver

Directories

Path Synopsis
Package mockcorev1 implements the mock client for corev1.
Package mockcorev1 implements the mock client for corev1.
Package mockkubeclient implements the mock client for kubeclient.
Package mockkubeclient implements the mock client for kubeclient.
Package mockpersistentvolume implements the mock client for persistentvolumegetter.
Package mockpersistentvolume implements the mock client for persistentvolumegetter.

Jump to

Keyboard shortcuts

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