
This is a multi-part message in MIME format. --------------070609010005080400040505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Dn(a 18.03.2014 13:24, Federico Alberto Sayd wrote / napísal(a):
On 24/02/14 13:59, Itamar Heim wrote:
with oVirt 3.4 getting close to GA with many many great features, time to collect requests for 3.5...
Add progress bar to task tab to indicate the progress percent of snapshot creation, vm clonation, migration, etc.
I needed this a long time ago, so i hacked this together. You shoud run it on the SPM host. Also, i only use iscsi storage. #!/bin/bash SECS=1 PROC=${1:-"qemu-img"} PID=`pidof $PROC` if [ "x$PID" == "x" ] then echo "No $PROC running" exit 1 fi LV=$(ls -l /dev/mapper/ | grep `ls -l /proc/$PID/fd/|grep dm- | cut -f 3 -d/ | head -n1` | gawk '{print $9}' | sed -e 's/--/XX/g' -e 's/-/\//g' -e 's/XX/-/g' -e 's/^/\/dev\//g') SIZE=$(/sbin/lvs --noheadings --unquoted --options lv_size --units b $LV | sed -e 's/B//g' ) LAST=0 while [[ -e /proc/$PID/fd/ ]] ; do CUR=$(grep rchar /proc/$PID/io | cut -f 2 -d " ") PERC=$(echo $CUR*100/$SIZE | bc) SPEED=$(echo \($CUR-$LAST\)/1024/1024 | bc) SIZE2=$(echo $SIZE / 1024 / 1024 / 1024| bc) echo "$SIZE2 GB / $CUR B [$PERC%] - $SPEED MB/s" sleep $SECS; LAST=$CUR done -- Ernest Beinrohr, AXON PRO Ing <http://www.beinrohr.sk/ing.php>, RHCE <http://www.beinrohr.sk/rhce.php>, RHCVA <http://www.beinrohr.sk/rhce.php>, LPIC <http://www.beinrohr.sk/lpic.php>, VCA <http://www.beinrohr.sk/vca.php>, +421-2--6241-0360 <callto://+421-2--6241-0360>, +421-903--482-603 <callto://+421-903--482-603> icq:28153343, gtalk: oernii@axonpro.sk, jabber:oernii@jabber.org ------------------------------------------------------------------------ "For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." Richard Feynman --------------070609010005080400040505 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">Dňa 18.03.2014 13:24, Federico Alberto Sayd wrote / napísal(a):<br> </div> <blockquote cite="mid:53283AF4.1050500@uncu.edu.ar" type="cite">On 24/02/14 13:59, Itamar Heim wrote: <br> <blockquote type="cite">with oVirt 3.4 getting close to GA with many many great features, time to collect requests for 3.5... <br> <br> </blockquote> Add progress bar to task tab to indicate the progress percent of snapshot creation, vm clonation, migration, etc. <br> </blockquote> <br> I needed this a long time ago, so i hacked this together. You shoud run it on the SPM host. Also, i only use iscsi storage.<br> <br> <tt><br> </tt><tt>#!/bin/bash</tt><tt><br> </tt><tt><br> </tt><tt>SECS=1</tt><tt><br> </tt><tt>PROC=${1:-"qemu-img"}</tt><tt><br> </tt><tt>PID=`pidof $PROC`</tt><tt><br> </tt><tt><br> </tt><tt>if [ "x$PID" == "x" ]</tt><tt><br> </tt><tt>then</tt><tt><br> </tt><tt> echo "No $PROC running"</tt><tt><br> </tt><tt> exit 1</tt><tt><br> </tt><tt>fi</tt><tt><br> </tt><tt><br> </tt><tt>LV=$(ls -l /dev/mapper/ | grep `ls -l /proc/$PID/fd/|grep dm- | cut -f 3 -d/ | head -n1` | gawk '{print $9}' | sed -e 's/--/XX/g' -e 's/-/\//g' -e 's/XX/-/g' -e 's/^/\/dev\//g')</tt><tt><br> </tt><tt><br> </tt><tt>SIZE=$(/sbin/lvs --noheadings --unquoted --options lv_size --units b $LV | sed -e 's/B//g' )</tt><tt><br> </tt><tt><br> </tt><tt>LAST=0</tt><tt><br> </tt><tt>while [[ -e /proc/$PID/fd/ ]] ;</tt><tt><br> </tt><tt>do</tt><tt><br> </tt><tt> CUR=$(grep rchar /proc/$PID/io | cut -f 2 -d " ")</tt><tt><br> </tt><tt> PERC=$(echo $CUR*100/$SIZE | bc)</tt><tt><br> </tt><tt> SPEED=$(echo \($CUR-$LAST\)/1024/1024 | bc)</tt><tt><br> </tt><tt> SIZE2=$(echo $SIZE / 1024 / 1024 / 1024| bc)</tt><tt><br> </tt><tt> echo "$SIZE2 GB / $CUR B [$PERC%] - $SPEED MB/s"</tt><tt><br> </tt><tt> sleep $SECS;</tt><tt><br> </tt><tt> LAST=$CUR</tt><tt><br> </tt><tt>done</tt><br> <br> <div class="moz-signature">-- <br> <div id="oernii_footer" style="color: gray;"> <span style="font-family: Lucida Console, Luxi Mono, Courier, monospace; font-size: 90%;"> Ernest Beinrohr, AXON PRO<br> <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/ing.php">Ing</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCE</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCVA</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/lpic.php">LPIC</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/vca.php">VCA</a>, <a style="text-decoration: none; color: gray;" href="callto://+421-2--6241-0360">+421-2--6241-0360</a>, <a style="text-decoration: none; color: gray;" href="callto://+421-903--482-603">+421-903--482-603</a><br> icq:28153343, gtalk: <a class="moz-txt-link-abbreviated" href="mailto:oernii@axonpro.sk">oernii@axonpro.sk</a>, <a class="moz-txt-link-abbreviated" href="mailto:jabber:oernii@jabber.org">jabber:oernii@jabber.org</a> <br> </span> <hr style="height: 1px; width: 95%"> <span style="font-size: 70%;"> “For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.” Richard Feynman </span> </div> </div> <img src="http://nojsstats.appspot.com/UA-44497096-1/email.beinrohr.sk" moz-do-not-send="true" border="0" width="1" height="1"> </body> </html> --------------070609010005080400040505--