On 08/06/2013, at 6:49 PM, Michael Schwartzkopff <mi...@clusterbau.com> wrote:
> Am Donnerstag, 6. Juni 2013, 14:08:26 schrieb Andrew Beekhof: > > On 06/06/2013, at 4:44 AM, Michael Schwartzkopff <mi...@clusterbau.com> > > wrote: > > > Hi, > > > > > > I was not satisfied with the situation that the utilization of resources > > > is static. This is not how real world resources behave. Especially > > > virtual guests in a clustered environment show daily load patterns. So I > > > thought it would be a good idea to make the utilization of resources > > > dynamic. I worte a small patch for the VirtualDomain resource agent that > > > updates the CPU utilization every time it monitors the resource. > > > > > > Please read about the background in the following article: > > > > > > http://www.sys4.de/de/blog/54/ > > > > > > > > > Any comments? > > > Where can I send the patch to? > > > > What patch :) > > I see a code fragment but no context. > > Patch: > > --- VirtualDomain.orig 2013-06-08 10:24:54.403863313 +0200 > +++ VirtualDomain.new 2013-06-08 10:43:16.184253755 +0200 > @@ -187,6 +187,15 @@ > dom_mem=$(LANG=C virsh $VIRSH_OPTIONS dominfo ${DOMAIN_NAME} | awk > '/Max memory/{printf("%d", $3/1024)}') > test -n "$dom_mem" && set_util_attr hv_memory "$dom_mem" > fi > + > + if [ -x /usr/bin/virt-top ]; then > + CPUS=$(/usr/bin/virsh nodeinfo | awk '/CPU\(s/ {print $2}') > + CPU_TICKS=$(/usr/bin/virt-top -n 2 -d 5 --stream | grep $DOMAIN_NAME | > tail -1 | awk '{printf "%.0f",$7}') > + OLD_TICKS=$(crm_resource -r $OCF_RESOURCE_INSTANCE -z -g ticks) > + NEW_TICKS=$(((OLD_TICKS + CPU_TICKS * CPUS) / 2)) > + /usr/sbin/crm_resource -r $OCF_RESOURCE_INSTANCE -z -p ticks -v > ${NEW_TICKS} > + fi > + > } > > # Set options to be passed to virsh: > > > Also, what does the resource/constraint config look like? > > primitive resMyDomain ocf:heartbeat:VirtualDomain params config="..." > > no constraints. Ok, let me rephrase... is there any part of the config that makes use of the values the RA defines? _______________________________________________ Pacemaker mailing list: Pacemaker@oss.clusterlabs.org http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://bugs.clusterlabs.org