8f05952ddf
Partition preservation feature allows to preserve data on Ceph OSD device, but later on Puppet will run 'ceph-deploy prepare' on every Ceph device in a system. This call destroys data set on those devices. To preserve data on Ceph OSD devices through deployment process, we need to check if the device has Ceph data and if so, skip execution of 'ceph-deploy prepare' on that device. Only prepared devices must be activated to avoid deployment failure. Following steps are made in the strict sequence to ensure protection of the existing data: * execute 'udevadm trigger' to force create links for devices in /dev/disk * execute 'ceph-disk activate-all' to force activation of all devices identified as ceph osds * in ceph::osds::osd class for every ceph osd device check if it is prepared or active, if not, run 'ceph-deploy prepare' on it * for every osd device, check if it is prepared (not active) and activate it Change-Id: I667fa6aab9d6f46c73bfb8ca0e267afede6049fb Implements: blueprint upgrade-redeploy-node
35 lines
665 B
Puppet
35 lines
665 B
Puppet
# == Class: ceph::osd
|
|
#
|
|
# Prepare and bring online the OSD devices
|
|
#
|
|
# ==== Parameters
|
|
#
|
|
# [*devices*]
|
|
# (optional) Array. This is the list of OSD devices identified by the facter.
|
|
#
|
|
class ceph::osds (
|
|
$devices = $::ceph::osd_devices,
|
|
){
|
|
|
|
exec { 'udevadm trigger':
|
|
command => 'udevadm trigger',
|
|
returns => 0,
|
|
logoutput => true,
|
|
} ->
|
|
|
|
exec {'ceph-disk activate-all':
|
|
command => 'ceph-disk activate-all',
|
|
returns => 0,
|
|
logoutput => true,
|
|
} ->
|
|
|
|
firewall { '011 ceph-osd allow':
|
|
chain => 'INPUT',
|
|
dport => '6800-7100',
|
|
proto => 'tcp',
|
|
action => accept,
|
|
} ->
|
|
|
|
ceph::osds::osd{ $devices: }
|
|
}
|