read volume group name from lvs
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Oct 2019 13:08:03 +0000 (15:08 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Oct 2019 13:08:03 +0000 (15:08 +0200)
Instead of ganeti config so we can use multiple volume groups
(in our case separate disk and ssd ones)

gnt-lv-snap-rsync.sh

index f00b08f..4fbc415 100755 (executable)
@@ -19,11 +19,9 @@ instance=`gnt-instance list --no-headers -o name $instance | head -1`
 node=`gnt-instance list -o pnode --no-headers $instance`
 echo "# $instance on $node"
 
-vg=`gnt-cluster info | grep 'lvm volume group:' | cut -d: -f2 | tr -d ' '`
-
 found_lvm=0
 
-ssh $node lvs -o name,tags | grep $instance | tee /dev/shm/$instace.$node.lvs | grep disk${disk}_data | while read lv origin ; do
+ssh $node lvs -o name,tags,vg_name | grep $instance | tee /dev/shm/$instace.$node.lvs | grep disk${disk}_data | while read lv origin vg ; do
        found_lvm=1
 
        disk_nr=`echo $lv | cut -d. -f2 | tr -d a-z_`