Project

General

Profile

Actions

Feature #3255

closed

ceph-disk: allow prepare without activate (for spares)

Added by Anonymous over 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:
Actions #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).

Actions #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
Actions #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.

Actions #4

Updated by Sage Weil about 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
Actions #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 :)

Actions #6

Updated by Sage Weil almost 11 years ago

  • Status changed from 12 to Resolved
Actions

Also available in: Atom PDF