rbd

package
v0.0.0-...-01e0b8e Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: Apache-2.0 Imports: 20 Imported by: 2

README

Docker external ceph rbd graph driver

Why external rbd graph driver

Long times ago, @dachary proposed implement Ceph storage driver, but still not achieved now. The main reason is that it is not possible to statically compile docker with the ceph graph driver enabled because some static libraries are missing (Ubuntu 14.04) at the moment.

For support rbd storage driver, must use dynamic compile:

./hack/make.sh dynbinary

This is not accepted by docker community.

Now docker community plan to implement out-of-process graph driver #13777. It is a good tradeoff between docker and rbd.

How to use

install ceph cluster

TODO:

run rbd graph driver

# docker-graph-driver -s rbd
...

run docker daemon

pull images

# docker pull centos:latest
Pulling repository centos
7322fbe74aa5: Download complete 
f1b10cd84249: Download complete 
c852f6d61e65: Download complete 
Status: Downloaded newer image for centos:latest

list rbd image

# rbd list
docker_image_7322fbe74aa5632b33a400959867c8ac4290e9c5112877a7754be70cfe5d66e9
docker_image_base_image
docker_image_c852f6d61e65cddf1e8af1f6cd7db78543bfb83cdcd36845541cf6d9dfef20a0
docker_image_f1b10cd842498c23d206ee0cbeaa9de8d2ae09ff3c7af2723a9e337a6965d639

run container

# docker run -it --rm centos:latest /bin/bash
[root@290238155b54 /]#
# rbd list
docker_image_290238155b547852916b732e38bc4494375e1ed2837272e2940dfccc62691f6c
docker_image_290238155b547852916b732e38bc4494375e1ed2837272e2940dfccc62691f6c-init
docker_image_7322fbe74aa5632b33a400959867c8ac4290e9c5112877a7754be70cfe5d66e9
docker_image_base_image
docker_image_c852f6d61e65cddf1e8af1f6cd7db78543bfb83cdcd36845541cf6d9dfef20a0
docker_image_f1b10cd842498c23d206ee0cbeaa9de8d2ae09ff3c7af2723a9e337a6965d639

Documentation

Index

Constants

View Source
const (
	DefaultRadosConfigFile     = "/etc/ceph/ceph.conf"
	DefaultDockerBaseImageSize = 10 * 1024 * 1024 * 1024
	DefaultMetaObjectDataSize  = 256
)

Variables

This section is empty.

Functions

func Init

func Init(home string, options []string) (graphdriver.Driver, error)

func Mounted

func Mounted(mountpoint string) (bool, error)

func ProbeFsType

func ProbeFsType(device string) (string, error)

Types

type DevInfo

type DevInfo struct {
	Hash        string `json:"hash"`
	Device      string `json:"-"`
	Size        uint64 `json:"size"`
	BaseHash    string `json:"base_hash"` //for delete snapshot
	Initialized bool   `json:"initialized"`
	// contains filtered or unexported fields
}

type MetaData

type MetaData struct {
	Devices map[string]*DevInfo `json:"Devices"`
	// contains filtered or unexported fields
}

type RbdDriver

type RbdDriver struct {
	*RbdSet
	// contains filtered or unexported fields
}

func (*RbdDriver) Cleanup

func (d *RbdDriver) Cleanup() error

func (*RbdDriver) Create

func (d *RbdDriver) Create(id, parent string) error

func (*RbdDriver) Exists

func (d *RbdDriver) Exists(id string) bool

func (*RbdDriver) Get

func (d *RbdDriver) Get(id, mountLabel string) (string, error)

func (*RbdDriver) GetMetadata

func (d *RbdDriver) GetMetadata(id string) (map[string]string, error)

func (*RbdDriver) Put

func (d *RbdDriver) Put(id string) error

func (*RbdDriver) Remove

func (d *RbdDriver) Remove(id string) error

func (*RbdDriver) Status

func (d *RbdDriver) Status() [][2]string

func (*RbdDriver) String

func (d *RbdDriver) String() string

type RbdMappingInfo

type RbdMappingInfo struct {
	Pool     string `json:"pool"`
	Name     string `json:"name"`
	Snapshot string `json:"snap"`
	Device   string `json:"device"`
}

type RbdSet

type RbdSet struct {
	MetaData
	// contains filtered or unexported fields
}

func NewRbdSet

func NewRbdSet(root string, doInit bool, options []string) (*RbdSet, error)

func (*RbdSet) AddDevice

func (devices *RbdSet) AddDevice(hash, baseHash string) error

func (*RbdSet) DeleteDevice

func (devices *RbdSet) DeleteDevice(hash string) error

func (*RbdSet) HasDevice

func (devices *RbdSet) HasDevice(hash string) bool

func (*RbdSet) MountDevice

func (devices *RbdSet) MountDevice(hash, mountPoint, mountLabel string) error

func (*RbdSet) Shutdown

func (devices *RbdSet) Shutdown() error

func (*RbdSet) UnmountDevice

func (devices *RbdSet) UnmountDevice(hash string) error

Jump to

Keyboard shortcuts

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