cephdriver

package
v0.0.0-...-63ea086 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CephDriver

type CephDriver struct {
	// contains filtered or unexported fields
}

CephDriver is the principal struct in this package which corresponds to a ceph pool, and its parameters.

func NewCephDriver

func NewCephDriver() *CephDriver

NewCephDriver creates a new Ceph driver with default paths for mounting and device mapping.

func (*CephDriver) MountPath

func (cd *CephDriver) MountPath(poolName, volumeName string) string

MountPath joins the necessary parts to find the mount point for the volume name.

func (*CephDriver) NewVolume

func (cd *CephDriver) NewVolume(poolName, volumeName string, size uint64) *CephVolume

NewVolume returns a *CephVolume ready for use with volume operations.

func (*CephDriver) PoolExists

func (cd *CephDriver) PoolExists(poolName string) (bool, error)

PoolExists determines if a pool exists.

type CephVolume

type CephVolume struct {
	VolumeName string // Name of the volume
	PoolName   string
	VolumeSize uint64 // Size in MBs
	// contains filtered or unexported fields
}

CephVolume is a struct that communicates volume name and size.

func (*CephVolume) Create

func (cv *CephVolume) Create(fscmd string) error

Create creates an RBD image and initialize ext4 filesystem on the image

func (*CephVolume) CreateSnapshot

func (cv *CephVolume) CreateSnapshot(snapName string) error

CreateSnapshot creates a named snapshot for the volume. Any error will be returned.

func (*CephVolume) Exists

func (cv *CephVolume) Exists() (bool, error)

Exists returns true if the volume already exists.

func (*CephVolume) ListSnapshots

func (cv *CephVolume) ListSnapshots() ([]string, error)

ListSnapshots returns an array of snapshot names provided a maximum number of snapshots to be returned. Any error will be returned.

func (*CephVolume) Mount

func (cv *CephVolume) Mount(fstype string) error

Mount maps an RBD image and mount it on /mnt/ceph/<datastore>/<volume> directory FIXME: Figure out how to use rbd locks

func (*CephVolume) Remove

func (cv *CephVolume) Remove() error

Remove removes an RBD volume i.e. rbd image, and its snapshots

func (*CephVolume) RemoveSnapshot

func (cv *CephVolume) RemoveSnapshot(snapName string) error

RemoveSnapshot removes a named snapshot for the volume. Any error will be returned.

func (*CephVolume) String

func (cv *CephVolume) String() string

func (*CephVolume) Unmount

func (cv *CephVolume) Unmount() error

Unmount unmounts a Ceph volume, remove the mount directory and unmap the RBD device

Jump to

Keyboard shortcuts

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