use ganeti symlink for running instance disks
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 4 Oct 2018 15:14:46 +0000 (17:14 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 4 Oct 2018 15:14:46 +0000 (17:14 +0200)
This works with all types of storage and nicely showcases wrong
partition sizes on devices with 4k blocksize

gnt-instance-fdisk.sh

index 5caaaed..32f19b0 100755 (executable)
@@ -2,8 +2,15 @@
 
 instance=$1
 
+node=`gnt-instance list --no-headers -o pnode $instance`
+ssh $node fdisk -l /var/run/ganeti/instance-disks/$instance:0
+
+
+exit 0
+
 gnt-instance info --static $instance > /dev/shm/$instance
 node=`grep 'primary:' /dev/shm/$instance | cut -d: -f2 | tr -d ' '`
-lv=`grep 'logical_id:' /dev/shm/$instance | cut -d: -f2 | tr -d ' '`
+lv=`grep 'logical_id:' /dev/shm/$instance | head -1 | cut -d: -f2 | tr -d ' '`
 ssh $node fdisk -l /dev/$lv
 
+