Commit Graph

13 Commits

Author SHA1 Message Date
Sage Weil
d512dc9edd udev: /dev/disk/by-parttypeuuid/$type-$uuid
We need this to help trigger OSD activations.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-06-17 09:49:53 -07:00
Sage Weil
bcfd2f31a5 udev: drop useless --mount argument to ceph-disk
It doesn't mean anything anymore; drop it.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-06-14 14:04:54 -07:00
Sage Weil
a2a78e8d16 ceph-disk: implement 'activate-journal'
Activate an osd via its journal device.  udev populates its symlinks and
triggers events in an order that is not related to whether the device is
an osd data partition or a journal.  That means that triggering
'ceph-disk activate' can happen before the journal (or journal symlink)
is present and then fail.

Similarly, it may be that they are on different disks that are hotplugged
with the journal second.

This can be wired up to the journal partition type to ensure that osds are
started when the journal appears second.

Include the udev rules to trigger this.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-06-13 18:01:43 -07:00
Sage Weil
d8d7113c35 udev: install disk/by-partuuid rules
Wheezy's udev (175-7.2) has broken rules for the /dev/disk/by-partuuid/
symlinks that ceph-disk relies on.  Install parallel rules that work.  On
new udev, this is harmless; old older udev, this will make life better.

Fixes: #4865
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-16 18:40:29 -07:00
Gary Lowell
446641aa34 95-ceph-osd-alt.rules: Fix missing parent parameter
Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
2013-04-24 08:22:04 -07:00
Gary Lowell
7ad63d23d7 ceph-disk: OSD hotplug fixes for Centos
Two fixes for Centos 6.3 and other systems with udev versions
prior to 172.  The disk peristant name using the GPT UUID does
not exist, so use the by_path persistent name instead for the
journal symlink.

The gpt label fields are not available for use in udev rules. Add
ceph-disk-udev wrapper script that extracts the partition
type guid from the label and calls ceph-disk-activate if it is
a ceph guid type. (Bug #4632)

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
2013-04-22 22:30:39 -07:00
Alexandre Marangone
785b25f53d Fix: use absolute path with udev
Avoids the following: udevd[61613]: failed to execute '/lib/udev/bash'
'bash -c 'while [ ! -e /dev/mapper/....

Signed-off-by: Alexandre Marangone <alexandre.marangone@inktank.com>
2013-04-15 15:57:00 -07:00
Sage Weil
e090a92a20 udev: trigger on dmcrypted osd partitions
Automatically map encrypted journal partitions.

For encrypted OSD partitions, map them, wait for the mapped device to
appear, and then ceph-disk-activate.

This is much simpler than doing the work in ceph-disk-activate.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-15 14:18:34 -08:00
Sage Weil
5bd85ee5aa udev: trigger ceph-disk-activate directly from udev
There is no need to depend on upstart for this.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-13 22:18:59 -08:00
Pascal de Bruijn | Unilogic Networks B.V
96587f39e3 Robustify ceph-rbdnamer and adapt udev rules
Below is a patch which makes the ceph-rbdnamer script more robust and
fixes a problem with the rbd udev rules.

On our setup we encountered a symlink which was linked to the wrong rbd:

  /dev/rbd/mypool/myrbd -> /dev/rbd1

While that link should have gone to /dev/rbd3 (on which a
partition /dev/rbd3p1 was present).

Now the old udev rule passes %n to the ceph-rbdnamer script, the problem
with %n is that %n results in a value of 3 (for rbd3), but in a value of
1 (for rbd3p1), so it seems it can't be depended upon for rbdnaming.

In the patch below the ceph-rbdnamer script is made more robust and it
now it can be called in various ways:

  /usr/bin/ceph-rbdnamer /dev/rbd3
  /usr/bin/ceph-rbdnamer /dev/rbd3p1
  /usr/bin/ceph-rbdnamer rbd3
  /usr/bin/ceph-rbdnamer rbd3p1
  /usr/bin/ceph-rbdnamer 3

Even with all these different styles of calling the modified script, it
should now return the same rbdname. This change "has" to be combined
with calling it from udev with %k though.

With that fixed, we hit the second problem. We ended up with:

  /dev/rbd/mypool/myrbd -> /dev/rbd3p1

So the rbdname was symlinked to the partition on the rbd instead of the
rbd itself. So what probably went wrong is udev discovering the disk and
running ceph-rbdnamer which resolved it to myrbd so the following
symlink was created:

  /dev/rbd/mypool/myrbd -> /dev/rbd3

However partitions would be discovered next and ceph-rbdnamer would be
run with rbd3p1 (%k) as parameter, resulting in the name myrbd too, with
the previous correct symlink being overwritten with a faulty one:

  /dev/rbd/mypool/myrbd -> /dev/rbd3p1

The solution to the problem is in differentiating between disks and
partitions in udev and handling them slightly differently. So with the
patch below partitions now get their own symlinks in the following style
(which is fairly consistent with other udev rules):

  /dev/rbd/mypool/myrbd-part1 -> /dev/rbd3p1

Please let me know any feedback you have on this patch or the approach
used.

Regards,
Pascal de Bruijn
Unilogic B.V.

Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-07-16 17:34:22 -07:00
Josh Durgin
891025e539 udev: drop device number from name
The device number depends on how many rbd images have been
mapped. Removing it makes the name determined solely by the name,
image, and snapshot that are mapped, for ease of scripting or persistence
across reboots.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-12-08 16:36:47 -08:00
Tommi Virtanen
da8fa7837a udev: c* -> ceph-* rename: missed crbdnamer.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-09-23 15:55:01 -07:00
Samuel Just
863ef7c331 debian: add udev rules
Add /lib/udev/rules.d/50-rbd.rules to debian package.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-03-10 16:08:39 -08:00