Add support for BTRFS

This commit is contained in:
James Page 2012-12-18 10:25:38 +00:00
parent d8704bdc92
commit 75077816be
3 changed files with 15 additions and 6 deletions

View File

@ -54,6 +54,7 @@ options:
.
xfs (Default >= 0.55)
ext4 (Only option < 0.55)
btrfs (experimental and not recommended)
.
Only supported with ceph >= 0.55.
osd-reformat:

View File

@ -85,6 +85,12 @@ def add_bootstrap_hint(peer):
# Ignore any errors for this call
subprocess.call(cmd)
DISK_FORMATS = [
'xfs',
'ext4',
'btrfs'
]
def is_osd_disk(dev):
try:

View File

@ -29,7 +29,7 @@ def install_upstart_scripts():
def install():
utils.juju_log('INFO', 'Begin install hook.')
utils.configure_source()
utils.install('ceph', 'gdisk', 'ntp')
utils.install('ceph', 'gdisk', 'ntp', 'btrfs-tools')
install_upstart_scripts()
utils.juju_log('INFO', 'End install hook.')
@ -53,16 +53,18 @@ def config_changed():
utils.juju_log('INFO', 'Monitor hosts are ' + repr(get_mon_hosts()))
fsid = utils.config_get('fsid')
if fsid == '':
# Pre-flight checks
if not utils.config_get('fsid'):
utils.juju_log('CRITICAL', 'No fsid supplied, cannot proceed.')
sys.exit(1)
monitor_secret = utils.config_get('monitor-secret')
if not monitor_secret:
if not utils.config_get('monitor-secret'):
utils.juju_log('CRITICAL',
'No monitor-secret supplied, cannot proceed.')
sys.exit(1)
if utils.config_get('osd-format') not in ceph.DISK_FORMATS:
utils.juju_log('CRITICAL',
'Invalid OSD disk format configuration specified')
sys.exit(1)
emit_cephconf()