| Summary: | External scheduler balancing don't work due to ClassCastException. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Ondra Machacek <omachace> |
| Component: | ovirt-engine | Assignee: | Gilad Chaplik <gchaplik> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Lukas Svaty <lsvaty> |
| Severity: | high | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 3.3.0 | CC: | acathrow, dfediuck, iheim, lpeer, pstehlik, Rhev-m-bugs, yeylon |
| Target Milestone: | --- | ||
| Target Release: | 3.3.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | sla | ||
| Fixed In Version: | is14 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-01-21 22:12:26 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | SLA | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 1019461 | ||
tested on is16 Closing - RHEV 3.3 Released |
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 = "