Commit Graph

44192 Commits

Author SHA1 Message Date
Loic Dachary
3404bb90dd Merge pull request #5467 from dachary/wip-ceph-release-notes
tools: ceph-release-notes unicode handling

Reviewed-by: Abhishek Lekshmanan <abhishek.lekshmanan@ril.com>
2015-08-29 10:47:26 +02:00
Loic Dachary
49bd8a8bff mailmap: Jevon Qiao affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:51 +02:00
Loic Dachary
6f562c6777 mailmap: Jiaying Ren affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:51 +02:00
Loic Dachary
8bd1ac039d mailmap: Jean-Rémi Deveaux affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:51 +02:00
Loic Dachary
2f92ebac01 mailmap: Gaël Fenet-Garde affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:51 +02:00
Loic Dachary
45af3da004 mailmap: Arthur Gorjux affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:51 +02:00
Loic Dachary
276644343b mailmap: Abhishek Dixit affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:51 +02:00
Loic Dachary
3368f0100f mailmap: Vikhyat Umrao affiliation
Reviewed-by: Vikhyat Umrao <vumrao@redhat.com>
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
a7004d7372 mailmap: Ira Cooper affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
aab25836d7 mailmap: Krzysztof Kosiński affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
552ad88c29 mailmap: Joe Handzik affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
dbdf48a84d mailmap: Takanori Nakao affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
94bbd139bc mailmap: Shotaro Kawaguchi affiliation
Reviewed-by: Shotaro Kawaguchi <kawaguchi.s@jp.fujitsu.com>
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
33f8693365 mailmap: Zhi Zhang affiliation
Reviewed-by: Zhi Zhang <zhangz.david@outlook.com>
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
827fbced7a mailmap: Yannick Atchy Dalama affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
ffb36bdbc6 mailmap: Wu Xingyi affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
c482025839 mailmap: Valentin Arshanes affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
33a75f1199 mailmap: Thomas Laumondais affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
0f849a861f mailmap: Shawn Chen affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:50 +02:00
Loic Dachary
8e1d9f8b27 mailmap: Sebastien Han affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
d4f8a5bdec mailmap: Robin Tang affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
805dcc9a05 mailmap: Pierre Chaumont affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
6889f35223 mailmap: Nicolas Yong affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
6e2cde7d59 mailmap: Maxime Robert affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
3d4db7e1dd mailmap: Lucas Fantinel affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
8bafdc595f mailmap: Kévin Caradant affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
bb5784d5f4 mailmap: Jordan Dorne affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
7040be2459 mailmap: Guang Yang affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
1395b51b3e mailmap: Germain Chipaux affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
593b1a1e91 mailmap: Gabriel Sentucq affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
f4532317f2 mailmap: Clement Lebrun affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:49 +02:00
Loic Dachary
384cf19d20 mailmap: Claire Massot affiliation
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 10:22:48 +02:00
Loic Dachary
c7c59b2bf2 mailmap: update h3c organization mailbox
Reviewed-by: Loic Dachary <ldachary@redhat.com>
Signed-off-by: Ce Gu <guce@h3c.com>
2015-08-29 10:22:48 +02:00
Loic Dachary
5ce7ed1bdd ceph-disk: integration tests for multipath
Add integration tests for multipath to the ceph-disk workunit, with the
following caveats:

A workaround is added (explicit call to ceph-disk activate) until the
CentOS activation bug http://tracker.ceph.com/issues/12786 is fixed.

The tests do not run on Ubuntu because of the multipath / device mapper
bug
https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/1488688
and it has not been tested on Debian.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
d447098cfc ceph-disk: implement workunit
This new ceph-disk workunit re-implements the tests that previously were
in the src/test/ceph-disk.sh src/test/ceph-disk-root.sh scripts and is
meant to run in a virtual machine instead of docker.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
b04bfd12e2 tests: remove dead scripts
Revert 2d0d388162 which introduced scripts
that were never actually used.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
8c586e63d3 ceph-disk: CentOS 7 is systemd
http://tracker.ceph.com/issues/12786 Fixes: #12786

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
796a1403dc ceph-disk: implement list --format json
The ceph-disk list command is reworked in two parts:

 1) the list_devices function that build an internal structure with all
    the information regarding disks and partitions.
 2) a function to display the internal structure in plain text or json

The ceph-disk list show the plain text version and is backward
compatible.

The ceph-disk list --format json output has more information about each
device than the plain text version and is intended for scripts.

The unit tests cover all modified lines (2610 to 2849).

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
5fd9486c76 ceph-disk: fix dmcrypt typo
Fix the typo introduced by 29431944c7

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
60c22a9353 ceph-disk: cosmetic: setup_logging function
Split the main function to extract the verbose handling part into the
setup_logging function.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
982591a981 ceph-disk: cosmetic: argparse functions
Split the large parse_args function into separate functions, one for
each subparser.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
38d0e7bd55 ceph-disk: use sys.argv instead of implicit
Make parse_args and main use and argument instead of relying on
argparse.ArgumentParser implicit use of sys.argv. It helps with tests.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
9a71816f48 tests: obsolete ceph-disk root tests
They were designed to run in a docker container using loop devices
instead of disks. Although this was fit for ceph-disk activate tests for
regular and dmcrypt devices, a docker instance does not have its own
udev instance it is not possible to run tests involving udev events
without interfering with the host.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
d4869ac9e4 ceph-disk: add multipath support
A multipath device is detected because there is a
/sys/dev/block/M:m/dm/uuid file with the mpath- prefix (or part\w+-mpath
prefix).

When ceph-disk prepares data or journal devices on a multipath device,
it sets the partition typecode to MPATH_JOURNAL_UUID, MPATH_OSD_UUID and
MPATH_TOBE_UUID to

 a) help the udev rules distinguish them from other devices in
    devicemapper
 b) allow ceph-disk to fail if an attempt is made to activate a device
    with this type without accessing it via a multipath device

The 95-ceph-osd.rules call ceph-disk activate on partitions of type
MPATH_JOURNAL_UUID, MPATH_OSD_UUID. It relies on ceph-disk to do nothing
if the device is not accessed via multipath.

http://tracker.ceph.com/issues/11881 Fixes: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:52 +02:00
Loic Dachary
7e5a69bcd2 ceph-disk: is_held must ignore multipath devices
Always return an empty list when is_held is called on a multipath
device.

The dmcrypt logic base decisions depending on the holders/slaves
relationship. Such relationships can also exists for multipath devices
but do not have the same semantic.

http://tracker.ceph.com/issues/11881 Fixes: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:51 +02:00
Loic Dachary
a10141809c ceph-disk: rework get_partition_{type,uuid}
Mimic the get_partition_type implementation after get_partition_uuid
and factorize them to reduce the code footprint.

The get_partition_type implementation is based on blkid: it is complex
and fragile. Since sgdisk is consistently used to create partitions, use
it instead. It is already used for get_partition_uuid and there does not
seem to be any reason for concern.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:51 +02:00
Loic Dachary
77ff7c3dc6 ceph-disk: multipath support for split_dev_base_partnum
split_dev_base_partnum returns the path of the whole disk in
/dev/mapper. The base variable name to designate the device for the
whole disk is a misnomer since it cannot be used as a basename to
rebuild the parition device name in the case of multipath.

The logic of split_dev_base_partnum for devices is reworked to use
/sys/dev/block/M:m/partition instead of device name parsing.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:51 +02:00
Loic Dachary
3bc95dfc1b ceph-disk: multipath support for is_partition and list_partitions
The is_partition predicate and the list_partitions function support
devices managed by multipath.

A set of helpers dedicated to multipath devices is implemented because
the content of the corresponding /sys directory does not use the same
conventions as regular devices regarding partitions.

Instead of relying on subdirectories such as /sys/block/name/name1, the
devicemapper uuid file is used and expected to start with part\d+. The
holders/slaves directories provide pointers between the whole device and
the partition devices.

Although these structural differences reduce the opportunity for
code factorization, it is easier for backward compatibility since the
multipath specific logic is limited to if is_mpath(dev) branches.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:51 +02:00
Loic Dachary
2fca91eb2a ceph-disk: --verbose shows a stack trace on error
When running with --verbose, do not hide the stack trace from the user
when an exception is raised. It is most helpful to figure out when the
exception actually happened.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:51 +02:00
Loic Dachary
aac8971988 ceph-disk: replace partx with partprobe
Older distributions that required partx (CentOS 6 and the like) are no
longer supported and the partx fallback can be obsoleted.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-08-29 02:37:51 +02:00