2012-10-04 21:40:03 +00:00
|
|
|
.TH "RBD" "8" "October 03, 2012" "dev" "Ceph"
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH NAME
|
|
|
|
rbd \- manage rados block device (RBD) images
|
2011-09-09 23:25:14 +00:00
|
|
|
.
|
|
|
|
.nr rst2man-indent-level 0
|
|
|
|
.
|
|
|
|
.de1 rstReportMargin
|
|
|
|
\\$1 \\n[an-margin]
|
|
|
|
level \\n[rst2man-indent-level]
|
|
|
|
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
|
-
|
|
|
|
\\n[rst2man-indent0]
|
|
|
|
\\n[rst2man-indent1]
|
|
|
|
\\n[rst2man-indent2]
|
|
|
|
..
|
|
|
|
.de1 INDENT
|
|
|
|
.\" .rstReportMargin pre:
|
|
|
|
. RS \\$1
|
|
|
|
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
|
|
|
|
. nr rst2man-indent-level +1
|
|
|
|
.\" .rstReportMargin post:
|
|
|
|
..
|
|
|
|
.de UNINDENT
|
|
|
|
. RE
|
|
|
|
.\" indent \\n[an-margin]
|
|
|
|
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
|
.nr rst2man-indent-level -1
|
|
|
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
|
|
|
..
|
2012-07-10 20:09:14 +00:00
|
|
|
.\" Man page generated from reStructuredText.
|
2011-09-09 23:25:14 +00:00
|
|
|
.
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH SYNOPSIS
|
2011-09-09 23:25:14 +00:00
|
|
|
.nf
|
|
|
|
\fBrbd\fP [ \-c \fIceph.conf\fP ] [ \-m \fImonaddr\fP ] [ \-p | \-\-pool \fIpool\fP ] [
|
|
|
|
\-\-size \fIsize\fP ] [ \-\-order \fIbits\fP ] [ \fIcommand\fP ... ]
|
|
|
|
.fi
|
|
|
|
.sp
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH DESCRIPTION
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
\fBrbd\fP is a utility for manipulating rados block device (RBD) images,
|
|
|
|
used by the Linux rbd driver and the rbd storage driver for Qemu/KVM.
|
|
|
|
RBD images are simple block devices that are striped over objects and
|
|
|
|
stored in a RADOS object store. The size of the objects the image is
|
|
|
|
striped over must be a power of two.
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH OPTIONS
|
2011-09-09 23:25:14 +00:00
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
|
|
|
.B \-c ceph.conf, \-\-conf ceph.conf
|
|
|
|
Use ceph.conf configuration file instead of the default /etc/ceph/ceph.conf to
|
|
|
|
determine monitor addresses during startup.
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
|
|
|
.B \-m monaddress[:port]
|
|
|
|
Connect to specified monitor (instead of looking through ceph.conf).
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
|
|
|
.B \-p pool, \-\-pool pool
|
|
|
|
Interact with the given pool. Required by most commands.
|
|
|
|
.UNINDENT
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH PARAMETERS
|
2011-09-09 23:25:14 +00:00
|
|
|
.INDENT 0.0
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2012-08-30 00:30:17 +00:00
|
|
|
.B \-\-format format
|
|
|
|
Specifies which object layout to use. The default is 1.
|
|
|
|
.INDENT 7.0
|
|
|
|
.IP \(bu 2
|
|
|
|
format 1 \- Use the original format for a new rbd image. This format is
|
|
|
|
understood by all versions of librbd and the kernel rbd module, but
|
|
|
|
does not support newer features like cloning.
|
|
|
|
.IP \(bu 2
|
|
|
|
format 2 \- Use the second rbd format, which is supported by
|
|
|
|
librbd (but not the kernel rbd module) at this time. This adds
|
|
|
|
support for cloning and is more easily extensible to allow more
|
|
|
|
features in the future.
|
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \-\-size size\-in\-mb
|
2010-07-15 21:07:52 +00:00
|
|
|
Specifies the size (in megabytes) of the new rbd image.
|
2011-09-09 23:25:14 +00:00
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \-\-order bits
|
|
|
|
Specifies the object size expressed as a number of bits, such that
|
|
|
|
the object size is \fB1 << order\fP. The default is 22 (4 MB).
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \-\-snap snap
|
2010-07-15 21:07:52 +00:00
|
|
|
Specifies the snapshot name for the specific operation.
|
2011-09-09 23:25:14 +00:00
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
2011-04-22 22:25:33 +00:00
|
|
|
.TP
|
2012-08-30 00:30:17 +00:00
|
|
|
.B \-\-id username
|
|
|
|
Specifies the username (without the \fBclient.\fP prefix) to use with the map command.
|
2011-09-09 23:25:14 +00:00
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
2011-04-22 22:25:33 +00:00
|
|
|
.TP
|
2012-08-30 00:30:17 +00:00
|
|
|
.B \-\-keyfile filename
|
2011-04-22 22:25:33 +00:00
|
|
|
Specifies a file containing the secret to use with the map command.
|
2012-08-30 00:30:17 +00:00
|
|
|
If not specified, \fBclient.admin\fP will be used by default.
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
|
|
|
.B \-\-keyring filename
|
|
|
|
Specifies a keyring file containing a secret for the specified user
|
|
|
|
to use with the map command. If not specified, the default keyring
|
|
|
|
locations will be searched.
|
2011-09-09 23:25:14 +00:00
|
|
|
.UNINDENT
|
2012-09-08 01:16:25 +00:00
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
|
|
|
.B \-\-shared tag
|
|
|
|
Option for \fIlock add\fP that allows multiple clients to lock the
|
|
|
|
same image if they use the same tag. The tag is an arbitrary
|
|
|
|
string. This is useful for situations where an image must
|
|
|
|
be open from more than one client at once, like during
|
|
|
|
live migration of a virtual machine, or for use underneath
|
|
|
|
a clustered filesystem.
|
|
|
|
.UNINDENT
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH COMMANDS
|
2011-09-09 23:25:14 +00:00
|
|
|
.INDENT 0.0
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2012-10-04 21:40:03 +00:00
|
|
|
.B \fBls\fP [\-l | \-\-long] [pool\-name]
|
|
|
|
Will list all rbd images listed in the rbd_directory object. With
|
|
|
|
\-l, also show snapshots, and use longer\-format output including
|
|
|
|
size, parent (if clone), format, etc.
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBinfo\fP [\fIimage\-name\fP]
|
2010-07-15 21:07:52 +00:00
|
|
|
Will dump information (such as size and order) about a specific rbd image.
|
2012-08-21 01:00:46 +00:00
|
|
|
If image is a clone, information about its parent is also displayed.
|
2012-08-30 00:30:17 +00:00
|
|
|
If a snapshot is specified, whether it is protected is shown as well.
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBcreate\fP [\fIimage\-name\fP]
|
|
|
|
Will create a new rbd image. You must also specify the size via \-\-size.
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2012-07-10 20:09:14 +00:00
|
|
|
.B \fBclone\fP [\fIparent\-snapname\fP] [\fIimage\-name\fP]
|
|
|
|
Will create a clone (copy\-on\-write child) of the parent snapshot.
|
2012-08-30 00:30:17 +00:00
|
|
|
Object order will be identical to that of the parent image unless
|
|
|
|
specified. Size will be the same as the parent snapshot.
|
|
|
|
.sp
|
2012-08-21 01:00:46 +00:00
|
|
|
The parent snapshot must be protected (see \fIrbd snap protect\fP).
|
2012-08-30 00:30:17 +00:00
|
|
|
This requires format 2.
|
2012-08-21 01:00:46 +00:00
|
|
|
.TP
|
|
|
|
.B \fBflatten\fP [\fIimage\-name\fP]
|
|
|
|
If image is a clone, copy all shared blocks from the parent snapshot and
|
|
|
|
make the child independent of the parent, severing the link between
|
|
|
|
parent snap and child. The parent snapshot can be unprotected and
|
|
|
|
deleted if it has no further dependent clones.
|
2012-08-30 00:30:17 +00:00
|
|
|
.sp
|
|
|
|
This requires format 2.
|
|
|
|
.TP
|
|
|
|
.B \fBchildren\fP [\fIimage\-name\fP]
|
|
|
|
List the clones of the image at the given snapshot. This checks
|
|
|
|
every pool, and outputs the resulting poolname/imagename.
|
|
|
|
.sp
|
|
|
|
This requires format 2.
|
2012-07-10 20:09:14 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBresize\fP [\fIimage\-name\fP]
|
|
|
|
Resizes rbd image. The size parameter also needs to be specified.
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBrm\fP [\fIimage\-name\fP]
|
2012-01-05 01:07:07 +00:00
|
|
|
Deletes an rbd image (including all data blocks). If the image has
|
|
|
|
snapshots, this fails and nothing is deleted.
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBexport\fP [\fIimage\-name\fP] [\fIdest\-path\fP]
|
2010-07-15 21:07:52 +00:00
|
|
|
Exports image to dest path.
|
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBimport\fP [\fIpath\fP] [\fIdest\-image\fP]
|
2010-07-15 21:07:52 +00:00
|
|
|
Creates a new image and imports its data from path.
|
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBcp\fP [\fIsrc\-image\fP] [\fIdest\-image\fP]
|
|
|
|
Copies the content of a src\-image into the newly created dest\-image.
|
2012-08-30 00:30:17 +00:00
|
|
|
dest\-image will have the same size, order, and format as src\-image.
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBmv\fP [\fIsrc\-image\fP] [\fIdest\-image\fP]
|
2012-05-02 18:46:32 +00:00
|
|
|
Renames an image. Note: rename across pools is not supported.
|
2010-07-15 21:07:52 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBsnap\fP ls [\fIimage\-name\fP]
|
2010-07-15 21:07:52 +00:00
|
|
|
Dumps the list of snapshots inside a specific image.
|
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBsnap\fP create [\fIimage\-name\fP]
|
2010-07-15 21:07:52 +00:00
|
|
|
Creates a new snapshot. Requires the snapshot name parameter specified.
|
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBsnap\fP rollback [\fIimage\-name\fP]
|
|
|
|
Rollback image content to snapshot. This will iterate through the entire blocks
|
|
|
|
array and update the data head content to the snapshotted version.
|
2010-07-19 17:20:01 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBsnap\fP rm [\fIimage\-name\fP]
|
2010-07-19 17:20:01 +00:00
|
|
|
Removes the specified snapshot.
|
2011-04-22 22:25:33 +00:00
|
|
|
.TP
|
2012-01-05 01:07:07 +00:00
|
|
|
.B \fBsnap\fP purge [\fIimage\-name\fP]
|
|
|
|
Removes all snapshots from an image.
|
|
|
|
.TP
|
2012-08-21 01:00:46 +00:00
|
|
|
.B \fBsnap\fP protect [\fIimage\-name\fP]
|
|
|
|
Protect a snapshot from deletion, so that clones can be made of it
|
|
|
|
(see \fIrbd clone\fP). Snapshots must be protected before clones are made;
|
|
|
|
protection implies that there exist dependent cloned children that
|
2012-08-30 00:30:17 +00:00
|
|
|
refer to this snapshot. \fIrbd clone\fP will fail on a nonprotected
|
|
|
|
snapshot.
|
|
|
|
.sp
|
|
|
|
This requires format 2.
|
2012-08-21 01:00:46 +00:00
|
|
|
.TP
|
|
|
|
.B \fBsnap\fP unprotect [\fIimage\-name\fP]
|
|
|
|
Unprotect a snapshot from deletion (undo \fIsnap protect\fP). If cloned
|
|
|
|
children remain, \fIsnap unprotect\fP fails. (Note that clones may exist
|
|
|
|
in different pools than the parent snapshot.)
|
2012-08-30 00:30:17 +00:00
|
|
|
.sp
|
|
|
|
This requires format 2.
|
2012-08-21 01:00:46 +00:00
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBmap\fP [\fIimage\-name\fP]
|
2011-04-22 22:25:33 +00:00
|
|
|
Maps the specified image to a block device via the rbd kernel module.
|
|
|
|
.TP
|
2011-09-09 23:25:14 +00:00
|
|
|
.B \fBunmap\fP [\fIdevice\-path\fP]
|
2011-04-22 22:25:33 +00:00
|
|
|
Unmaps the block device that was mapped via the rbd kernel module.
|
2011-11-07 09:24:35 +00:00
|
|
|
.TP
|
|
|
|
.B \fBshowmapped\fP
|
|
|
|
Show the rbd images that are mapped via the rbd kernel module.
|
2012-09-08 01:16:25 +00:00
|
|
|
.TP
|
|
|
|
.B \fBlock\fP list [\fIimage\-name\fP]
|
|
|
|
Show locks held on the image. The first column is the locker
|
|
|
|
to use with the \fIlock remove\fP command.
|
|
|
|
.TP
|
|
|
|
.B \fBlock\fP add [\fIimage\-name\fP] [\fIlock\-id\fP]
|
|
|
|
Lock an image. The lock\-id is an arbitrary name for the user\(aqs
|
|
|
|
convenience. By default, this is an exclusive lock, meaning it
|
|
|
|
will fail if the image is already locked. The \-\-shared option
|
|
|
|
changes this behavior. Note that locking does not affect
|
|
|
|
any operation other than adding a lock. It does not
|
|
|
|
protect an image from being deleted.
|
|
|
|
.TP
|
|
|
|
.B \fBlock\fP remove [\fIimage\-name\fP] [\fIlock\-id\fP] [\fIlocker\fP]
|
|
|
|
Release a lock on an image. The lock id and locker are
|
|
|
|
as output by lock ls.
|
2011-09-09 23:25:14 +00:00
|
|
|
.UNINDENT
|
2010-07-15 21:34:11 +00:00
|
|
|
.SH IMAGE NAME
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
In addition to using the \-\-pool and the \-\-snap options, the image name can include both
|
|
|
|
the pool name and the snapshot name. The image name format is as follows:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
[pool/]image\-name[@snap]
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
|
|
|
Thus an image name that contains a slash character (\(aq/\(aq) requires specifying the pool
|
|
|
|
name explicitly.
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH EXAMPLES
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
2010-07-15 21:07:52 +00:00
|
|
|
To create a new rbd image that is 100 GB:
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd \-p mypool create myimage \-\-size 102400
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
|
|
|
or alternatively:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd create mypool/myimage \-\-size 102400
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
|
|
|
To use a non\-default object size (8 MB):
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd create mypool/myimage \-\-size 102400 \-\-order 23
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
2010-07-15 21:07:52 +00:00
|
|
|
To delete an rbd image (be careful!):
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
2010-07-15 21:07:52 +00:00
|
|
|
rbd rm mypool/myimage
|
2011-09-09 23:25:14 +00:00
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
2010-07-15 21:34:11 +00:00
|
|
|
To create a new snapshot:
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
2012-02-17 22:11:18 +00:00
|
|
|
rbd snap create mypool/myimage@mysnap
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
2012-08-30 00:30:17 +00:00
|
|
|
To create a copy\-on\-write clone of a protected snapshot:
|
2012-07-10 20:09:14 +00:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
2012-08-30 00:30:17 +00:00
|
|
|
rbd clone mypool/myimage@mysnap otherpool/cloneimage
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
|
|
|
To see which clones of a snapshot exist:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd children mypool/myimage@mysnap
|
2012-07-10 20:09:14 +00:00
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
2012-02-17 22:11:18 +00:00
|
|
|
To delete a snapshot:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd snap rm mypool/myimage@mysnap
|
2011-09-09 23:25:14 +00:00
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
2011-04-22 22:25:33 +00:00
|
|
|
To map an image via the kernel with cephx enabled:
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
2012-08-30 00:30:17 +00:00
|
|
|
rbd map mypool/myimage \-\-id admin \-\-keyfile secretfile
|
2011-09-09 23:25:14 +00:00
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
2011-04-22 22:25:33 +00:00
|
|
|
To unmap an image:
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
2011-04-22 22:25:33 +00:00
|
|
|
rbd unmap /dev/rbd0
|
2011-09-09 23:25:14 +00:00
|
|
|
.ft P
|
|
|
|
.fi
|
2012-08-30 00:30:17 +00:00
|
|
|
.sp
|
|
|
|
To create an image and a clone from it:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd import \-\-format 2 image mypool/parent
|
|
|
|
rbd snap create \-\-snap snapname mypool/parent
|
|
|
|
rbd snap protect mypool/parent@snap
|
|
|
|
rbd clone mypool/parent@snap otherpool/child
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
|
|
|
To change an image from one format to another, export it and then
|
|
|
|
import it as the desired format:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd export mypool/myimage@snap /tmp/img
|
|
|
|
rbd import \-\-format 2 /tmp/img mypool/myimage2
|
|
|
|
.ft P
|
|
|
|
.fi
|
2012-09-08 01:16:25 +00:00
|
|
|
.sp
|
|
|
|
To lock an image for exclusive use:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd lock add mypool/myimage mylockid
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.sp
|
|
|
|
To release a lock:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
rbd lock remove mypool/myimage mylockid client.2485
|
|
|
|
.ft P
|
|
|
|
.fi
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH AVAILABILITY
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
\fBrbd\fP is part of the Ceph distributed file system. Please refer to
|
2012-07-10 20:09:14 +00:00
|
|
|
the Ceph documentation at \fI\%http://ceph.com/docs\fP for more information.
|
2010-07-15 21:07:52 +00:00
|
|
|
.SH SEE ALSO
|
2011-09-09 23:25:14 +00:00
|
|
|
.sp
|
|
|
|
\fBceph\fP(8),
|
|
|
|
\fBrados\fP(8)
|
|
|
|
.SH COPYRIGHT
|
2012-07-10 20:09:14 +00:00
|
|
|
2012, Inktank Storage, Inc.
|
2011-09-09 23:25:14 +00:00
|
|
|
.\" Generated by docutils manpage writer.
|
|
|
|
.
|