Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupMapEntries(duration time.Duration)
- func GetRDFInfoFromSGID(storageGroupID string) (namespace string, rDFGno string, repMode string, err error)
- func LockRequestHandler()
- func ReleaseLock(resourceID string, requestID string, lockNum int)
- func RequestLock(resourceID string, requestID string) int
- type Device
- type FCTargetInfo
- type ISCSITargetInfo
- type LockInfo
- type LockRequest
- type LockRequestInfo
- type NodeConfig
- type Opts
- type Pair
- type Service
- type SnapSession
- type TopologyConfig
Constants ¶
const ( DefaultVolumeSizeBytes = 1073741824 // MinVolumeSizeBytes - This is the minimum volume size in bytes. This is equal to // the number of bytes to create a volume which requires 1 cylinder less than // the number of bytes required for 50 MB MinVolumeSizeBytes = 51118080 // MaxVolumeSizeBytes - This is the maximum volume size in bytes. This is equal to // the minimum number of bytes required to create a 1 TB volume on Powermax arrays MaxVolumeSizeBytes = 1099512545280 StoragePoolCacheDuration = 4 * time.Hour MaxVolIdentifierLength = 64 MaxPortGroupIdentifierLength = 64 MaxClusterPrefixLength = 3 CSIPrefix = "csi" DeletionPrefix = "_DEL" CsiHostPrefix = "csi-node-" CsiMVPrefix = "csi-mv-" CsiNoSrpSGPrefix = "csi-no-srp-sg-" CsiVolumePrefix = "csi-" CsiRepSGPrefix = "csi-rep-sg-" PublishContextDeviceWWN = "DEVICE_WWN" RemotePublishContextDeviceWWN = "REMOTE_DEVICE_WWN" PublishContextLUNAddress = "LUN_ADDRESS" RemotePublishContextLUNAddress = "REMOTE_LUN_ADDRESS" PortIdentifiers = "PORT_IDENTIFIERS" RemotePortIdentifiers = "REMOTE_PORT_IDENTIFIERS" PortIdentifierKeyCount = "PORT_IDENTIFIER_KEYS" RemotePortIdentifierKeyCount = "REMOTE_PORT_IDENTIFIER_KEYS" MaxPortIdentifierLength = 128 FCSuffix = "-FC" PGSuffix = "PG" IscsiTransportProtocol = "ISCSI" FcTransportProtocol = "FC" MaxSnapIdentifierLength = 32 SnapDelPrefix = "DEL" StorageGroup = "StorageGroup" Async = "ASYNC" Sync = "SYNC" Metro = "METRO" Consistent = "Consistent" Synchronized = "Synchronized" FailedOver = "Failed Over" Suspended = "Suspended" Invalid = "Invalid" Split = "Split" SyncInProgress = "SyncInProg" )
constants
const ( SymmetrixIDParam = "SYMID" ServiceLevelParam = "ServiceLevel" ContentSource = "VolumeContentSource" StoragePoolParam = "SRP" // If storage_group is set, this over-rides the generation of the Storage Group from SLO/SRP StorageGroupParam = "StorageGroup" ThickVolumesParam = "ThickVolumes" // "true" or "false" or "" (defaults thin) ApplicationPrefixParam = "ApplicationPrefix" CapacityGB = "CapacityGB" // These params will be in replication enabled storage class RepEnabledParam = "isReplicationEnabled" LocalRDFGroupParam = "RdfGroup" RemoteRDFGroupParam = "RemoteRDFGroup" RemoteSymIDParam = "RemoteSYMID" RemoteVolumeIDParam = "RemoteVolumeID" ReplicationModeParam = "RdfMode" CSIPVCNamespace = "csi.storage.k8s.io/pvc/namespace" CSIPersistentVolumeName = "csi.storage.k8s.io/pv/name" CSIPersistentVolumeClaimName = "csi.storage.k8s.io/pvc/name" // These map to the above fields in the form of HTTP header names. HeaderPersistentVolumeName = "x-csi-pv-name" HeaderPersistentVolumeClaimName = "x-csi-pv-claimname" HeaderPersistentVolumeClaimNamespace = "x-csi-pv-namespace" RemoteServiceLevelParam = "RemoteServiceLevel" RemoteSRPParam = "RemoteSRP" BiasParam = "Bias" FsTypeParam = "csi.storage.k8s.io/fstype" )
Keys for parameters to CreateVolume
const ( DeletionQueueLength = 10000 MaxRequestsPerStep = 1000 MaxErrorsStored = 5 MaxErrorCount = 100 CacheValidTime = 30 * time.Minute MinPollingInterval = 3 * time.Second WaitTillSyncInProgTime = 20 * time.Second FinalError = "Final error: Max error count reached, device will be removed from Deletion Queue" )
Constants used by deletion worker
const ( // EnvDriverName is the name of the enviroment variable used to set the // name of the driver EnvDriverName = "X_CSI_POWERMAX_DRIVER_NAME" // EnvEndpoint is the name of the enviroment variable used to set the // HTTP endpoint of Unisphere EnvEndpoint = "X_CSI_POWERMAX_ENDPOINT" // EnvUser is the name of the enviroment variable used to set the // username when authenticating to Unisphere EnvUser = "X_CSI_POWERMAX_USER" // EnvPassword is the name of the enviroment variable used to set the // user's password when authenticating to Unisphere // #nosec G101 EnvPassword = "X_CSI_POWERMAX_PASSWORD" // #nosec G101 // EnvSkipCertificateValidation is the name of the environment variable used // to specify Unisphere's certificate chain and host name should not // be validated. EnvSkipCertificateValidation = "X_CSI_POWERMAX_SKIP_CERTIFICATE_VALIDATION" // EnvNodeName is the name of the enviroment variable used to set the // hostname where the node service is running EnvNodeName = "X_CSI_POWERMAX_NODENAME" // EnvThick is the name of the enviroment variable used to specify // that thick provisioning should be used when creating volumes EnvThick = "X_CSI_POWERMAX_THICKPROVISIONING" // EnvAutoProbe is the name of the environment variable used to specify // that the controller service should automatically probe itself if it // receives incoming requests before having been probed, in direct // violation of the CSI spec EnvAutoProbe = "X_CSI_POWERMAX_AUTOPROBE" // EnvPortGroups is the name of the environment variable that is used // to specifiy a list of Port Groups that the driver can choose from // These Port Groups must exist and be populated EnvPortGroups = "X_CSI_POWERMAX_PORTGROUPS" // EnvClusterPrefix is the name of the environment variable that is used // to specifiy a a prefix to apply to objects creaated via this CSI cluster EnvClusterPrefix = "X_CSI_K8S_CLUSTER_PREFIX" // EnvISCSIChroot is the path to which the driver will chroot before // running any iscsi commands. This value should only be set when instructed // by technical support. EnvISCSIChroot = "X_CSI_ISCSI_CHROOT" // EnvGrpcMaxThreads is the configuration value of the maximum number of concurrent // grpc requests. This value should be an integer string. EnvGrpcMaxThreads = "X_CSI_GRPC_MAX_THREADS" // EnvEnableBlock enables block capabilities support. EnvEnableBlock = "X_CSI_ENABLE_BLOCK" // EnvPreferredTransportProtocol enables you to be able to force the transport protocol. // Valid values are "FC" or "ISCSI" or "". If "", will choose FC if both are available. // This is mainly for testing. EnvPreferredTransportProtocol = "X_CSI_TRANSPORT_PROTOCOL" // EnvUnisphereProxyServiceName is the name of the proxy service in kubernetes // If set, then driver will attempt to read the associated env value // If set to none, then the driver will connect to Unisphere EnvUnisphereProxyServiceName = "X_CSI_POWERMAX_PROXY_SERVICE_NAME" // EnvSidecarProxyPort is the port port on which the reverse proxy // server run, if run as a sidecar container EnvSidecarProxyPort = "X_CSI_POWERMAX_SIDECAR_PROXY_PORT" // EnvEnableCHAP is the flag which determines if the driver is going // to set the CHAP credentials in the ISCSI node database at the time // of node plugin boot EnvEnableCHAP = "X_CSI_POWERMAX_ISCSI_ENABLE_CHAP" // EnvISCSICHAPUserName is the the username for the ISCSI CHAP // authentication for the host initiator(s) // If set to none, then the driver will use the ISCSI IQN as the username EnvISCSICHAPUserName = "X_CSI_POWERMAX_ISCSI_CHAP_USERNAME" // EnvISCSICHAPPassword is the the password for the ISCSI CHAP // authentication for the host initiator(s) // #nosec G101 EnvISCSICHAPPassword = "X_CSI_POWERMAX_ISCSI_CHAP_PASSWORD" // #nosec 101 // EnvNodeNameTemplate is the templatized name to construct node names // by the driver based on a name format as specified by the user in this // variable EnvNodeNameTemplate = "X_CSI_IG_NODENAME_TEMPLATE" // EnvModifyHostName when this value is set to "true", the driver will // modify the existing host name to a new name as specified in the EnvNodeNameTemplate EnvModifyHostName = "X_CSI_IG_MODIFY_HOSTNAME" // EnvProxyEnabled is the flag which indicates if the REST endpoint URL // is pointing to the reverse proxy // Only used for testing EnvProxyEnabled = "X_CSI_REVERSE_PROXY_ENABLED" // EnvReplicationContextPrefix enables sidecars to read required information from volume context EnvReplicationContextPrefix = "X_CSI_REPLICATION_CONTEXT_PREFIX" // EnvReplicationPrefix is used as a prefix to find out if replication is enabled EnvReplicationPrefix = "X_CSI_REPLICATION_PREFIX" // EnvManagedArrays is an env variable with a list of space separated arrays. EnvManagedArrays = "X_CSI_MANAGED_ARRAYS" // EnvConfigFilePath is an env variable which contains the full path for the config file EnvConfigFilePath = "X_CSI_POWERMAX_CONFIG_PATH" // EnvHealthMonitorEnabled is an env variable which indicated if volume health monitor is enabled EnvHealthMonitorEnabled = "X_CSI_HEALTH_MONITOR_ENABLED" // EnvTopoConfigFilePath is an env variable which contains the full path for topology config file EnvTopoConfigFilePath = "X_CSI_POWERMAX_TOPOLOGY_CONFIG_PATH" // EnvTopologyFilterEnabled is an env variable which indicated if volume health monitor is enabled EnvTopologyFilterEnabled = "X_CSI_TOPOLOGY_CONTROL_ENABLED" )
const ( Establish = "Establish" Resume = "Resume" Suspend = "Suspend" FailOver = "Failover" Swap = "Swap" FailBack = "Failback" Reprotect = "Reprotect" )
Supported actions
const ( Name = "csi-powermax.dellemc.com" // Name is the name of the CSI plug-in. ApplicationName = "CSI Driver for Dell EMC PowerMax" // ApplicationName is the name used to register with Powermax REST APIs CSILogLevelParam = "CSI_LOG_LEVEL" CSILogFormatParam = "CSI_LOG_FORMAT" )
Constants for the service
const ( TempSnap = "CSI_TEMP_SNAP" Defined = "Defined" Link = "Link" Unlink = "Unlink" Rename = "Rename" MaxUnlinkCount = 5 )
The follow constants are for internal use within the pmax library.
Variables ¶
var Manifest = map[string]string{ "url": "http://github.com/dell/csi-powermax", "semver": core.SemVer, "commit": core.CommitSha32, "formed": core.CommitTime.Format(time.RFC1123), }
Manifest is the SP's manifest.
Functions ¶
func CleanupMapEntries ¶
CleanupMapEntries - clean up stale entries from the map
func GetRDFInfoFromSGID ¶
func GetRDFInfoFromSGID(storageGroupID string) (namespace string, rDFGno string, repMode string, err error)
GetRDFInfoFromSGID returns namespace , RDFG number and replication mode
func LockRequestHandler ¶
func LockRequestHandler()
LockRequestHandler - goroutine which listens for any lock/unlock requests
func ReleaseLock ¶
ReleaseLock - Release a held lock for resourceID Input lockNum should be the same as one returned by RequestLock
func RequestLock ¶
RequestLock - Request for lock for a given resource ID requestID is optional returns a lock number which is used later to release the lock
Types ¶
type FCTargetInfo ¶
type FCTargetInfo struct {
WWPN string
}
FCTargetInfo represents basic information about FC target
type ISCSITargetInfo ¶
ISCSITargetInfo represents basic information about iSCSI target
type LockInfo ¶
type LockInfo struct { LockRequests chan LockRequestInfo CurrentLockNumber int CurrentWaitChannel chan int Count int }
LockInfo - Stores information about each resource id in the map
type LockRequest ¶
LockRequest - Input structure to specify a request for locking a resource
type LockRequestInfo ¶
LockRequestInfo - Stores information about each lock request
type NodeConfig ¶ added in v2.3.0
type NodeConfig struct { NodeName string `yaml:"nodeName, omitempty"` Rules []string `yaml:"rules, omitempty"` }
NodeConfig defines rules for given node
type Opts ¶
type Opts struct { Endpoint string UseProxy bool ProxyServiceHost string ProxyServicePort string User string Password string SystemName string NodeName string TransportProtocol string DriverName string CHAPUserName string CHAPPassword string Insecure bool Thick bool AutoProbe bool EnableBlock bool EnableCHAP bool PortGroups []string ClusterPrefix string ManagedArrays []string DisableCerts bool // used for unit testing only Lsmod string // used for unit testing only EnableSnapshotCGDelete bool // when snapshot deleted, enable deleting of all snaps in the CG of the snapshot EnableListVolumesSnapshots bool // when listing volumes, include snapshots and volumes GrpcMaxThreads int // Maximum threads configured in grpc NonDefaultRetries bool // Indicates if non-default retry values to be used for deletion worker, only for unit testing NodeNameTemplate string ModifyHostName bool IsReverseProxyEnabled bool ReplicationContextPrefix string // Enables sidecars to read required information from volume context ReplicationPrefix string // Used as a prefix to find out if replication is enabled IsHealthMonitorEnabled bool // used to check if health monitor for volume is enabled IsTopologyControlEnabled bool // used to filter topology keys based on user config }
Opts defines service configuration options.
type Pair ¶
type Pair struct {
// contains filtered or unexported fields
}
Pair - structure which holds a pair
type Service ¶
type Service interface { csi.ControllerServer csi.IdentityServer csi.NodeServer csiext.ReplicationServer migrext.MigrationServer BeforeServe(context.Context, *gocsi.StoragePlugin, net.Listener) error RegisterAdditionalServers(server *grpc.Server) }
Service is the CSI Mock service provider.
type SnapSession ¶
type SnapSession struct { Source string Name string Generation int64 Expired bool Target []types.SnapTarget }
SnapSession is an intermediate structure to share session info
type TopologyConfig ¶ added in v2.3.0
type TopologyConfig struct { AllowedConnections []NodeConfig `yaml:"allowedConnections, omitempty" mapstructure:"allowedConnections"` DeniedConnections []NodeConfig `yaml:"deniedConnections, omitempty" mapstructure:"deniedConnections"` }
TopologyConfig defines set of allow and deny rules for multiple nodes
func ReadConfig ¶ added in v2.3.0
func ReadConfig(configPath string) (*TopologyConfig, error)
ReadConfig will read topology configmap on the default path into TopologyConfig struct