Documentation ¶
Index ¶
- Constants
- func AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func CleanPath(ctx context.Context, path string) error
- func CloneLV(ctx context.Context, src, dest string) (string, error)
- func ConvertString2int(origin string) string
- func CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, ...) (string, error)
- func CreateNameSpace(ctx context.Context, region string, name string, size uint64) (string, error)
- func CreateSnapshot(ctx context.Context, vg string, snapshotName string, originLVName string, ...) (string, error)
- func CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
- func ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error)
- func GetLvmdPort() string
- func GetNamespaceAssignedQuota(namespace string) (int, error)
- func ListLV(listspec string) ([]*lib.LV, error)
- func ListPV(vgName string) ([]*lib.PV, error)
- func ListVG() ([]*lib.VG, error)
- func RemoveLV(ctx context.Context, vg string, name string) (string, error)
- func RemoveProjQuotaSubpath(ctx context.Context, quotaSubpath string) (string, error)
- func RemoveSnapshot(ctx context.Context, vg string, name string) (string, error)
- func RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)
- func RemoveVG(ctx context.Context, name string) (string, error)
- func SetProjectID2PVSubpath(subPath, fullPath string, run utils.CommandRunFunc) (string, error)
- func SetSubpathProjQuota(ctx context.Context, projQuotaSubpath, blockHardlimit, blockSoftlimit string) (string, error)
- func Start()
- type Server
- func (s Server) AddTagLV(ctx context.Context, in *lib.AddTagLVRequest) (*lib.AddTagLVReply, 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)
Constants ¶
const ( // ProjQuotaPrefix is the template of quota fullpath ProjQuotaPrefix = "/mnt/quotapath.%s/%s" // ProjQuotaNamespacePrefix ... ProjQuotaNamespacePrefix = "/mnt/quotapath.%s" )
const (
// LvmdPort is lvm daemon tcp port
LvmdPort = "1736"
)
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 CreateLV ¶
func CreateLV(ctx context.Context, vg string, name string, size uint64, mirrors uint32, tags []string, striping bool) (string, error)
CreateLV creates a new volume
func CreateNameSpace ¶
CreateNameSpace creates a new namespace ndctl create-namespace -r region0 --size=6G -n webpmem1
func CreateSnapshot ¶
func CreateSnapshot(ctx context.Context, vg string, snapshotName string, originLVName string, size uint64) (string, error)
CreateSnapshot creates a new volume snapshot
func CreateVG ¶
func CreateVG(ctx context.Context, name string, physicalVolume string, tags []string) (string, error)
CreateVG create volume group
func ExpandLV ¶
func ExpandLV(ctx context.Context, vgName string, volumeId string, expectSize uint64) (string, error)
ExpandLV expand a volume
func GetNamespaceAssignedQuota ¶
GetNamespaceAssignedQuota ...
func RemoveProjQuotaSubpath ¶
RemoveProjQuotaSubpath ...
func RemoveSnapshot ¶
RemoveSnapshot removes a volume snapshot
func RemoveTagLV ¶
RemoveTagLV remove tag
func SetProjectID2PVSubpath ¶
func SetProjectID2PVSubpath(subPath, fullPath string, run utils.CommandRunFunc) (string, error)
SetProjectID2PVSubpath ...
Types ¶
type Server ¶
type Server struct {
lib.UnimplementedLVMServer
}
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) 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