Documentation
¶
Index ¶
- type CephDriver
- type CephMount
- type CephVolume
- func (cv *CephVolume) Create(fscmd string) error
- func (cv *CephVolume) CreateSnapshot(snapName string) error
- func (cv *CephVolume) Exists() (bool, error)
- func (cv *CephVolume) ListSnapshots() ([]string, error)
- func (cv *CephVolume) Mount(fstype string) (*CephMount, error)
- func (cv *CephVolume) Remove() error
- func (cv *CephVolume) RemoveSnapshot(snapName string) error
- func (cv *CephVolume) String() string
- func (cv *CephVolume) Unmount() error
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 CephMount ¶
CephMount is an informational struct returned by the Mount call to yield data on the mounted object.
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) (*CephMount, 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