Documentation ¶
Overview ¶
* Copyright (c) 2015-2018 Nexenta Systems, Inc. * * This file is part of EdgeFS Project * (see https://github.com/Nexenta/edgefs). * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
* Copyright (c) 2015-2018 Nexenta Systems, Inc. * * This file is part of EdgeFS Project * (see https://github.com/Nexenta/edgefs). * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
Index ¶
- func AttachISCSIVolume(name, mountpoint string, publishInfo *VolumePublishInfo, logger *logrus.Entry) error
- func ConsistentRead(filename string, attempts int) ([]byte, error)
- func EnsureISCSISession(hostDataIP string) error
- func EnsureISCSISessions(hostDataIPs []string) error
- func GetDeviceNameFromMount(mountpath string) (string, int, error)
- func GetInitiatorIqns() ([]string, error)
- func ISCSIDisableDelete(targetIQN, targetPortal string) error
- func ISCSISupported() bool
- func ISCSITargetHasMountedDevice(targetIQN string) (bool, error)
- func IsLikelyNotMountPoint(mountpoint string) (bool, error)
- func MountDevice(device, mountpoint, options string) (err error)
- func PathExists(path string) bool
- func PrepareDeviceAtMountPathForRemoval(mountpoint string, unmount bool, logger *logrus.Entry) error
- func PrepareDeviceForRemoval(lunID int, iSCSINodeName string)
- func Umount(mountpoint string) (err error)
- type ControllerServer
- func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (cs *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type DFInfo
- type ISCSIDiscoveryInfo
- type ISCSISessionInfo
- type IscsiAccessInfo
- type MountPoint
- type NodeServer
- func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (d *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (c *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- type ScsiDeviceInfo
- type VolumeAccessInfo
- type VolumePublishInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachISCSIVolume ¶
func AttachISCSIVolume(name, mountpoint string, publishInfo *VolumePublishInfo, logger *logrus.Entry) error
Attach the volume to the local host. This method must be able to accomplish its task using only the data passed in. It may be assumed that this method always runs on the host to which the volume will be attached. If the mountpoint parameter is specified, the volume will be mounted. The device path is set on the in-out publishInfo parameter so that it may be mounted later instead.
func ConsistentRead ¶
ConsistentRead repeatedly reads a file until it gets the same content twice. This is useful when reading files in /proc that are larger than page size and kernel may modify them between individual read() syscalls.
func EnsureISCSISession ¶
func EnsureISCSISessions ¶
func GetInitiatorIqns ¶
GetInitiatorIqns returns parsed contents of /etc/iscsi/initiatorname.iscsi
func ISCSIDisableDelete ¶
ISCSIDisableDelete logs out from the supplied target and removes the iSCSI device.
func ISCSISupported ¶
func ISCSISupported() bool
ISCSISupported returns true if iscsiadm is installed and in the PATH.
func ISCSITargetHasMountedDevice ¶
ISCSITargetHasMountedDevice returns true if this host has any mounted devices on the specified target.
func IsLikelyNotMountPoint ¶
IsLikelyNotMountPoint determines if a directory is not a mountpoint.
func MountDevice ¶
MountDevice attaches the supplied device at the supplied location. Use this for iSCSI devices.
func PathExists ¶
PathExists returns true if the file/directory at the specified path exists, false otherwise or if an error occurs.
func PrepareDeviceAtMountPathForRemoval ¶
func PrepareDeviceAtMountPathForRemoval(mountpoint string, unmount bool, logger *logrus.Entry) error
PrepareDeviceAtMountPathForRemoval informs Linux that a device will be removed.
func PrepareDeviceForRemoval ¶
PrepareDeviceForRemoval informs Linux that a device will be removed.
Types ¶
type ControllerServer ¶
func (*ControllerServer) ControllerExpandVolume ¶
func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
func (*ControllerServer) ControllerGetCapabilities ¶
func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) ( *csi.ControllerGetCapabilitiesResponse, error, )
ControllerGetCapabilities - controller capabilities
func (*ControllerServer) ControllerPublishVolume ¶
func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
func (*ControllerServer) ControllerUnpublishVolume ¶
func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
func (*ControllerServer) CreateSnapshot ¶
func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) ( *csi.CreateSnapshotResponse, error, )
func (*ControllerServer) CreateVolume ¶
func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
func (*ControllerServer) DeleteSnapshot ¶
func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) ( *csi.DeleteSnapshotResponse, error, )
func (*ControllerServer) DeleteVolume ¶
func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
func (*ControllerServer) GetCapacity ¶
func (cs *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) ( *csi.GetCapacityResponse, error, )
GetCapacity - not implemented
func (*ControllerServer) ListSnapshots ¶
func (cs *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) ( *csi.ListSnapshotsResponse, error, )
func (*ControllerServer) ListVolumes ¶
func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
func (*ControllerServer) ValidateVolumeCapabilities ¶
func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
type ISCSIDiscoveryInfo ¶
ISCSIDiscoveryInfo contains information about discovered iSCSI targets.
type ISCSISessionInfo ¶
ISCSISessionInfo contains information about iSCSI sessions.
type IscsiAccessInfo ¶
type IscsiAccessInfo struct { IscsiTargetPortal string `json:"iscsiTargetPortal,omitempty"` IscsiPortals []string `json:"iscsiPortals,omitempty"` IscsiTargetIQN string `json:"iscsiTargetIqn,omitempty"` IscsiLunNumber int32 `json:"iscsiLunNumber,omitempty"` IscsiInterface string `json:"iscsiInterface,omitempty"` IscsiIgroup string `json:"iscsiIgroup,omitempty"` IscsiVAGs []int64 `json:"iscsiVags,omitempty"` IscsiUsername string `json:"iscsiUsername,omitempty"` IscsiInitiatorSecret string `json:"iscsiInitiatorSecret,omitempty"` IscsiTargetSecret string `json:"iscsiTargetSecret,omitempty"` }
type MountPoint ¶
This represents a single line in /proc/mounts or /etc/fstab.
type NodeServer ¶
func (*NodeServer) NodeExpandVolume ¶
func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
func (*NodeServer) NodeGetCapabilities ¶
func (d *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
func (*NodeServer) NodeGetInfo ¶
func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
func (*NodeServer) NodeGetVolumeStats ¶
func (c *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
func (*NodeServer) NodePublishVolume ¶
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
func (*NodeServer) NodeStageVolume ¶
func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
func (*NodeServer) NodeUnpublishVolume ¶
func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
func (*NodeServer) NodeUnstageVolume ¶
func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
type ScsiDeviceInfo ¶
type ScsiDeviceInfo struct { Host string Channel string Target string LUN string Devices []string MultipathDevice string Filesystem string IQN string HostSessionMap map[int]int }
ScsiDeviceInfo contains information about SCSI devices
func GetDeviceInfoForMountPath ¶
func GetDeviceInfoForMountPath(mountpath string) (*ScsiDeviceInfo, error)
getDeviceInfoForMountPath discovers the device that is currently mounted at the specified mount path. It uses the ScsiDeviceInfo struct so that it may return a multipath device (if any) plus one or more underlying physical devices.
func GetISCSIDevices ¶
func GetISCSIDevices() ([]*ScsiDeviceInfo, error)
GetISCSIDevices returns a list of iSCSI devices that are attached to (but not necessarily mounted on) this host.
func GetMountedISCSIDevices ¶
func GetMountedISCSIDevices() ([]*ScsiDeviceInfo, error)
GetMountedISCSIDevices returns a list of iSCSI devices that are *mounted* on this host.
type VolumeAccessInfo ¶
type VolumeAccessInfo struct { IscsiAccessInfo MountOptions string `json:"mountOptions,omitempty"` }
type VolumePublishInfo ¶
type VolumePublishInfo struct { Localhost bool `json:"localhost,omitempty"` HostIQN []string `json:"hostIQN,omitempty"` HostIP []string `json:"hostIP,omitempty"` HostName string `json:"hostName,omitempty"` FilesystemType string `json:"fstype,omitempty"` UseCHAP bool `json:"useCHAP,omitempty"` DevicePath string `json:"devicePath,omitempty"` VolumeAccessInfo }