package
1.3.1
Repository: https://github.com/sayaoailun/containerd.git
Documentation: pkg.go.dev

# README

Devmapper snapshotter

Devmapper is a containerd snapshotter plugin that stores snapshots in ext4-formatted filesystem images in a devicemapper thin pool.

Setup

To make it work you need to prepare thin-pool in advance and update containerd's configuration file. This file is typically located at /etc/containerd/config.toml.

Here's minimal sample entry that can be made in the configuration file:

[plugins]
  ...
  [plugins.devmapper]
    pool_name = "containerd-pool"
    base_image_size = "128MB"
  ...

The following configuration flags are supported:

  • root_path - a directory where the metadata will be available (if empty default location for containerd plugins will be used)
  • pool_name - a name to use for the devicemapper thin pool. Pool name should be the same as in /dev/mapper/ directory
  • base_image_size - defines how much space to allocate when creating the base device

Pool name and base image size are required snapshotter parameters.

Run

Give it a try with the following commands:

ctr images pull --snapshotter devmapper docker.io/library/hello-world:latest
ctr run --snapshotter devmapper docker.io/library/hello-world:latest test

Requirements

The devicemapper snapshotter requires dmsetup (>= 1.02.110) command line tool to be installed and available on your computer. On Ubuntu, it can be installed with apt-get install dmsetup command.

# Packages

No description provided by the author
No description provided by the author

# Functions

LoadConfig reads devmapper configuration file from disk in TOML format.
NewPoolDevice creates new thin-pool from existing data and metadata volumes.
NewPoolMetadata creates new or open existing pool metadata database.
NewSnapshotter creates new device mapper snapshotter.

# Constants

Activated means that device successfully activated.
Activating means that device is going to be activated.
Created means that devices successfully created.
Creating means that device is going to be created.
Deactivated means that device successfully deactivated.
Deactivating means that device is going to be deactivated.
Faulty means that the device is errored and the snapshotter failed to rollback it.
Removed means that device successfully removed but not yet deleted from meta store.
Removing means that device is going to be removed.
Resumed means that device successfully resumed.
Resuming means that device is going to be resumed from suspended state.
Suspended means that device successfully suspended.
Suspending means that device is going to be suspended.
Unknown means that device just allocated and no operations were performed.

# Variables

ErrAlreadyExists represents an error returned when object can't be duplicated in meta store.
ErrNotFound represents an error returned when object not found in meta store.

# Structs

Config represents device mapper configuration loaded from file.
DeviceInfo represents metadata for thin device within thin-pool.
PoolDevice ties together data and metadata volumes, represents thin-pool and manages volumes, snapshots and device ids.
PoolMetadata keeps device info for the given thin-pool device, it also responsible for generating next available device ids and tracking devmapper transaction numbers.
Snapshotter implements containerd's snapshotter (https://godoc.org/github.com/containerd/containerd/snapshots#Snapshotter) based on Linux device-mapper targets.

# Type aliases

No description provided by the author
DeviceState represents current devmapper device state reflected in meta store.