Hide Forgot
Description of problem: When user write it's own external balancer method, then balancing is never called because of ClassCastException. Version-Release number of selected component (if applicable): is11 How reproducible: always Steps to Reproduce: 0. install ovirt-scheduler-proxy 1. Add balancer from addition info to /usr/share/ovirt-scheduler-proxy/plugins 2. rhevm-config -s ExternalSchedulerEnabled=true 3. service ovirt-scheduler-proxy start && service ovirt-engine restart 4. Create cluster policy and assing it external balancer. 5. Have at least 2 hosts in cluster, create and run vm. Actual results: Balance function doesn't take effect Expected results: Balance function is called properly. Additional info: Used ovirt-scheduler-proxy rpm build from current upstream. After timeout to call balancing method is invoked, then this ERROR appears in engine.log 2013-08-28 14:46:53,896 ERROR [org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl] (DefaultQuartzScheduler_Worker-26) Failed to invoke scheduled method PerformLoadBalancing: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25] at org.ovirt.engine.core.utils.timer.JobWrapper.execute(JobWrapper.java:60) [scheduler.jar:] at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz.jar:] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz.jar:] Caused by: java.lang.ClassCastException: java.util.LinkedList cannot be cast to java.util.ArrayList at org.ovirt.engine.core.bll.scheduling.SchedulingManager.PerformLoadBalancing(SchedulingManager.java:609) [bll.jar:] ... 7 more ovirt-scheduler-proxy.log Wed, 28 Aug 2013 14:46:48 DEBUG run_load_balancing::Waiting for balance to finish Wed, 28 Aug 2013 14:46:48 DEBUG running ['python', '-c', "import my_balancing2;my_balancing2.balanceFunction(['1fdb21fc-388e-4549-bf48-d0a5399fb1a6', 'ecc463cc-9179-4cd2-8f72-8fbfa737a26d'], {})"] in /usr/share/ovirt-scheduler-proxy/plugins Wed, 28 Aug 2013 14:46:53 DEBUG run_load_balancing::returning results balancer code: #!/bin/env python from ovirtsdk.xml import params from ovirtsdk import api import ovirtsdk.infrastructure.brokers import sys import logging import random API = api.API(url='https://localhost/api', insecure=True, debug=False, username='admin@internal', password='') class SampleBalance(): def balance(self, hosts, args): for vm in API.vms.list(): if vm.get_host() is not None: break return str(vm.get_id()), [str(hosts[(int)(random.random() * len(hosts))])] def balanceFunction(hosts, args): ''' balFunc ''' try: balanceInstance = SampleBalance() print balanceInstance.balance(hosts, args) except Exception as ex: print >> sys.stderr, ex regex_balance = "
tested on is16
Closing - RHEV 3.3 Released