On Jun 20, 2014, at 5:59 AM, Rohit Yadav <bhais...@apache.org> wrote:
> On Thu, Jun 19, 2014 at 5:07 PM, Sebastien Goasguen <run...@gmail.com> > wrote: > >> Hi, >> >> I am using the simulator and started a basic zone. >> I have an S3 object store locally (riakCS), and I am trying to add it to >> the infra using the 'cloudtouseobjectstore' api with cloudmonkey. >> >> I tried with: >> >>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs >> name=riak provider=riakcs >> details[0].key=accesskey&details[0].value=STU6Z-ZMK1TPMDAXL9I1&details[1].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7NiWKsg== >> 530: Failed to add data store: DataCenter id is null, and simulator image >> store has to be associated with a data center >> >> > Assuming there is no bug in the implementation of the API, can you check in > ~/.cloudmonkey/log the actual URL that is sent to the management server. > The args should be same in the log unless cloudmonkey is messing up the > request URL. > > Next, you can debug in ApiServer (put a jdb watch on the line number I > shared or simply put a print/log statement) what args are received by the > mgmt server. > > Regards. > Thanks Rohit, looks like cloudmonkey is doing its job: 2014-06-20 06:00:45,030 - requester.py:41 - [DEBUG] ======== START Request ======== 2014-06-20 06:00:45,032 - requester.py:41 - [DEBUG] Requesting command=updateCloudToUseObjectStore, args={'name': 'riakcs', 'url': 'http://localhost:9081/riak-cs', 'details[0].value': 'STU6Z-ZMK1TPMDAXL9I1', 'details[1].key': 'secretkey', 'details[1].value': '8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7NiWKsg==', 'provider': 's3', 'details[0].key': 'accesskey'} 2014-06-20 06:00:45,044 - requester.py:41 - [DEBUG] Request sent: http://localhost:8080/client/api?apikey=5cQ8RgdaWMRAMdHr1v_NA4mSGYx3VQFVaXtdPOXPPHl1KZDrTZJcujdL4rE4UeSXH3yxJvQv1rYhw4PkL0go2Q&command=updateCloudToUseObjectStore&details[0].key=accesskey&details[0].value=STU6Z-ZMK1TPMDAXL9I1&details[1].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7NiWKsg%3D%3D&expires=2014-06-20T10%3A17%3A25%2B0000&name=riakcs&provider=s3&response=json&signatureversion=3&url=http%3A%2F%2Flocalhost%3A9081%2Friak-cs&signature=sUQ21a0UT0B%2FxAqRamXEcgEV2gk%3D 2014-06-20 06:00:45,135 - requester.py:41 - [DEBUG] Response received: None 2014-06-20 06:00:45,135 - requester.py:41 - [DEBUG] Error: 530: Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center 2014-06-20 06:00:45,136 - requester.py:41 - [DEBUG] ======== END Request ======== but I get an error. ERROR [c.c.a.ApiServer] (1617473407@qtp-965156366-10:ctx-5cccc502 ctx-bbfdfe1a ctx-e48fccc6) unhandled exception executing api command: updateCloudToUseObjectStore com.cloud.utils.exception.CloudRuntimeException: Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center at com.cloud.storage.StorageManagerImpl.discoverImageStore(StorageManagerImpl.java:1723) at com.cloud.storage.StorageManagerImpl.migrateToObjectStore(StorageManagerImpl.java:1779) at org.apache.cloudstack.api.command.admin.storage.UpdateCloudToUseObjectStoreCmd.execute(UpdateCloudToUseObjectStoreCmd.java:127) at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:161) at com.cloud.api.ApiServer.queueCommand(ApiServer.java:531) at com.cloud.api.ApiServer.handleRequest(ApiServer.java:374) at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:323) at com.cloud.api.ApiServlet.access$000(ApiServlet.java:53) at com.cloud.api.ApiServlet$1.run(ApiServlet.java:115) at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56) at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103) at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53) at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:112) at com.cloud.api.ApiServlet.doGet(ApiServlet.java:74) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) Caused by: com.cloud.exception.InvalidParameterValueException: DataCenter id is null, and simulator image store has to be associated with a data center at org.apache.cloudstack.storage.datastore.lifecycle.SimulatorImageStoreLifeCycleImpl.initialize(SimulatorImageStoreLifeCycleImpl.java:89) at com.cloud.storage.StorageManagerImpl.discoverImageStore(StorageManagerImpl.java:1720) ... 32 more Might be because this is not supported with the simulator. > > >> I am not sure if the arguments are right, has anyone done this before ? >> >> thanks, >> >> -sebastien