server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProjQuotaPrefix is the template of quota fullpath
	ProjQuotaPrefix = "/mnt/quotapath.%s/%s"
	// ProjQuotaNamespacePrefix ...
	ProjQuotaNamespacePrefix = "/mnt/quotapath.%s"
)
View Source
const (
	// LvmdPort is lvm daemon tcp port
	LvmdPort = "1736"
)
View Source
const ProtectedTagName = "protected"

ProtectedTagName is a tag that prevents RemoveLV & RemoveVG from removing a volume

Variables

This section is empty.

Functions

func AddTagLV

func AddTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)

AddTagLV add tag

func CleanPath

func CleanPath(ctx context.Context, path string) error

CleanPath deletes all the contents under the given directory

func CloneLV

func CloneLV(ctx context.Context, src, dest string) (string, error)

CloneLV clones a volume via dd

func ConvertString2int

func ConvertString2int(origin string) string

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

func 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 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 GetLvmdPort

func GetLvmdPort() string

GetLvmdPort get lvmd port

func GetNamespaceAssignedQuota

func GetNamespaceAssignedQuota(namespace string) (int, error)

GetNamespaceAssignedQuota ...

func ListLV

func ListLV(listspec string) ([]*lib.LV, error)

ListLV lists lvm volumes

func ListPV added in v0.2.2

func ListPV(vgName string) ([]*lib.PV, error)

ListPV get pv info in vg

func ListVG

func ListVG() ([]*lib.VG, error)

ListVG get vg info

func RemoveLV

func RemoveLV(ctx context.Context, vg string, name string) (string, error)

RemoveLV removes a volume

func RemoveProjQuotaSubpath

func RemoveProjQuotaSubpath(ctx context.Context, quotaSubpath string) (string, error)

RemoveProjQuotaSubpath ...

func RemoveSnapshot

func RemoveSnapshot(ctx context.Context, vg string, name string) (string, error)

RemoveSnapshot removes a volume snapshot

func RemoveTagLV

func RemoveTagLV(ctx context.Context, vg string, name string, tags []string) (string, error)

RemoveTagLV remove tag

func RemoveVG

func RemoveVG(ctx context.Context, name string) (string, error)

RemoveVG remove volume group

func SetProjectID2PVSubpath

func SetProjectID2PVSubpath(subPath, fullPath string, run utils.CommandRunFunc) (string, error)

SetProjectID2PVSubpath ...

func SetSubpathProjQuota

func SetSubpathProjQuota(ctx context.Context, projQuotaSubpath, blockHardlimit, blockSoftlimit string) (string, error)

SetSubpathProjQuota ...

func Start

func Start()

Start start lvmd

Types

type Server

type Server struct {
	lib.UnimplementedLVMServer
}

Server lvm grpc server

func NewServer

func NewServer() Server

NewServer new 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

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

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

Jump to

Keyboard shortcuts

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