devmapper

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DRIVER_NAME           = "devicemapper"
	DRIVER_CONFIG_FILE    = "devicemapper.cfg"
	DEFAULT_THINPOOL_NAME = "convoy-pool"
	DEFAULT_BLOCK_SIZE    = "4096"
	DM_DIR                = "/dev/mapper/"
	MOUNTS_DIR            = "mounts"

	THIN_PROVISION_TOOLS_BINARY      = "convoy-pdata_tools"
	THIN_PROVISION_TOOLS_MIN_VERSION = "0.5.1"

	DM_DATA_DEV            = "dm.datadev"
	DM_METADATA_DEV        = "dm.metadatadev"
	DM_THINPOOL_NAME       = "dm.thinpoolname"
	DM_THINPOOL_BLOCK_SIZE = "dm.thinpoolblocksize"
	DM_DEFAULT_VOLUME_SIZE = "dm.defaultvolumesize"
	DM_DEFAULT_FS_TYPE     = "dm.fs"

	// as defined in device mapper thin provisioning
	BLOCK_SIZE_MIN        = 128
	BLOCK_SIZE_MAX        = 2097152
	BLOCK_SIZE_MULTIPLIER = 128

	DEFAULT_VOLUME_SIZE = "100G"
	DEFAULT_FS_TYPE     = "ext4"

	SECTOR_SIZE = 512

	VOLUME_CFG_PREFIX    = "volume_"
	IMAGE_CFG_PREFIX     = "image_"
	DEVMAPPER_CFG_PREFIX = DRIVER_NAME + "_"
	CFG_POSTFIX          = ".json"

	DM_LOG_FIELD_VOLUME_DEVID   = "dm_volume_devid"
	DM_LOG_FIELD_SNAPSHOT_DEVID = "dm_snapshot_devid"

	MOUNT_BINARY  = "mount"
	UMOUNT_BINARY = "umount"

	DMLogLevel = devicemapper.LogLevelDebug
)

Variables

This section is empty.

Functions

func Init

func Init(root string, config map[string]string) (ConvoyDriver, error)

Types

type DMLogger added in v0.2.1

type DMLogger struct{}

func (*DMLogger) DMLog added in v0.2.1

func (logger *DMLogger) DMLog(level int, file string, line int, dmError int, message string)

type Device

type Device struct {
	Root              string
	DataDevice        string
	MetadataDevice    string
	ThinpoolDevice    string
	ThinpoolSize      int64
	ThinpoolBlockSize int64
	DefaultVolumeSize int64
	LastDevID         int
	Filesystem        string
}

func (*Device) ConfigFile added in v0.2.1

func (dev *Device) ConfigFile() (string, error)

type Driver

type Driver struct {
	Device
	// contains filtered or unexported fields
}

func (*Driver) BackupOps added in v0.2.1

func (d *Driver) BackupOps() (convoydriver.BackupOperations, error)

func (*Driver) CloseSnapshot

func (d *Driver) CloseSnapshot(id, volumeID string) error

func (*Driver) CompareSnapshot

func (d *Driver) CompareSnapshot(id, compareID, volumeID string) (*metadata.Mappings, error)

func (*Driver) CreateBackup added in v0.2.1

func (d *Driver) CreateBackup(snapshotID, volumeID, destURL, endpointURL string, opts map[string]string) (string, error)

func (*Driver) CreateSnapshot

func (d *Driver) CreateSnapshot(req Request) error

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(req Request) error

func (*Driver) DeleteBackup added in v0.2.1

func (d *Driver) DeleteBackup(backupURL, endpointURL string) error

func (*Driver) DeleteSnapshot

func (d *Driver) DeleteSnapshot(req Request) error

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(req Request) error

func (*Driver) GetBackupInfo added in v0.2.1

func (d *Driver) GetBackupInfo(backupURL, endpointURL string) (map[string]string, error)

func (*Driver) GetSnapshotInfo added in v0.2.1

func (d *Driver) GetSnapshotInfo(req Request) (map[string]string, error)

func (*Driver) GetVolumeDevice

func (d *Driver) GetVolumeDevice(id string) (string, error)

func (*Driver) GetVolumeInfo added in v0.2.1

func (d *Driver) GetVolumeInfo(id string) (map[string]string, error)

func (*Driver) HasSnapshot

func (d *Driver) HasSnapshot(id, volumeID string) bool

func (*Driver) Info

func (d *Driver) Info() (map[string]string, error)

func (*Driver) ListBackup added in v0.2.1

func (d *Driver) ListBackup(destURL, endpointURL string, opts map[string]string) (map[string]map[string]string, error)

func (*Driver) ListSnapshot added in v0.2.1

func (d *Driver) ListSnapshot(opts map[string]string) (map[string]map[string]string, error)

func (*Driver) ListVolume

func (d *Driver) ListVolume(opts map[string]string) (map[string]map[string]string, error)

func (*Driver) MountPoint added in v0.2.1

func (d *Driver) MountPoint(req Request) (string, error)

func (*Driver) MountVolume added in v0.2.1

func (d *Driver) MountVolume(req Request) (string, error)

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) OpenSnapshot

func (d *Driver) OpenSnapshot(id, volumeID string) error

func (*Driver) ReadSnapshot

func (d *Driver) ReadSnapshot(id, volumeID string, offset int64, data []byte) error

func (*Driver) SnapshotOps added in v0.2.1

func (d *Driver) SnapshotOps() (SnapshotOperations, error)

func (*Driver) UmountVolume added in v0.2.1

func (d *Driver) UmountVolume(req Request) error

func (*Driver) VolumeOps added in v0.2.1

func (d *Driver) VolumeOps() (VolumeOperations, error)

type Snapshot

type Snapshot struct {
	Name        string
	CreatedTime string
	DevID       int
	Activated   bool
}

type Volume

type Volume struct {
	Name        string
	DevID       int
	Size        int64
	Base        string
	MountPoint  string
	CreatedTime string
	Snapshots   map[string]Snapshot

	Filesystem string
	// contains filtered or unexported fields
}

func (*Volume) ConfigFile added in v0.2.1

func (v *Volume) ConfigFile() (string, error)

func (*Volume) GenerateDefaultMountPoint added in v0.4.1

func (v *Volume) GenerateDefaultMountPoint() string

func (*Volume) GetDevice added in v0.4.1

func (v *Volume) GetDevice() (string, error)

func (*Volume) GetMountOpts added in v0.4.1

func (v *Volume) GetMountOpts() []string

Jump to

Keyboard shortcuts

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