ceph/ceph-cookbooks — pull request #60 by sorccu (2013-08-09 07:33:42+00:00)
Title: Support directories as OSD devices

Currently, if you give an OSD `:device` a directory (not a block device), the OSD never gets activated because udev cannot pick it up automatically. Also, the directory must already exist, which means that you'll need another recipe just for creating the directory.

This patch adds a new field to `node["ceph"]["osd_devices"][n]`, called "type". When the field is not present, or does not have the value `"directory"`, there is no change in functionality. However, when the value is "directory", two things happen. First, the directory is created, unless it already exists. Then, the `ceph-disk-prepare` command is augmented to include `ceph-disk-activate`, which activates the prepared directory. For disks this is not necessary, as udev will pick up the prepared disk and activate it automatically.

While using the OS disk is usually not recommended, it is very useful for development virtual machines (Vagrant), and also those unfortunate cases where you don't have full control over your instances (to add disks) but would still like to use Ceph.

One additional thing to look out for is that if the file system is ext3 or ext4, `node["ceph"]["config"]["osd"]["filestore xattr use omap"]` must be set to `true`, or the OSDs will fail to activate. However, I believe that this is outside the scope of this cookbook and should be set by the user.