[Pacemaker] Making Virtual Domain utilization dynamic

Michael Schwartzkopff ms at sys4.de
Fri Apr 26 20:14:59 UTC 2013


Hi,

I picked up my old idea to make resouce utilizations dymanic and wrote the 
little patch for VirtualDomain to check CPU utilization every time the 
VirtualDomain is monitored:

--- /usr/lib/ocf/resource.d/heartbeat/VirtualDomain     2013-01-06 
23:50:54.000000000 +0100                                                          
+++ /usr/lib/ocf/resource.d/misch/VirtualDomain 2013-04-26 22:09:18.377784406 
+0200                                                                  
@@ -404,6 +404,12 @@
            fi
        done
     fi
+
+    if [ -x /usr/bin/virt-top ]; then
+      CPU_TICKS=$(/usr/bin/virt-top -n 2 -d 5 --stream | grep $DOMAIN_NAME | 
tail -1 | awk '{printf "%.0f",$7}')
+      /usr/sbin/crm_resource -r $OCF_RESOURCE_INSTANCE -z -p ticks -v 
$CPU_TICKS
+    fi
+    
     return ${rc}
 }

I choose the measure CPU ticks since it is more granular than plain CPU usage.

With this patch pacemaker updates the utilization of the resource every time 
it monitors the resource. Together with the placement-strategy="minimal" and 
live-migration you could do very cool things.

Especially if you think about an extended fencing system that is able to 
switch off unused nodes and turn on node as needed.

Comments are welcome.

-- 
Mit freundlichen Grüßen,

Michael Schwartzkopff

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Joerg Heidrich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20130426/81a7bc3e/attachment-0003.html>


More information about the Pacemaker mailing list