Hi Ronald, If it helps, there are some CloudStack dev learning guide around how to create a plugin and manage dependencies: https://github.com/shapeblue/hackerbook
Looking forward to see your new object storage plugin (if you decide to contribute upstream). Regards. ________________________________ From: Ronald Feicht <ronald.fei...@scsynergy.com> Sent: Thursday, December 14, 2023 17:00 To: dev@cloudstack.apache.org <dev@cloudstack.apache.org> Subject: Re: New Object Storage - Huawei OBS Hi, I had added the module to client/pom.xml, but then http://192.168.17.252:8080/client/ retuns "HTTP ERROR 503 Service Unavailable" because of the following exception: [WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext@1df8ea34{/client,file:///opt/cloudstack-huawei-obs/client/target/classes/META-INF/webapp/,UNAVAILABLE}{file:///opt/cloudstack-huawei-obs/client/target/classes/META-INF/webapp/} java.lang.NullPointerException at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet$1.with (DefaultModuleDefinitionSet.java:104) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule (DefaultModuleDefinitionSet.java:263) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule (DefaultModuleDefinitionSet.java:268) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule (DefaultModuleDefinitionSet.java:268) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule (DefaultModuleDefinitionSet.java:268) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule (DefaultModuleDefinitionSet.java:268) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule (DefaultModuleDefinitionSet.java:268) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule (DefaultModuleDefinitionSet.java:251) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.startContexts (DefaultModuleDefinitionSet.java:96) at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.load (DefaultModuleDefinitionSet.java:79) at org.apache.cloudstack.spring.module.factory.ModuleBasedContextFactory.loadModules (ModuleBasedContextFactory.java:37) at org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.init (CloudStackSpringContext.java:70) at org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.<init> (CloudStackSpringContext.java:57) at org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.<init> (CloudStackSpringContext.java:61) at org.apache.cloudstack.spring.module.web.CloudStackContextLoaderListener.contextInitialized (CloudStackContextLoaderListener.java:52) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized (ContextHandler.java:933) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized (ServletContextHandler.java:553) at org.eclipse.jetty.server.handler.ContextHandler.startContext (ContextHandler.java:892) at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:356) at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1445) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:328) at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1409) at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:825) at org.eclipse.jetty.servlet.ServletContextHandler.doStart (ServletContextHandler.java:275) at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:524) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:397) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:97) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:97) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start (Server.java:407) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart (Server.java:371) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:72) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:450) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:311) at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:152) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) But the directory exists and is not empty: [root@cloudstack-centos cloudstack-huawei-obs]# ll /opt/cloudstack-huawei-obs/client/target/classes/META-INF/webapp/ total 4 drwxr-xr-x. 2 root root 21 Dec 14 12:17 WEB-INF -rw-r--r--. 1 root root 1135 Dec 14 12:17 index.html drwxr-xr-x. 3 root root 39 Dec 14 12:17 . drwxr-xr-x. 4 root root 87 Dec 14 12:17 .. [root@cloudstack-centos cloudstack-huawei-obs]# ll /opt/cloudstack-huawei-obs/client/target/classes/META-INF/webapp/WEB-INF/ total 4 -rw-r--r--. 1 root root 2694 Dec 14 12:17 web.xml drwxr-xr-x. 2 root root 21 Dec 14 12:17 . drwxr-xr-x. 3 root root 39 Dec 14 12:17 .. Because of that error I had removed my plugin from client/pom.xml again and then afterwards http://192.168.17.252:8080/client/ worked. So, I now understand that my plugin must by part of client/pom.xml but then I receive the same exception mentioned above - how do I fix that? Mit freundlichen Grüßen R. Feicht sc synergy GmbH Hilgestrasse 14 | 55294 Bodenheim | Deutschland Fon: +49 6135 71691 - 000 | Fax: +49 6135 71691 - 299 http://www.scsynergy.com | ronald.fei...@scsynergy.com Sitz der Gesellschaft Bodenheim, HRB 8830, Amtsgericht Mainz, Geschäftsführer: Christian Reichert ________________________________ From: Slavka Peleva <slav...@storpool.com.INVALID> Sent: Thursday, December 14, 2023 11:37 To: dev@cloudstack.apache.org Subject: Re: New Object Storage - Huawei OBS Hi Ronald, In the logs, you can find all the modules that are loaded like: ``` 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: baremetal-storage 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: server-alert-adapter-storage 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: server-storage 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: server-template-adapter 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-allocator 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-image-default 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-image-s3 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-image-swift 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-object-minio 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-object-simulator 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-cloudbyte 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-datera 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-default 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-flasharray 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-linstor 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-primera 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-scaleio 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-solidfire 2023-12-14 12:28:21,480 INFO [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Module Hierarchy: storage-volume-storpool ``` Like Wei mentioned you need to add the module in the client/pom.xml or you can copy the jar of your plugin (just for the tests) in `/usr/share/cloudstack-management/lib/` and restart the service Best regards, Slavka On Thu, Dec 14, 2023 at 11:57 AM Wei ZHOU <ustcweiz...@gmail.com> wrote: > Is the module added to client/pom.xml ? > > -Wei > > On Thu, 14 Dec 2023 at 10:51, Ronald Feicht <ronald.fei...@scsynergy.com> > wrote: > > > Hi, > > > > I am trying to write an Object Storage plugin for Huawei OBS using Minio > > as example. I added my plugin code to the plugins/storage/object/ > > directory, added my plugin into plugins/pom.xml and added the string > > 'Huawei OBS' to AddObjectStorage.vue for the dropdown in the UI. But > when I > > select that dropdown entry and click "Save" in the UI the following > > exception is thrown: > > com.cloud.exception.InvalidParameterValueException: can't find object > > store provider: Huawei OBS > > at > > > com.cloud.storage.StorageManagerImpl.discoverObjectStore(StorageManagerImpl.java:3743) > > at > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > > Method) > > at > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > at > > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > at java.base/java.lang.reflect.Method.invoke(Method.java:566) > > at > > > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) > > at > > > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) > > at > > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) > > at > > > org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:107) > > at > > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) > > at > > > com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:52) > > at > > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) > > at > > > org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) > > at > > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) > > at > > > org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) > > at com.sun.proxy.$Proxy119.discoverObjectStore(Unknown Source) > > at > > > org.apache.cloudstack.api.command.admin.storage.AddObjectStoragePoolCmd.execute(AddObjectStoragePoolCmd.java:117) > > at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:172) > > at com.cloud.api.ApiServer.queueCommand(ApiServer.java:782) > > at com.cloud.api.ApiServer.handleRequest(ApiServer.java:603) > > at > > com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:347) > > at com.cloud.api.ApiServlet$1.run(ApiServlet.java:154) > > at > > > org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55) > > at > > > org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102) > > at > > > org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52) > > at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:151) > > at com.cloud.api.ApiServlet.doGet(ApiServlet.java:105) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) > > at > > > org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1386) > > at > > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617) > > at > > > org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226) > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) > > at > > > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) > > at > > > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590) > > at > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) > > at > > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) > > at > > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485) > > at > > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215) > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) > > at > > > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221) > > at > > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146) > > at > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > > at org.eclipse.jetty.server.Server.handle(Server.java:500) > > at > > > org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383) > > at > > org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547) > > at > > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375) > > at > > > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273) > > at org.eclipse.jetty.io > > .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) > > at org.eclipse.jetty.io > > .FillInterest.fillable(FillInterest.java:103) > > at org.eclipse.jetty.io > > .ChannelEndPoint$2.run(ChannelEndPoint.java:117) > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) > > at > > > org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375) > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) > > at java.base/java.lang.Thread.run(Thread.java:829) > > > > > > What do I need to do to register my plugin with StorageManagerImpl.java? > > > > The fork I made with my code can be seen here > > https://github.com/scsynergy/cloudstack-huawei-obs . > > > > > > Mit freundlichen Grüßen > > R. Feicht > > > > sc synergy GmbH > > Hilgestrasse 14 | 55294 Bodenheim | Deutschland > > Fon: +49 6135 71691 - 000 | Fax: +49 6135 71691 - 299 > > http://www.scsynergy.com | ronald.fei...@scsynergy.com > > Sitz der Gesellschaft Bodenheim, HRB 8830, Amtsgericht Mainz, > > Geschäftsführer: Christian Reichert > > >