Documentation ¶
Index ¶
- Constants
- func ConvertString2int(origin string) string
- func GetLvmdPort() string
- func ListPV(vgName string) ([]*lib.PV, error)
- func MustRunThisWhenTest()
- func NewGRPCServer() (*grpc.Server, *client.CredstoreClient, error)
- func Start(port string)
- func StartFake()
- type FakeCommands
- func (fake *FakeCommands) AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func (fake *FakeCommands) CleanDevice(ctx context.Context, device string) (string, error)
- func (fake *FakeCommands) CleanPath(ctx context.Context, path string) error
- func (fake *FakeCommands) CloneLV(ctx context.Context, src, dest string) (string, error)
- func (fake *FakeCommands) CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, ...) (string, error)
- func (fake *FakeCommands) CreateSnapshot(ctx context.Context, vgName string, snapshotName string, srcVolumeName string, ...) (int64, error)
- func (fake *FakeCommands) CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
- func (fake *FakeCommands) ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error)
- func (fake *FakeCommands) ListLV(listspec string) ([]*lib.LV, error)
- func (fake *FakeCommands) ListVG() ([]*lib.VG, error)
- func (fake *FakeCommands) RemoveLV(ctx context.Context, vg string, name string) (string, error)
- func (fake *FakeCommands) RemoveSnapshot(ctx context.Context, vg string, name string, readonly bool) (string, error)
- func (fake *FakeCommands) RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func (fake *FakeCommands) RemoveVG(ctx context.Context, name string) (string, error)
- type LvmCmd
- type LvmCommads
- func (lvm *LvmCommads) AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func (lvm *LvmCommads) CleanDevice(ctx context.Context, device string) (string, error)
- func (lvm *LvmCommads) CleanPath(ctx context.Context, path string) error
- func (lvm *LvmCommads) CloneLV(ctx context.Context, src, dest string) (string, error)
- func (lvm *LvmCommads) CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, ...) (string, error)
- func (lvm *LvmCommads) CreateNameSpace(ctx context.Context, region string, name string, size uint64) (string, error)
- func (lvm *LvmCommads) CreateSnapshot(ctx context.Context, vgName string, snapshotName string, srcVolumeName string, ...) (int64, error)
- func (lvm *LvmCommads) CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
- func (lvm *LvmCommads) ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error)
- func (lvm *LvmCommads) GetNamespaceAssignedQuota(namespace string) (int, error)
- func (lvm *LvmCommads) ListLV(listspec string) ([]*lib.LV, error)
- func (lvm *LvmCommads) ListVG() ([]*lib.VG, error)
- func (lvm *LvmCommads) RemoveLV(ctx context.Context, vg string, name string) (string, error)
- func (lvm *LvmCommads) RemoveProjQuotaSubpath(ctx context.Context, quotaSubpath string) (string, error)
- func (lvm *LvmCommads) RemoveSnapshot(ctx context.Context, vg string, name string, readonly bool) (string, error)
- func (lvm *LvmCommads) RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func (lvm *LvmCommads) RemoveVG(ctx context.Context, name string) (string, error)
- func (lvm *LvmCommads) SetProjectID2PVSubpath(subPath, fullPath string, run utils.CommandRunFunc) (string, error)
- func (lvm *LvmCommads) SetSubpathProjQuota(ctx context.Context, projQuotaSubpath, blockHardlimit, blockSoftlimit string) (string, error)
- type Server
- func (s Server) AddTagLV(ctx context.Context, in *lib.AddTagLVRequest) (*lib.AddTagLVReply, error)
- func (s Server) CleanDevice(ctx context.Context, in *lib.CleanDeviceRequest) (*lib.CleanDeviceReply, error)
- func (s Server) CleanPath(ctx context.Context, in *lib.CleanPathRequest) (*lib.CleanPathReply, error)
- func (s Server) CloneLV(ctx context.Context, in *lib.CloneLVRequest) (*lib.CloneLVReply, error)
- func (s Server) CreateLV(ctx context.Context, in *lib.CreateLVRequest) (*lib.CreateLVReply, error)
- func (s Server) CreateSnapshot(ctx context.Context, in *lib.CreateSnapshotRequest) (*lib.CreateSnapshotReply, error)
- func (s Server) CreateVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.CreateVGReply, error)
- func (s Server) ExpandLV(ctx context.Context, in *lib.ExpandLVRequest) (*lib.ExpandLVReply, error)
- func (s Server) ListLV(ctx context.Context, in *lib.ListLVRequest) (*lib.ListLVReply, error)
- func (s Server) ListVG(ctx context.Context, in *lib.ListVGRequest) (*lib.ListVGReply, error)
- func (s Server) RemoveLV(ctx context.Context, in *lib.RemoveLVRequest) (*lib.RemoveLVReply, error)
- func (s Server) RemoveSnapshot(ctx context.Context, in *lib.RemoveSnapshotRequest) (*lib.RemoveSnapshotReply, error)
- func (s Server) RemoveTagLV(ctx context.Context, in *lib.RemoveTagLVRequest) (*lib.RemoveTagLVReply, error)
- func (s Server) RemoveVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.RemoveVGReply, error)
- type SpdkCommands
- func (cmd *SpdkCommands) AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func (cmd *SpdkCommands) CleanDevice(ctx context.Context, device string) (string, error)
- func (cmd *SpdkCommands) CleanPath(ctx context.Context, path string) error
- func (cmd *SpdkCommands) CloneLV(ctx context.Context, src, dest string) (string, error)
- func (cmd *SpdkCommands) CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, ...) (string, error)
- func (cmd *SpdkCommands) CreateSnapshot(ctx context.Context, vgName string, snapshotName string, srcVolumeName string, ...) (int64, error)
- func (cmd *SpdkCommands) CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
- func (cmd *SpdkCommands) ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error)
- func (cmd *SpdkCommands) ListLV(listspec string) ([]*lib.LV, error)
- func (cmd *SpdkCommands) ListVG() ([]*lib.VG, error)
- func (cmd *SpdkCommands) RemoveLV(ctx context.Context, vg string, name string) (string, error)
- func (cmd *SpdkCommands) RemoveSnapshot(ctx context.Context, vg string, name string, readonly bool) (string, error)
- func (cmd *SpdkCommands) RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func (cmd *SpdkCommands) RemoveVG(ctx context.Context, name string) (string, error)
Constants ¶
const ( // ProjQuotaPrefix is the template of quota fullpath ProjQuotaPrefix = "/mnt/quotapath.%s/%s" // ProjQuotaNamespacePrefix ... ProjQuotaNamespacePrefix = "/mnt/quotapath.%s" )
const ProtectedTagName = "protected"
ProtectedTagName is a tag that prevents RemoveLV & RemoveVG from removing a volume
Variables ¶
This section is empty.
Functions ¶
func ConvertString2int ¶
ConvertString2int convert pvName to int data
func MustRunThisWhenTest ¶ added in v0.6.0
func MustRunThisWhenTest()
func NewGRPCServer ¶ added in v0.6.0
func NewGRPCServer() (*grpc.Server, *client.CredstoreClient, error)
NewServer creates a new GRPC server stub with credstore auth (if requested).
Types ¶
type FakeCommands ¶ added in v0.6.0
type FakeCommands struct{}
func (*FakeCommands) CleanDevice ¶ added in v0.6.0
func (*FakeCommands) CleanPath ¶ added in v0.6.0
func (fake *FakeCommands) CleanPath(ctx context.Context, path string) error
func (*FakeCommands) CreateSnapshot ¶ added in v0.6.0
func (*FakeCommands) ListLV ¶ added in v0.6.0
func (fake *FakeCommands) ListLV(listspec string) ([]*lib.LV, error)
ListLV lists lvm volumes
func (*FakeCommands) RemoveSnapshot ¶ added in v0.6.0
func (*FakeCommands) RemoveTagLV ¶ added in v0.6.0
type LvmCmd ¶ added in v0.6.0
type LvmCmd interface { ListLV(listspec string) ([]*lib.LV, error) CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, tags []string, striping bool) (string, error) RemoveLV(ctx context.Context, vg string, name string) (string, error) CloneLV(ctx context.Context, src, dest string) (string, error) ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error) CreateSnapshot(ctx context.Context, vgName string, snapshotName string, srcVolumeName string, readonly bool, roInitSize int64, secrets map[string]string) (int64, error) RemoveSnapshot(ctx context.Context, vg string, name string, readonly bool) (string, error) AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error) RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error) ListVG() ([]*lib.VG, error) CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error) RemoveVG(ctx context.Context, name string) (string, error) CleanPath(ctx context.Context, path string) error CleanDevice(ctx context.Context, device string) (string, error) }
type LvmCommads ¶ added in v0.6.0
type LvmCommads struct {
// contains filtered or unexported fields
}
func (*LvmCommads) AddTagLV ¶ added in v0.6.0
func (lvm *LvmCommads) AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
AddTagLV add tag
func (*LvmCommads) CleanDevice ¶ added in v0.6.0
func (*LvmCommads) CleanPath ¶ added in v0.6.0
func (lvm *LvmCommads) CleanPath(ctx context.Context, path string) error
CleanPath deletes all the contents under the given directory
func (*LvmCommads) CreateLV ¶ added in v0.6.0
func (lvm *LvmCommads) CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, tags []string, striping bool) (string, error)
CreateLV creates a new volume
func (*LvmCommads) CreateNameSpace ¶ added in v0.6.0
func (lvm *LvmCommads) CreateNameSpace(ctx context.Context, region string, name string, size uint64) (string, error)
CreateNameSpace creates a new namespace ndctl create-namespace -r region0 --size=6G -n webpmem1
func (*LvmCommads) CreateSnapshot ¶ added in v0.6.0
func (lvm *LvmCommads) CreateSnapshot(ctx context.Context, vgName string, snapshotName string, srcVolumeName string, readonly bool, roInitSize int64, secrets map[string]string) (int64, error)
CreateSnapshot creates a new volume snapshot
func (*LvmCommads) CreateVG ¶ added in v0.6.0
func (lvm *LvmCommads) CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
CreateVG create volume group
func (*LvmCommads) ExpandLV ¶ added in v0.6.0
func (lvm *LvmCommads) ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error)
ExpandLV expand a volume
func (*LvmCommads) GetNamespaceAssignedQuota ¶ added in v0.6.0
func (lvm *LvmCommads) GetNamespaceAssignedQuota(namespace string) (int, error)
GetNamespaceAssignedQuota ...
func (*LvmCommads) ListLV ¶ added in v0.6.0
func (lvm *LvmCommads) ListLV(listspec string) ([]*lib.LV, error)
ListLV lists lvm volumes
func (*LvmCommads) ListVG ¶ added in v0.6.0
func (lvm *LvmCommads) ListVG() ([]*lib.VG, error)
ListVG get vg info
func (*LvmCommads) RemoveProjQuotaSubpath ¶ added in v0.6.0
func (lvm *LvmCommads) RemoveProjQuotaSubpath(ctx context.Context, quotaSubpath string) (string, error)
RemoveProjQuotaSubpath ...
func (*LvmCommads) RemoveSnapshot ¶ added in v0.6.0
func (lvm *LvmCommads) RemoveSnapshot(ctx context.Context, vg string, name string, readonly bool) (string, error)
RemoveSnapshot removes a volume snapshot
func (*LvmCommads) RemoveTagLV ¶ added in v0.6.0
func (lvm *LvmCommads) RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
RemoveTagLV remove tag
func (*LvmCommads) SetProjectID2PVSubpath ¶ added in v0.6.0
func (lvm *LvmCommads) SetProjectID2PVSubpath(subPath, fullPath string, run utils.CommandRunFunc) (string, error)
SetProjectID2PVSubpath ...
func (*LvmCommads) SetSubpathProjQuota ¶ added in v0.6.0
func (lvm *LvmCommads) SetSubpathProjQuota(ctx context.Context, projQuotaSubpath, blockHardlimit, blockSoftlimit string) (string, error)
SetSubpathProjQuota ...
type Server ¶
type Server struct { lib.UnimplementedLVMServer // contains filtered or unexported fields }
Server lvm grpc server
func (Server) AddTagLV ¶
func (s Server) AddTagLV(ctx context.Context, in *lib.AddTagLVRequest) (*lib.AddTagLVReply, error)
AddTagLV add tag
func (Server) CleanDevice ¶ added in v0.3.1
func (s Server) CleanDevice(ctx context.Context, in *lib.CleanDeviceRequest) (*lib.CleanDeviceReply, error)
CleanDevice wipefs
func (Server) CleanPath ¶
func (s Server) CleanPath(ctx context.Context, in *lib.CleanPathRequest) (*lib.CleanPathReply, error)
CleanPath remove file under path
func (Server) CloneLV ¶
func (s Server) CloneLV(ctx context.Context, in *lib.CloneLVRequest) (*lib.CloneLVReply, error)
CloneLV clone lvm volume
func (Server) CreateLV ¶
func (s Server) CreateLV(ctx context.Context, in *lib.CreateLVRequest) (*lib.CreateLVReply, error)
CreateLV create lvm volume
func (Server) CreateSnapshot ¶
func (s Server) CreateSnapshot(ctx context.Context, in *lib.CreateSnapshotRequest) (*lib.CreateSnapshotReply, error)
CreateSnapshot create lvm snapshot
func (Server) CreateVG ¶
func (s Server) CreateVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.CreateVGReply, error)
CreateVG create volume group
func (Server) ExpandLV ¶
func (s Server) ExpandLV(ctx context.Context, in *lib.ExpandLVRequest) (*lib.ExpandLVReply, error)
ExpandLV expand lvm volume
func (Server) ListLV ¶
func (s Server) ListLV(ctx context.Context, in *lib.ListLVRequest) (*lib.ListLVReply, error)
ListLV list lvm volume
func (Server) ListVG ¶
func (s Server) ListVG(ctx context.Context, in *lib.ListVGRequest) (*lib.ListVGReply, error)
ListVG list volume group
func (Server) RemoveLV ¶
func (s Server) RemoveLV(ctx context.Context, in *lib.RemoveLVRequest) (*lib.RemoveLVReply, error)
RemoveLV remove lvm volume
func (Server) RemoveSnapshot ¶
func (s Server) RemoveSnapshot(ctx context.Context, in *lib.RemoveSnapshotRequest) (*lib.RemoveSnapshotReply, error)
RemoveSnapshot remove lvm snapshot
func (Server) RemoveTagLV ¶
func (s Server) RemoveTagLV(ctx context.Context, in *lib.RemoveTagLVRequest) (*lib.RemoveTagLVReply, error)
RemoveTagLV remove tag
func (Server) RemoveVG ¶
func (s Server) RemoveVG(ctx context.Context, in *lib.CreateVGRequest) (*lib.RemoveVGReply, error)
RemoveVG remove volume group
type SpdkCommands ¶ added in v0.6.0
type SpdkCommands struct {
// contains filtered or unexported fields
}
func NewSpdkCommands ¶ added in v0.6.0
func NewSpdkCommands(rpcSocket string) *SpdkCommands
func (*SpdkCommands) AddTagLV ¶ added in v0.6.0
func (cmd *SpdkCommands) AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
AddTagLV add tag
func (*SpdkCommands) CleanDevice ¶ added in v0.6.0
func (*SpdkCommands) CleanPath ¶ added in v0.6.0
func (cmd *SpdkCommands) CleanPath(ctx context.Context, path string) error
CleanPath deletes all the contents under the given directory
func (*SpdkCommands) CreateLV ¶ added in v0.6.0
func (cmd *SpdkCommands) CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, tags []string, striping bool) (string, error)
CreateLV creates a new logical volume and relevant vhost device
func (*SpdkCommands) CreateSnapshot ¶ added in v0.6.0
func (cmd *SpdkCommands) CreateSnapshot(ctx context.Context, vgName string, snapshotName string, srcVolumeName string, readonly bool, roInitSize int64, secrets map[string]string) (int64, error)
CreateSnapshot creates a new volume snapshot
func (*SpdkCommands) CreateVG ¶ added in v0.6.0
func (cmd *SpdkCommands) CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
CreateVG create volume group (lvstore)
func (*SpdkCommands) ExpandLV ¶ added in v0.6.0
func (cmd *SpdkCommands) ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error)
ExpandLV expand a logical volume
func (*SpdkCommands) ListLV ¶ added in v0.6.0
func (cmd *SpdkCommands) ListLV(listspec string) ([]*lib.LV, error)
ListLV lists logical volumes listspec: vg/volumeID
func (*SpdkCommands) ListVG ¶ added in v0.6.0
func (cmd *SpdkCommands) ListVG() ([]*lib.VG, error)
ListVG get volume group (lvstore) info
func (*SpdkCommands) RemoveSnapshot ¶ added in v0.6.0
func (cmd *SpdkCommands) RemoveSnapshot(ctx context.Context, vg string, name string, readonly bool) (string, error)
RemoveSnapshot removes a volume snapshot
func (*SpdkCommands) RemoveTagLV ¶ added in v0.6.0
func (cmd *SpdkCommands) RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
RemoveTagLV remove tag