diff --git a/web/support/images/restore-osd.sh b/web/support/images/restore-osd.sh new file mode 100644 index 0000000000000000000000000000000000000000..7207c3353439c34ddd27eeb08f0b1d3bd11fd77d --- /dev/null +++ b/web/support/images/restore-osd.sh @@ -0,0 +1,20 @@ +ms=./mon-store +rm -rf $ms +mkdir $ms + +hosts=`juju status ceph-osd | grep 'ceph-osd/' | awk '{print $1}' | cut -d'*' -f1` + +# collect the cluster map from stopped OSDs +for host in $hosts; do + echo $host + juju ssh $host sudo rm -rf /tmp/$ms + juju scp -- -r $ms $host:/tmp + juju ssh $host sudo bash <<EOF + for osd in /var/lib/ceph/osd/ceph-*; do + ceph-objectstore-tool --data-path \$osd --no-mon-config --op update-mon-db --mon-store-path /tmp/$ms + done + chmod -R +r /tmp/$ms +EOF + rm -rf $ms + juju scp -- -r $host:/tmp/$ms . +done