* lxcを便利に使用できるdockerの0.7がでていますね。
* 0.7からは aufs以外でも使えるようになりました。
* ストレージドライバは aufs, devicemapper, vfsの順にプライオリティがつけられているようです
* graphdriver/driver.go
var (
DefaultDriver string
// All registred drivers
drivers map[string]InitFunc
// Slice of drivers that should be used in an order
priority = []string{
"aufs",
"devicemapper",
"vfs",
}
)
* ストレージドライバは、環境変数 DOCKER_DRIVERを設定することで切り替えることができるようですexport DOCKER_DRIVER=vfs
* devicemapper利用時のサイズは以下のように定義されているようです
*graphdriver/devmapper/deviceset.go
var (↲
»---DefaultDataLoopbackSize int64 = 100 * 1024 * 1024 * 1024↲
»---DefaultMetaDataLoopbackSize int64 = 2 * 1024 * 1024 * 1024↲
»---DefaultBaseFsSize uint64 = 10 * 1024 * 1024 * 1024↲
)↲
* devicemapperで作られるvolumeは以下の感じで作られるようです
// This is the programmatic example of "dmsetup create"↲
func createPool(poolName string, dataFile, metadataFile *osFile) error {↲
»---task, err := createTask(DeviceCreate, poolName)↲
»---if task == nil {↲
»---»---return err↲
»---}↲
↲
»---size, err := GetBlockDeviceSize(dataFile)↲
»---if err != nil {↲
»---»---return fmt.Errorf("Can't get data size")↲
»---}↲
↲
»---params := metadataFile.Name() + " " + dataFile.Name() + " 128 32768"↲
»---if err := task.AddTarget(0, size/512, "thin-pool", params); err != nil {↲
»---»---return fmt.Errorf("Can't add target")↲
»---}↲
↲
»---var cookie uint = 0↲
»---if err := task.SetCookie(&cookie, 0); err != nil {↲
»---»---return fmt.Errorf("Can't set cookie")↲
»---}↲
↲
»---if err := task.Run(); err != nil {↲
»---»---return fmt.Errorf("Error running DeviceCreate (createPool)")↲
»---}↲
↲
»---UdevWait(cookie)↲
↲
»---return nil↲
}↲
* data_block_size 128
* low_water_mark 32768
* thin-provisioning.txtによるとUsing an existing pool device
-----------------------------
dmsetup create pool \
--table "0 20971520 thin-pool $metadata_dev $data_dev \
$data_block_size $low_water_mark"
$data_block_size gives the smallest unit of disk space that can be
allocated at a time expressed in units of 512-byte sectors. People
primarily interested in thin provisioning may want to use a value such
as 1024 (512KB). People doing lots of snapshotting may want a smaller value
such as 128 (64KB). If you are not zeroing newly-allocated data,
a larger $data_block_size in the region of 256000 (128MB) is suggested.
$data_block_size must be the same for the lifetime of the
metadata device.
$low_water_mark is expressed in blocks of size $data_block_size. If
free space on the data device drops below this level then a dm event
will be triggered which a userspace daemon should catch allowing it to
extend the pool device. Only one such event will be sent.
Resuming a device with a new table itself triggers an event so the
userspace daemon can use this to detect a situation where a new table
already exceeds the threshold.
とのことなので、最初に設定したThin-pool 100GBのうち、容量が32768 * (512*512)Byte = 8MBytes を切ると、拡張がされるように思います(動作は未確認)
* このあたりは決め打ちで変更はできないようですね