summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-02 18:44:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-02 18:44:56 +0000
commit80a356951efdc3fdf0aed0b43780711969312743 (patch)
tree7f37c29de70671f4f615142e24ffe433319f5a56 /bin
parentAdding upstream version 20180915. (diff)
downloadopen-infrastructure-storage-tools-80a356951efdc3fdf0aed0b43780711969312743.tar.xz
open-infrastructure-storage-tools-80a356951efdc3fdf0aed0b43780711969312743.zip
Adding upstream version 20190301.upstream/20190301
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xbin/ceph-dns5
-rwxr-xr-xbin/ceph-info8
-rwxr-xr-xbin/ceph-log8
-rwxr-xr-xbin/ceph-remove-osd69
-rwxr-xr-xbin/cephfs-snap14
5 files changed, 17 insertions, 87 deletions
diff --git a/bin/ceph-dns b/bin/ceph-dns
index 59c5150..9adafa2 100755
--- a/bin/ceph-dns
+++ b/bin/ceph-dns
@@ -1,7 +1,6 @@
#!/bin/sh
-# storage-tools - Additional utilities to manage storage related tasks
-# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -138,7 +137,7 @@ shift 1
Parameters "${@}"
NUMBER="${NUMBER:-3}"
-RELEASE="${RELEASE:-luminous}"
+RELEASE="${RELEASE:-mimic}"
case "${ZONE}" in
"")
diff --git a/bin/ceph-info b/bin/ceph-info
index 845e306..8fa4c8f 100755
--- a/bin/ceph-info
+++ b/bin/ceph-info
@@ -1,7 +1,6 @@
#!/bin/sh
-# storage-tools - Additional utilities to manage storage related tasks
-# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -20,12 +19,13 @@
set -e
+PROJECT="open-infrastructure"
SOFTWARE="storage-tools"
PROGRAM="ceph-info"
-if [ -e "/etc/default/${SOFTWARE}" ]
+if [ -e "/etc/${PROJECT}/ceph-tools.conf" ]
then
- . "/etc/default/${SOFTWARE}"
+ . "/etc/${PROJECT}/ceph-tools.conf"
fi
case "${CEPH_INFO}" in
diff --git a/bin/ceph-log b/bin/ceph-log
index 1470101..68cfc16 100755
--- a/bin/ceph-log
+++ b/bin/ceph-log
@@ -1,7 +1,6 @@
#!/bin/sh
-# storage-tools - Additional utilities to manage storage related tasks
-# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -20,12 +19,13 @@
set -e
+PROJECT="open-infrastructure"
SOFTWARE="storage-tools"
PROGRAM="ceph-log"
-if [ -e "/etc/default/${SOFTWARE}" ]
+if [ -e "/etc/${PROJECT}/ceph-tools.conf" ]
then
- . "/etc/default/${SOFTWARE}"
+ . "/etc/${PROJECT}/ceph-tools.conf"
fi
case "${CEPH_LOG}" in
diff --git a/bin/ceph-remove-osd b/bin/ceph-remove-osd
deleted file mode 100755
index 1b16a47..0000000
--- a/bin/ceph-remove-osd
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-# storage-tools - Additional utilities to manage storage related tasks
-# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
-#
-# SPDX-License-Identifier: GPL-3.0+
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-set -e
-
-PROGRAM="$(basename ${0})"
-
-OSDS="${@}"
-
-Usage ()
-{
- echo "Usage: ${PROGRAM} OSD1 OSD2.. OSDn"
- exit 1
-}
-
-if [ -z "${OSDS}" ]
-then
- Usage
-fi
-
-if [ ! -x /usr/bin/jq ]
-then
- echo "'${PROGRAM}': /usr/bin/jp - no such file." >&2
- exit 1
-fi
-
-# Run
-for OSD in ${OSDS}
-do
- HOST="$(ceph osd find ${OSD} | jq -r '.["crush_location"]["host"]')"
-
- # remove the failed OSD
- ceph osd out ${OSD}
-
- # stop the osd.${OSD} daemon on the respective storage host
- ssh ceph-deploy@${HOST} sudo service ceph-osd@${OSD} stop
-
- # unmount the disk
- ssh ceph-deploy@${HOST} sudo umount /var/lib/ceph/osd/ceph-${OSD}
-
- # remove osd from crush map
- ceph osd crush remove osd.${OSD}
-
- # remove cephx key
- ceph auth del osd.${OSD}
-
- # mark osd as down
- ceph osd down osd.${OSD}
-
- # remove the osd
- ceph osd rm osd.${OSD}
-done
diff --git a/bin/cephfs-snap b/bin/cephfs-snap
index d6bb96d..5d20726 100755
--- a/bin/cephfs-snap
+++ b/bin/cephfs-snap
@@ -1,7 +1,6 @@
#!/bin/sh
-# storage-tools - Additional utilities to manage storage related tasks
-# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -20,6 +19,7 @@
set -e
+PROJECT="open-infrastructure"
SOFTWARE="storage-tools"
PROGRAM="cephfs-snap"
@@ -31,9 +31,9 @@ Usage ()
exit 1
}
-if [ -e "/etc/default/${SOFTWARE}" ]
+if [ -e "/etc/${PROJECT}/ceph-tools.conf" ]
then
- . "/etc/default/${SOFTWARE}"
+ . "/etc/${PROJECT}/ceph-tools.conf"
fi
case "${CEPHFS_SNAP}" in
@@ -47,7 +47,7 @@ esac
if [ -z "${CEPHFS_SNAP_DIRECTORIES}" ]
then
- echo "E: no cephfs directories defined in /etc/default/${SOFTWARE}" >&2
+ echo "E: no cephfs directories defined in /etc/${PROJECT}/ceph-tools.conf" >&2
exit 1
fi
@@ -57,7 +57,7 @@ case "${ACTION}" in
if [ -z "${ROTATION}" ]
then
- echo "E: no cephfs snapshot rotation for ${ACTION} defined in /etc/default/${SOFTWARE}" >&2
+ echo "E: no cephfs snapshot rotation for ${ACTION} defined in /etc/${PROJECT}/ceph-tools.conf" >&2
exit 1
fi
;;
@@ -106,7 +106,7 @@ mkdir -p "/var/log/${SOFTWARE}/${PROGRAM}"
echo "${DATE} ${HOST} ${PROGRAM} creating ${ACTION} snapshots" >> "/var/log/${SOFTWARE}/${PROGRAM}/${PROGRAM}.log"
# irc
-if [ -e /usr/bin/irk ] && [ -e "/etc/default/${SOFTWARE}" ]
+if [ -e /usr/bin/irk ] && [ -e "/etc/${PROJECT}/ceph-tools.conf" ]
then
if [ -n "${IRK_TARGETS}" ]
then