Giter Site home page Giter Site logo

Need to update findZoneId() in CacheableCloudstackConnector to deal with multiplte zones about bosh-cloudstack-cpi-release HOT 4 CLOSED

cloudfoundry-community avatar cloudfoundry-community commented on June 22, 2024
Need to update findZoneId() in CacheableCloudstackConnector to deal with multiplte zones

from bosh-cloudstack-cpi-release.

Comments (4)

f-guichard avatar f-guichard commented on June 22, 2024

Seems evident but just in case :

12:18:52.099 [hystrix-CPIImpl-1] DEBUG wire - << "{"listzonesresponse":{"count":2,"zone":[{"id":"976547d9-fcb6-4e94-9521-f051897064ea","name":"SPH-IAAS", [....]  ,"enable.dynamic.scale.vm":"true"}},{"id":"8f994078-cb27-4362-9626-f536d8fb1ea8","name":"SPH-2", [....] "enable.dynamic.scale.vm":"true"}}]}}"
12:18:52.154 [http-nio-8080-exec-2] ERROR CPIAdapterImpl - Caught Exception {}, converted to CPI response.
java.lang.IllegalArgumentException: Zone not found SPH-2
        at org.springframework.util.Assert.isTrue(Assert.java:68)
        at com.orange.oss.cloudfoundry.cspi.cloudstack.CacheableCloudstackConnector.findZoneId(CacheableCloudstackConnector.java:103)
        at com.orange.oss.cloudfoundry.cspi.cloudstack.CacheableCloudstackConnector$$FastClassBySpringCGLIB$$a9a66b7c.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)
        at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:345)
        at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:408)
        at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:327)
        at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)
        at com.orange.oss.cloudfoundry.cspi.cloudstack.CacheableCloudstackConnector$$EnhancerBySpringCGLIB$$c951ab11.findZoneId(<generated>)
        at com.orange.oss.cloudfoundry.cscpi.logic.CPIImpl.create_stemcell(CPIImpl.java:496)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.netflix.hystrix.contrib.javanica.command.MethodExecutionAction.execute(MethodExecutionAction.java:116)
        at com.netflix.hystrix.contrib.javanica.command.MethodExecutionAction.executeWithArgs(MethodExecutionAction.java:93)
        at com.netflix.hystrix.contrib.javanica.command.MethodExecutionAction.execute(MethodExecutionAction.java:78)
        at com.netflix.hystrix.contrib.javanica.command.GenericCommand$1.execute(GenericCommand.java:47)
        at com.netflix.hystrix.contrib.javanica.command.AbstractHystrixCommand.process(AbstractHystrixCommand.java:145)
        at com.netflix.hystrix.contrib.javanica.command.GenericCommand.run(GenericCommand.java:44)
        at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:301)
        at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:297)
        at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
        at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
        at rx.Observable.unsafeSubscribe(Observable.java:10211)
        at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
        at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
        at rx.Observable.unsafeSubscribe(Observable.java:10211)
        at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
        at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
        at rx.Observable.unsafeSubscribe(Observable.java:10211)
        at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
        at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:56)
        at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:47)
        at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction.call(HystrixContexSchedulerAction.java:69)
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

from bosh-cloudstack-cpi-release.

f-guichard avatar f-guichard commented on June 22, 2024

With very little change (tested right now on CS 4.8.0.1)

zones.forEach( zone -> {
			if(zone.getName().equals(this.cloudstackConfig.default_zone)) {
				return zone.getId();
			}
			});
		
                       Assert.isTrue(zone.getName().equals(this.cloudstackConfig.default_zone),
				"Zone not found " + this.cloudstackConfig.default_zone);

Callback payload correctly handled :

01:57:59.072 [main] DEBUG jclouds.wire - << "{"listzonesresponse":{"count":2,"zone":[{"id":"af26e363-dbe9-40e6-9768-7628957ee0a9","name":"Test","networktype":"Advanced","securitygroupsenabled":false,"allocationstate":"Enabled","zonetoken":"e5b87077-3e68-31de-ab80-36897c0bfc00","dhcpprovider":"VirtualRouter","localstorageenabled":true,"tags":[],"resourcedetails":{"system.vm.use.local.storage":"true"}},{"id":"ad1373ba-f97c-443f-ab77-b90b1dfd6ee1","name":"TEST-API","networktype":"Advanced","securitygroupsenabled":false,"allocationstate":"Enabled","zonetoken":"b334a518-cc92-3834-a6ea-155318fc459e","dhcpprovider":"VirtualRouter","localstorageenabled":false,"tags":[]}]}}"

from bosh-cloudstack-cpi-release.

poblin-orange avatar poblin-orange commented on June 22, 2024

@f-guichard yes, it is a bug. As a workaround, you can adjust the cloudstack bosh account to reduce its visibility to single zone.

from bosh-cloudstack-cpi-release.

poblin-orange avatar poblin-orange commented on June 22, 2024

fixed by cpi v19

from bosh-cloudstack-cpi-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.