Feature #3255
ceph-disk: allow prepare without activate (for spares)
0%
Associated revisions
ceph-disk: add '[un]suppress-activate <dev>' command
It is often useful to prepare but not activate a device, for example when
preparing a bunch of spare disks. This marks a device as 'do not
activate' so that it can be prepared without activating.
Fixes: #3255
Signed-off-by: Sage Weil <sage@inktank.com>
ceph-disk: add '[un]suppress-activate <dev>' command
It is often useful to prepare but not activate a device, for example when
preparing a bunch of spare disks. This marks a device as 'do not
activate' so that it can be prepared without activating.
Fixes: #3255
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 225fefe5e7c997b365f481b6c4f66312ea28ed61)
History
#1 Updated by Anonymous over 11 years ago
This is enough to trigger hotplug:
sudo sgdisk --typecode=1:4fbd7e29-9d25-41b8-afd0-062c0ceff05d /dev/vdb
That's unfortunate. Now there's no way to prepare a disk, without having it activated (if the node has bootstrap-osd keyring; if it doesn't, it'll still mount&fail&unmount for no gain, that complicates e.g. ejecting the disk for placement on shelf of spares).
#2 Updated by Anonymous over 11 years ago
For a while I thought that a ceph.conf entry like osd_activate_on_hotplug=false would help, but that conflicts with the idea of having the same ceph.conf across the whole cluster. Perhaps a "touch /etc/ceph/no-auto-activate" or an /etc/ceph/host.yaml with "osd_hotplug_auto_activate: False" is better, to still keep ceph.conf identical.
Either way, if a flag is sufficient workaround, it's easy to make src/upstart/ceph-hotplug.conf have
pre-start script set -e if [ -e /etc/ceph/no-auto-activate ]; then stop exit 0 fi end script
#3 Updated by Faidon Liambotis over 11 years ago
Couldn't ceph-disk-prepare take a lock by e.g. writing a file (or even flock()ing it) in /var/lib/ceph/ before it starts preparing it and releasing it when it's done? ceph-disk-activate could notice that lock early and exit, effectively ignoring the hotplug event. The admin or configuration management system could then manually trigger udevadm after that successfully (btw, a wrapper over udevadm would be nice).
That behavior could be made configurable via ceph.conf, I see no reason to have that configurable per box.
#4 Updated by Sage Weil almost 11 years ago
- Subject changed from ceph-disk-activate: find out why it triggers automatically after ceph-disk-prepare, prevent? to ceph-disk: allow prepare without activate (for spares)
- Status changed from New to 12
- Priority changed from Normal to High
#5 Updated by Faidon Liambotis almost 11 years ago
I was reading the new ceph-deploy documentation today. On the 'prepare' action it says:
"The prepare command only prepares the OSD. It does not activate it. To activate a prepared OSD, use the activate command. See Activate OSDs for details."
which because of this bug I'm guessing it's a lie :)
#6 Updated by Sage Weil almost 11 years ago
- Status changed from 12 to Resolved