summaryrefslogtreecommitdiffstats
path: root/roles/ands_backup/templates/backup.sh.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ands_backup/templates/backup.sh.j2')
-rwxr-xr-xroles/ands_backup/templates/backup.sh.j211
1 files changed, 9 insertions, 2 deletions
diff --git a/roles/ands_backup/templates/backup.sh.j2 b/roles/ands_backup/templates/backup.sh.j2
index c362957..b9884ea 100755
--- a/roles/ands_backup/templates/backup.sh.j2
+++ b/roles/ands_backup/templates/backup.sh.j2
@@ -37,13 +37,20 @@ etcdctl3 --endpoints="192.168.213.1:2379" snapshot save "$backup_path/etcd/snaps
mkdir -p "$backup_path/heketi" || { echo "Can't create ${backup_path}/heketi" ; exit 1 ; }
heketi-cli -s http://heketi-storage.glusterfs.svc.cluster.local:8080 --user admin --secret "$(oc get secret heketi-storage-admin-secret -n glusterfs -o jsonpath='{.data.key}' | base64 -d)" topology info > "$backup_path/heketi/heketi_topology.json"
heketi-cli -s http://heketi-storage.glusterfs.svc.cluster.local:8080 --user admin --secret "$(oc get secret heketi-storage-admin-secret -n glusterfs -o jsonpath='{.data.key}' | base64 -d)" db dump > "$backup_path/heketi/heketi_db.json"
-lvs > "$backup_path/heketi/lvs.txt" 2>/dev/null
-lvm fullreport --reportformat json > "$backup_path/heketi/lvm.json" 2>/dev/null
gluster --xml volume info > "$backup_path/heketi/gluster-info.xml"
gluster --xml volume status > "$backup_path/heketi/gluster-status.xml"
gluster volume status > "$backup_path/heketi/gluster.txt"
{% endif %}
+mkdir -p "$backup_path/lvm" || { echo "Can't create ${backup_path}/lvm" ; exit 1 ; }
+lvs > "$backup_path/lvm/lvs.txt" 2>/dev/null
+lvm fullreport --reportformat json > "$backup_path/lvm/lvm.json" 2>/dev/null
+dmsetup ls --tree > "$backup_path/lvm/dmesetup.txt" 2>/dev/null
+vglist=$(vgdisplay | grep -oP "VG Name\s+\K.*")
+for vg in $vglist; do
+ vgcfgbackup -f "$backup_path/lvm/vg-$vg.backup" "$vg" &>/dev/null
+done
+
{% if 'ands_storage_servers' in group_names %}
# Gluster