driver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageClassTypeName     = "type"         //1=basic, 2=standard
	StorageClassMaxSizeName  = "maxSize"      //cloud disk min size (bytes)
	StorageClassMinSizeName  = "minSize"      //cloud disk max size (bytes)
	StorageClassFsTypeName   = "fsType"       //ext3 ext4 xfs
	StorageClassZoneId       = "zoneID"       //zone
	StorageClassPlaceGroupID = "placeGroupID" //groupid
)
View Source
const (
	BasicVolumeType    VolumeType = 1 //经济型
	StandardVolumeType VolumeType = 2 //标准型
	DefaultVolumeType             = StandardVolumeType
	BasicNvmeName      string     = "Basic NVMe SSD"
	StandardNvmeName   string     = "Standard NVMe SSD"
)
View Source
const (
	BasicVmType   VmType = 1
	DefaultVmType VmType = BasicVmType
	BasicVmName   string = "BasicVm"
)
View Source
const (
	ZEC_MAX_DISK_SIZE_BYTES int64 = 32768 * 1024 * 1024 * 1024
	ZEC_MIN_DISK_SIZE_BYTES int64 = 20 * 1024 * 1024 * 1024
)
View Source
const (
	DiskSingleReplicaType  int = 1
	DiskMultiReplicaType   int = 2
	DiskThreeReplicaType   int = 3
	DefaultDiskReplicaType int = DiskMultiReplicaType
)

Variables

controller type support capability/feature

node type support capability/feature

cloud disk only support ReadWriteOnce

View Source
var VmTypeAttachPreferred = map[VmType]VolumeType{
	BasicVmType: BasicVolumeType,
}

no use, reserve

View Source
var VmTypeName = map[VmType]string{
	BasicVmType: BasicVmName,
}
View Source
var VmTypeValue = map[string]VmType{
	BasicVmName: BasicVmType,
}
View Source
var VolumeTypeAttachConstraint = map[VolumeType][]VmType{
	BasicVolumeType: {
		BasicVmType,
	},
	StandardVolumeType: {
		BasicVmType,
	},
}

topology disk mapping to vm

max zec cloud disk size

min zec cloud disk size

Functions

func IsValidFileSystemType

func IsValidFileSystemType(fs string) bool

func UpdateParmsZone

func UpdateParmsZone(opt map[string]string, zoneID string)

Types

type DiskDriver

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

func GetDiskDriver

func GetDiskDriver() *DiskDriver

func (*DiskDriver) GetControllerCapability

func (d *DiskDriver) GetControllerCapability() []*csi.ControllerServiceCapability

func (*DiskDriver) GetMaxVolumePerNode

func (d *DiskDriver) GetMaxVolumePerNode() int64

func (*DiskDriver) GetName

func (d *DiskDriver) GetName() string

func (*DiskDriver) GetNodeCapability

func (d *DiskDriver) GetNodeCapability() []*csi.NodeServiceCapability

func (*DiskDriver) GetNodeId

func (d *DiskDriver) GetNodeId() string

func (*DiskDriver) GetNodeZone

func (d *DiskDriver) GetNodeZone() string

func (*DiskDriver) GetPluginCapability

func (d *DiskDriver) GetPluginCapability() []*csi.PluginCapability

func (*DiskDriver) GetTopologyVmTypeKey

func (d *DiskDriver) GetTopologyVmTypeKey() string

Action: Vm-Type only support BasicVm

func (*DiskDriver) GetTopologyZoneKey

func (d *DiskDriver) GetTopologyZoneKey() string

Action: Vm below zone

func (*DiskDriver) GetVersion

func (d *DiskDriver) GetVersion() string

func (*DiskDriver) GetVolumeCapability

func (d *DiskDriver) GetVolumeCapability() []*csi.VolumeCapability_AccessMode

func (*DiskDriver) InitDiskDriver

func (d *DiskDriver) InitDiskDriver(input *InitDiskDriverInput)

func (*DiskDriver) ValidateControllerServiceRequest

func (d *DiskDriver) ValidateControllerServiceRequest(c csi.ControllerServiceCapability_RPC_Type) bool

func (*DiskDriver) ValidateNodeServiceRequest

func (d *DiskDriver) ValidateNodeServiceRequest(c csi.NodeServiceCapability_RPC_Type) bool

func (*DiskDriver) ValidatePluginCapabilityService

func (d *DiskDriver) ValidatePluginCapabilityService(cap csi.PluginCapability_Service_Type) bool

func (*DiskDriver) ValidateVolumeAccessMode

func (d *DiskDriver) ValidateVolumeAccessMode(c csi.VolumeCapability_AccessMode_Mode) bool

func (*DiskDriver) ValidateVolumeCapabilities

func (d *DiskDriver) ValidateVolumeCapabilities(caps []*csi.VolumeCapability) bool

func (*DiskDriver) ValidateVolumeCapability

func (d *DiskDriver) ValidateVolumeCapability(cap *csi.VolumeCapability) bool

type InitDiskDriverInput

type InitDiskDriverInput struct {
	Name          string
	Version       string
	NodeId        string
	ZoneId        string
	MaxVolume     int64
	VolumeCap     []csi.VolumeCapability_AccessMode_Mode
	ControllerCap []csi.ControllerServiceCapability_RPC_Type
	NodeCap       []csi.NodeServiceCapability_RPC_Type
	PluginCap     []*csi.PluginCapability
}

type Topology

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

func NewTopology

func NewTopology(zoneid string, vt VmType) *Topology

func (*Topology) GetVmType

func (t *Topology) GetVmType() VmType

func (*Topology) GetZone

func (t *Topology) GetZone() string

func (*Topology) SetVmType

func (t *Topology) SetVmType(vt VmType)

func (*Topology) SetZone

func (t *Topology) SetZone(zoneid string)

type VmType

type VmType int

func (VmType) Int

func (v VmType) Int() int

func (VmType) IsVaild

func (v VmType) IsVaild() bool

type VolumeType

type VolumeType int

func StringToType

func StringToType(s string) VolumeType

func (VolumeType) Int

func (v VolumeType) Int() int

func (VolumeType) IsValid

func (v VolumeType) IsValid() bool

func (VolumeType) String

func (v VolumeType) String() string

type ZecStorageClass

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

func NewDefaultZecStorageClassFromType

func NewDefaultZecStorageClassFromType(diskType VolumeType) *ZecStorageClass

func NewZecStorageClassFromMap

func NewZecStorageClassFromMap(opt map[string]string) (*ZecStorageClass, error)

func (ZecStorageClass) ConvertToDiskCategory

func (sc ZecStorageClass) ConvertToDiskCategory(vt VolumeType) string

func (ZecStorageClass) FormatVolumeSizeByte

func (sc ZecStorageClass) FormatVolumeSizeByte(sizeByte int64) int64

func (ZecStorageClass) GetDiskType

func (sc ZecStorageClass) GetDiskType() VolumeType

func (ZecStorageClass) GetFsType

func (sc ZecStorageClass) GetFsType() string

func (ZecStorageClass) GetMaxSizeByte

func (sc ZecStorageClass) GetMaxSizeByte() int64

func (ZecStorageClass) GetMinSizeByte

func (sc ZecStorageClass) GetMinSizeByte() int64

func (ZecStorageClass) GetPlaceGroupID

func (sc ZecStorageClass) GetPlaceGroupID() string

func (ZecStorageClass) GetRequiredVolumeSizeByte

func (sc ZecStorageClass) GetRequiredVolumeSizeByte(capRange *csi.CapacityRange) (int64, error)

func (ZecStorageClass) GetZone

func (sc ZecStorageClass) GetZone() string

func (*ZecStorageClass) SetPlaceGroupID

func (sc *ZecStorageClass) SetPlaceGroupID(placeGroupID string)

func (*ZecStorageClass) SetZone

func (sc *ZecStorageClass) SetZone(zone string)

Jump to

Keyboard shortcuts

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