You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Sebastien Goasguen <ru...@gmail.com> on 2014/06/19 13:37:47 UTC
S3 use with simulator
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
I am not sure if the arguments are right, has anyone done this before ?
thanks,
-sebastien
Re: S3 use with simulator
Posted by Prasanna Santhanam <ts...@apache.org>.
There is an s3.cfg under setup/dev that might do the job for you:
commit c79b8270a8eeda0c2f594cc84736f62df79d52c1
Author: Prasanna Santhanam <ts...@apache.org>
Date: Tue Jul 16 22:53:29 2013 +0530
Adding a sample configuration for the s3 enabled store
This sample marvin configuration can be used to add an s3 backed object
store to cloudstack. You will have to replace the ACCESS_KEY/SECRET_KEY
and bucket endpoint (if not using aws) to match your credentials.
On Mon, Jun 23, 2014 at 07:03:28PM +0530, Prasanna Santhanam wrote:
> Be advised that advanced.cfg might be adding the NFS store as
> secondary storage as opposed to cacheStorage that the S3 image store
> needs it to be. At least that's how it was the last time I ran it.
>
--
Prasanna.,
------------------------
Powered by BigRock.com
Re: S3 use with simulator
Posted by sebgoa <ru...@gmail.com>.
On Jun 23, 2014, at 3:45 PM, sebgoa <ru...@gmail.com> wrote:
>
> On Jun 23, 2014, at 3:33 PM, Prasanna Santhanam <ts...@apache.org> wrote:
>
>> Be advised that advanced.cfg might be adding the NFS store as
>> secondary storage as opposed to cacheStorage that the S3 image store
>> needs it to be. At least that's how it was the last time I ran it.
>
> Thanks.
>
> That's exactly what I am trying to figure out. Can we migrate from a NFS secondary storage to an object store.
>
> If I move the NFS to be a cache store then I can add a new ImageStore. But the updatecloudstoobjectstore which is supposed to do everything at once, does not work for me.
>
Ok, problem solved. When using the API, the provider key is case sensitive. so you need to pass S3 and not s3 :(
>>
>> On Mon, Jun 23, 2014 at 02:45:55PM +0200, sebgoa wrote:
>>>
>>> On Jun 23, 2014, at 2:30 PM, Koushik Das <ko...@citrix.com> wrote:
>>>
>>>> This has nothing to do with the zoneId. If you search the source code for the error message "Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center", it points toSimulatorImageStoreLifeCycleImpl.initialize() method. This indicates that somehow the image store provider for Simulator is getting picked up. For S3 provider type, the S3ImageStoreLifeCycleImpl should get invoked and in that the zoneId is not used so there won't be issues.
>>>
>>> Happy to discuss it on IRC, if you could join.
>>>
>>> in SimulatorImageStoreLifeCycleImpl.initialize() on 4.4-forward I see:
>>>
>>> Long dcId = (Long)dsInfos.get("zoneId");
>>> String url = (String)dsInfos.get("url");
>>> String name = (String)dsInfos.get("name");
>>> if (name == null) {
>>> name = url;
>>> }
>>> ...
>>>
>>> if (dcId == null) {
>>> throw new InvalidParameterValueException("DataCenter id is null, and simulator image store has to be associated with a data center");
>>> }
>>>
>>> So my non Java expertise tells me that dcId is null because zoneId is not set ???
>>>
>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>> Sent: Monday, 23 June 2014 5:47 PM
>>>> To: dev@cloudstack.apache.org
>>>> Subject: Re: S3 use with simulator
>>>>
>>>>
>>>> On Jun 23, 2014, at 7:14 AM, Koushik Das <ko...@citrix.com> wrote:
>>>>
>>>>> This is the request
>>>>>
>>>>> http://localhost:8096/api?command=updateCloudToUseObjectStore&url=http
>>>>> ://localhost:1234/test&name=test&provider=S3&details[0].key=accesskey&
>>>>> details[0].value=dummy&details[1].key=secretkey&details[1].value=dummy
>>>>
>>>> Any chance you can try with a signed api request ?
>>>>
>>>> It looks like it's not finding a zoneId ...hence dcId is null....
>>>>
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: sebgoa [mailto:runseb@gmail.com]
>>>>> Sent: Monday, 23 June 2014 4:40 PM
>>>>> To: dev@cloudstack.apache.org
>>>>> Subject: Re: S3 use with simulator
>>>>>
>>>>>
>>>>> On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
>>>>>
>>>>>> inline
>>>>>>
>>>>>> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>>>>>>>
>>>>>>> I still add the same error:
>>>>>>>
>>>>>>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs
>>>>>>>> name=riakcs provider=s3 details[0].key=accesskey
>>>>>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>>>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>>>> image store has to be associated with a data center
>>>>>>>
>>>>>>> However this actually *removed* the NFS store (from the simulated basic zone).
>>>>>>>
>>>>>>
>>>>>> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
>>>>>> <updatecloudtouseobjectstoreresponse
>>>>>> cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4d
>>>>>> a
>>>>>> 8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/t
>>>>>> e
>>>>>> st</url><protocol>http</protocol><providername>S3</providername><scop
>>>>>> e
>>>>>>> REGION</scope><details><name>secretkey</name><value>dummy</value></d
>>>>>>> e
>>>>>> tails><details><name>accesskey</name><value>dummy</value></details></
>>>>>> tails>i
>>>>>> magestore></updatecloudtouseobjectstoreresponse>
>>>>>>
>>>>>
>>>>> Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
>>>>>
>>>>> Can you send the exact request that you sent ?
>>>>>
>>>>>> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
>>>>>>
>>>>>> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS',
>>>>>> 'nfs', 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1',
>>>>>> 'ZONE', 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863',
>>>>>> '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58',
>>>>>> NULL, NULL, NULL '2', 'test', 'S3', 'http',
>>>>>> 'http://localhost:1234/test', NULL, 'REGION', 'Image',
>>>>>> '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55',
>>>>>> NULL, NULL, NULL
>>>>>>
>>>>>
>>>>> Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
>>>>>
>>>>>>
>>>>>>> I was then able to add:
>>>>>>>
>>>>>>>> add imagestore name=riakcs provider=S3
>>>>>>>> url=http://localhost:9081/riak-cs details[0].key=accesskey
>>>>>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>>>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>>>>>> imagestore:
>>>>>>> name = riakcs
>>>>>>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
>>>>>>> details:
>>>>>>> +-----------+------------------------------------------+
>>>>>>> | name | value |
>>>>>>> +-----------+------------------------------------------+
>>>>>>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
>>>>>>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
>>>>>>> +-----------+------------------------------------------+
>>>>>>> protocol = http
>>>>>>> providername = S3
>>>>>>> scope = REGION
>>>>>>> url = http://localhost:9081/riak-cs
>>>>>>>
>>>>>>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>>>>>>>
>>>>>>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>>>>>>>
>>>>>>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>>>>>>>> I tried the same on a 4.4-forward setup and got a different error (as below).
>>>>>>>> "You can only add new image stores from the same provider NFS already added"
>>>>>>>>
>>>>>>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>>>>>>>> This is the change I made
>>>>>>>>
>>>>>>>> diff --git
>>>>>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>>> b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>>> index edf1e28..537c7bd 100644
>>>>>>>> ---
>>>>>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/stora
>>>>>>>> +++ g e/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>>>>>>>> */
>>>>>>>> @Override
>>>>>>>> public boolean migrateToObjectStore(DataStore store) {
>>>>>>>> - return false;
>>>>>>>> + return imageStoreHelper.convertToStagingStore(store);
>>>>>>>> }
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Min Chen [mailto:min.chen@citrix.com]
>>>>>>>> Sent: Saturday, 21 June 2014 3:44 AM
>>>>>>>> To: dev@cloudstack.apache.org
>>>>>>>> Subject: Re: S3 use with simulator
>>>>>>>>
>>>>>>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> -min
>>>>>>>>
>>>>>>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> I already have an Nsf secondary storage. I understood that i could
>>>>>>>>> not add a second secondary storage that is s3 based, and that the
>>>>>>>>> only way was to use the updatecloud.... Api
>>>>>>>>>
>>>>>>>>> -Sebastien
>>>>>>>>>
>>>>>>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Sebastien,
>>>>>>>>>>
>>>>>>>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>>>>>>>> add S3 as a secondary store in your data center? To set up a
>>>>>>>>>> data center using S3, you need to use addImageStore api.
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> -min
>>>>>>>>>>
>>>>>>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>> I switch to provider=S3 but I get:
>>>>>>>>>>>
>>>>>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das
>>>>>>>>>>>> <ko...@citrix.com>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> As per the code the following are the supported image store
>>>>>>>>>>>> provider types
>>>>>>>>>>>>
>>>>>>>>>>>> // constants for provider names static final String NFS_IMAGE =
>>>>>>>>>>>> "NFS"; static final String S3_IMAGE = "S3"; static final String
>>>>>>>>>>>> SWIFT_IMAGE = "Swift"; static final String SAMPLE_IMAGE =
>>>>>>>>>>>> "Sample"; static final String SMB = "NFS"; static final String
>>>>>>>>>>>> DEFAULT_PRIMARY = "DefaultPrimary";
>>>>>>>>>>>>
>>>>>>>>>>>> Try passing S3 in the provider.
>>>>>>>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>>>>>>>
>>>>>>>>>>>> -----Original Message-----
>>>>>>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>>>>>>>> To: dev@cloudstack.apache.org
>>>>>>>>>>>> Subject: S3 use with simulator
>>>>>>>>>>>>
>>>>>>>>>>>> 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
>>>>>>>>>>>>> &
>>>>>>>>>>>>> deta
>>>>>>>>>>>>> ils
>>>>>>>>>>>>> [1
>>>>>>>>>>>>>
>>>>>>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl
>>>>>>>>>>>>> 5
>>>>>>>>>>>>> Z7Ni
>>>>>>>>>>>>> WKs
>>>>>>>>>>>>> g=
>>>>>>>>>>>>> =
>>>>>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>>>>>
>>>>>>>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>>>>>>>> before ?
>>>>>>>>>>>>
>>>>>>>>>>>> thanks,
>>>>>>>>>>>>
>>>>>>>>>>>> -sebastien
>>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>
>> --
>> Prasanna.,
>>
>> ------------------------
>> Powered by BigRock.com
>>
>
Re: S3 use with simulator
Posted by sebgoa <ru...@gmail.com>.
On Jun 23, 2014, at 3:33 PM, Prasanna Santhanam <ts...@apache.org> wrote:
> Be advised that advanced.cfg might be adding the NFS store as
> secondary storage as opposed to cacheStorage that the S3 image store
> needs it to be. At least that's how it was the last time I ran it.
Thanks.
That's exactly what I am trying to figure out. Can we migrate from a NFS secondary storage to an object store.
If I move the NFS to be a cache store then I can add a new ImageStore. But the updatecloudstoobjectstore which is supposed to do everything at once, does not work for me.
>
> On Mon, Jun 23, 2014 at 02:45:55PM +0200, sebgoa wrote:
>>
>> On Jun 23, 2014, at 2:30 PM, Koushik Das <ko...@citrix.com> wrote:
>>
>>> This has nothing to do with the zoneId. If you search the source code for the error message "Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center", it points toSimulatorImageStoreLifeCycleImpl.initialize() method. This indicates that somehow the image store provider for Simulator is getting picked up. For S3 provider type, the S3ImageStoreLifeCycleImpl should get invoked and in that the zoneId is not used so there won't be issues.
>>
>> Happy to discuss it on IRC, if you could join.
>>
>> in SimulatorImageStoreLifeCycleImpl.initialize() on 4.4-forward I see:
>>
>> Long dcId = (Long)dsInfos.get("zoneId");
>> String url = (String)dsInfos.get("url");
>> String name = (String)dsInfos.get("name");
>> if (name == null) {
>> name = url;
>> }
>> ...
>>
>> if (dcId == null) {
>> throw new InvalidParameterValueException("DataCenter id is null, and simulator image store has to be associated with a data center");
>> }
>>
>> So my non Java expertise tells me that dcId is null because zoneId is not set ???
>>
>>
>>>
>>>
>>> -----Original Message-----
>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>> Sent: Monday, 23 June 2014 5:47 PM
>>> To: dev@cloudstack.apache.org
>>> Subject: Re: S3 use with simulator
>>>
>>>
>>> On Jun 23, 2014, at 7:14 AM, Koushik Das <ko...@citrix.com> wrote:
>>>
>>>> This is the request
>>>>
>>>> http://localhost:8096/api?command=updateCloudToUseObjectStore&url=http
>>>> ://localhost:1234/test&name=test&provider=S3&details[0].key=accesskey&
>>>> details[0].value=dummy&details[1].key=secretkey&details[1].value=dummy
>>>
>>> Any chance you can try with a signed api request ?
>>>
>>> It looks like it's not finding a zoneId ...hence dcId is null....
>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: sebgoa [mailto:runseb@gmail.com]
>>>> Sent: Monday, 23 June 2014 4:40 PM
>>>> To: dev@cloudstack.apache.org
>>>> Subject: Re: S3 use with simulator
>>>>
>>>>
>>>> On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
>>>>
>>>>> inline
>>>>>
>>>>> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
>>>>>
>>>>>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>>>>>>
>>>>>> I still add the same error:
>>>>>>
>>>>>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs
>>>>>>> name=riakcs provider=s3 details[0].key=accesskey
>>>>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>>> image store has to be associated with a data center
>>>>>>
>>>>>> However this actually *removed* the NFS store (from the simulated basic zone).
>>>>>>
>>>>>
>>>>> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
>>>>> <updatecloudtouseobjectstoreresponse
>>>>> cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4d
>>>>> a
>>>>> 8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/t
>>>>> e
>>>>> st</url><protocol>http</protocol><providername>S3</providername><scop
>>>>> e
>>>>>> REGION</scope><details><name>secretkey</name><value>dummy</value></d
>>>>>> e
>>>>> tails><details><name>accesskey</name><value>dummy</value></details></
>>>>> tails>i
>>>>> magestore></updatecloudtouseobjectstoreresponse>
>>>>>
>>>>
>>>> Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
>>>>
>>>> Can you send the exact request that you sent ?
>>>>
>>>>> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
>>>>>
>>>>> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS',
>>>>> 'nfs', 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1',
>>>>> 'ZONE', 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863',
>>>>> '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58',
>>>>> NULL, NULL, NULL '2', 'test', 'S3', 'http',
>>>>> 'http://localhost:1234/test', NULL, 'REGION', 'Image',
>>>>> '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55',
>>>>> NULL, NULL, NULL
>>>>>
>>>>
>>>> Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
>>>>
>>>>>
>>>>>> I was then able to add:
>>>>>>
>>>>>>> add imagestore name=riakcs provider=S3
>>>>>>> url=http://localhost:9081/riak-cs details[0].key=accesskey
>>>>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>>>>> imagestore:
>>>>>> name = riakcs
>>>>>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
>>>>>> details:
>>>>>> +-----------+------------------------------------------+
>>>>>> | name | value |
>>>>>> +-----------+------------------------------------------+
>>>>>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
>>>>>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
>>>>>> +-----------+------------------------------------------+
>>>>>> protocol = http
>>>>>> providername = S3
>>>>>> scope = REGION
>>>>>> url = http://localhost:9081/riak-cs
>>>>>>
>>>>>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>>>>>>
>>>>>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>>>>>>
>>>>>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>>>>>>> I tried the same on a 4.4-forward setup and got a different error (as below).
>>>>>>> "You can only add new image stores from the same provider NFS already added"
>>>>>>>
>>>>>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>>>>>>> This is the change I made
>>>>>>>
>>>>>>> diff --git
>>>>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>> b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>> index edf1e28..537c7bd 100644
>>>>>>> ---
>>>>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/stora
>>>>>>> +++ g e/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>>>>>>> */
>>>>>>> @Override
>>>>>>> public boolean migrateToObjectStore(DataStore store) {
>>>>>>> - return false;
>>>>>>> + return imageStoreHelper.convertToStagingStore(store);
>>>>>>> }
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Min Chen [mailto:min.chen@citrix.com]
>>>>>>> Sent: Saturday, 21 June 2014 3:44 AM
>>>>>>> To: dev@cloudstack.apache.org
>>>>>>> Subject: Re: S3 use with simulator
>>>>>>>
>>>>>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>>>>>>
>>>>>>> Thanks
>>>>>>> -min
>>>>>>>
>>>>>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>>
>>>>>>>> I already have an Nsf secondary storage. I understood that i could
>>>>>>>> not add a second secondary storage that is s3 based, and that the
>>>>>>>> only way was to use the updatecloud.... Api
>>>>>>>>
>>>>>>>> -Sebastien
>>>>>>>>
>>>>>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>>>>>>
>>>>>>>>> Hi Sebastien,
>>>>>>>>>
>>>>>>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>>>>>>> add S3 as a secondary store in your data center? To set up a
>>>>>>>>> data center using S3, you need to use addImageStore api.
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> -min
>>>>>>>>>
>>>>>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>> I switch to provider=S3 but I get:
>>>>>>>>>>
>>>>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das
>>>>>>>>>>> <ko...@citrix.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> As per the code the following are the supported image store
>>>>>>>>>>> provider types
>>>>>>>>>>>
>>>>>>>>>>> // constants for provider names static final String NFS_IMAGE =
>>>>>>>>>>> "NFS"; static final String S3_IMAGE = "S3"; static final String
>>>>>>>>>>> SWIFT_IMAGE = "Swift"; static final String SAMPLE_IMAGE =
>>>>>>>>>>> "Sample"; static final String SMB = "NFS"; static final String
>>>>>>>>>>> DEFAULT_PRIMARY = "DefaultPrimary";
>>>>>>>>>>>
>>>>>>>>>>> Try passing S3 in the provider.
>>>>>>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>>>>>>
>>>>>>>>>>> -----Original Message-----
>>>>>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>>>>>>> To: dev@cloudstack.apache.org
>>>>>>>>>>> Subject: S3 use with simulator
>>>>>>>>>>>
>>>>>>>>>>> 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
>>>>>>>>>>>> &
>>>>>>>>>>>> deta
>>>>>>>>>>>> ils
>>>>>>>>>>>> [1
>>>>>>>>>>>>
>>>>>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl
>>>>>>>>>>>> 5
>>>>>>>>>>>> Z7Ni
>>>>>>>>>>>> WKs
>>>>>>>>>>>> g=
>>>>>>>>>>>> =
>>>>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>>>>
>>>>>>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>>>>>>> before ?
>>>>>>>>>>>
>>>>>>>>>>> thanks,
>>>>>>>>>>>
>>>>>>>>>>> -sebastien
>>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>
> --
> Prasanna.,
>
> ------------------------
> Powered by BigRock.com
>
Re: S3 use with simulator
Posted by Prasanna Santhanam <ts...@apache.org>.
Be advised that advanced.cfg might be adding the NFS store as
secondary storage as opposed to cacheStorage that the S3 image store
needs it to be. At least that's how it was the last time I ran it.
On Mon, Jun 23, 2014 at 02:45:55PM +0200, sebgoa wrote:
>
> On Jun 23, 2014, at 2:30 PM, Koushik Das <ko...@citrix.com> wrote:
>
> > This has nothing to do with the zoneId. If you search the source code for the error message "Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center", it points toSimulatorImageStoreLifeCycleImpl.initialize() method. This indicates that somehow the image store provider for Simulator is getting picked up. For S3 provider type, the S3ImageStoreLifeCycleImpl should get invoked and in that the zoneId is not used so there won't be issues.
>
> Happy to discuss it on IRC, if you could join.
>
> in SimulatorImageStoreLifeCycleImpl.initialize() on 4.4-forward I see:
>
> Long dcId = (Long)dsInfos.get("zoneId");
> String url = (String)dsInfos.get("url");
> String name = (String)dsInfos.get("name");
> if (name == null) {
> name = url;
> }
> ...
>
> if (dcId == null) {
> throw new InvalidParameterValueException("DataCenter id is null, and simulator image store has to be associated with a data center");
> }
>
> So my non Java expertise tells me that dcId is null because zoneId is not set ???
>
>
> >
> >
> > -----Original Message-----
> > From: Sebastien Goasguen [mailto:runseb@gmail.com]
> > Sent: Monday, 23 June 2014 5:47 PM
> > To: dev@cloudstack.apache.org
> > Subject: Re: S3 use with simulator
> >
> >
> > On Jun 23, 2014, at 7:14 AM, Koushik Das <ko...@citrix.com> wrote:
> >
> >> This is the request
> >>
> >> http://localhost:8096/api?command=updateCloudToUseObjectStore&url=http
> >> ://localhost:1234/test&name=test&provider=S3&details[0].key=accesskey&
> >> details[0].value=dummy&details[1].key=secretkey&details[1].value=dummy
> >
> > Any chance you can try with a signed api request ?
> >
> > It looks like it's not finding a zoneId ...hence dcId is null....
> >
> >>
> >>
> >> -----Original Message-----
> >> From: sebgoa [mailto:runseb@gmail.com]
> >> Sent: Monday, 23 June 2014 4:40 PM
> >> To: dev@cloudstack.apache.org
> >> Subject: Re: S3 use with simulator
> >>
> >>
> >> On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
> >>
> >>> inline
> >>>
> >>> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
> >>>
> >>>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
> >>>>
> >>>> I still add the same error:
> >>>>
> >>>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs
> >>>>> name=riakcs provider=s3 details[0].key=accesskey
> >>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
> >>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
> >>>> 530: Failed to add data store: DataCenter id is null, and simulator
> >>>> image store has to be associated with a data center
> >>>>
> >>>> However this actually *removed* the NFS store (from the simulated basic zone).
> >>>>
> >>>
> >>> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
> >>> <updatecloudtouseobjectstoreresponse
> >>> cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4d
> >>> a
> >>> 8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/t
> >>> e
> >>> st</url><protocol>http</protocol><providername>S3</providername><scop
> >>> e
> >>>> REGION</scope><details><name>secretkey</name><value>dummy</value></d
> >>>> e
> >>> tails><details><name>accesskey</name><value>dummy</value></details></
> >>> tails>i
> >>> magestore></updatecloudtouseobjectstoreresponse>
> >>>
> >>
> >> Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
> >>
> >> Can you send the exact request that you sent ?
> >>
> >>> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
> >>>
> >>> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS',
> >>> 'nfs', 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1',
> >>> 'ZONE', 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863',
> >>> '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58',
> >>> NULL, NULL, NULL '2', 'test', 'S3', 'http',
> >>> 'http://localhost:1234/test', NULL, 'REGION', 'Image',
> >>> '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55',
> >>> NULL, NULL, NULL
> >>>
> >>
> >> Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
> >>
> >>>
> >>>> I was then able to add:
> >>>>
> >>>>> add imagestore name=riakcs provider=S3
> >>>>> url=http://localhost:9081/riak-cs details[0].key=accesskey
> >>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
> >>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
> >>>> imagestore:
> >>>> name = riakcs
> >>>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
> >>>> details:
> >>>> +-----------+------------------------------------------+
> >>>> | name | value |
> >>>> +-----------+------------------------------------------+
> >>>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
> >>>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
> >>>> +-----------+------------------------------------------+
> >>>> protocol = http
> >>>> providername = S3
> >>>> scope = REGION
> >>>> url = http://localhost:9081/riak-cs
> >>>>
> >>>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
> >>>>
> >>>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
> >>>>
> >>>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
> >>>>> I tried the same on a 4.4-forward setup and got a different error (as below).
> >>>>> "You can only add new image stores from the same provider NFS already added"
> >>>>>
> >>>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
> >>>>> This is the change I made
> >>>>>
> >>>>> diff --git
> >>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
> >>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
> >>>>> b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
> >>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
> >>>>> index edf1e28..537c7bd 100644
> >>>>> ---
> >>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
> >>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
> >>>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/stora
> >>>>> +++ g e/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
> >>>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
> >>>>> */
> >>>>> @Override
> >>>>> public boolean migrateToObjectStore(DataStore store) {
> >>>>> - return false;
> >>>>> + return imageStoreHelper.convertToStagingStore(store);
> >>>>> }
> >>>>>
> >>>>> }
> >>>>>
> >>>>> -----Original Message-----
> >>>>> From: Min Chen [mailto:min.chen@citrix.com]
> >>>>> Sent: Saturday, 21 June 2014 3:44 AM
> >>>>> To: dev@cloudstack.apache.org
> >>>>> Subject: Re: S3 use with simulator
> >>>>>
> >>>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
> >>>>>
> >>>>> Thanks
> >>>>> -min
> >>>>>
> >>>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
> >>>>>
> >>>>>> I already have an Nsf secondary storage. I understood that i could
> >>>>>> not add a second secondary storage that is s3 based, and that the
> >>>>>> only way was to use the updatecloud.... Api
> >>>>>>
> >>>>>> -Sebastien
> >>>>>>
> >>>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
> >>>>>>>
> >>>>>>> Hi Sebastien,
> >>>>>>>
> >>>>>>> I am curious why you are using updateCloudToUseObjectStore api to
> >>>>>>> add S3 as a secondary store in your data center? To set up a
> >>>>>>> data center using S3, you need to use addImageStore api.
> >>>>>>>
> >>>>>>> Thanks
> >>>>>>> -min
> >>>>>>>
> >>>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
> >>>>>>>>
> >>>>>>>> I switch to provider=S3 but I get:
> >>>>>>>>
> >>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
> >>>>>>>>> simulator image store has to be associated with a data center
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das
> >>>>>>>>> <ko...@citrix.com>
> >>>>>>>>> wrote:
> >>>>>>>>>
> >>>>>>>>> As per the code the following are the supported image store
> >>>>>>>>> provider types
> >>>>>>>>>
> >>>>>>>>> // constants for provider names static final String NFS_IMAGE =
> >>>>>>>>> "NFS"; static final String S3_IMAGE = "S3"; static final String
> >>>>>>>>> SWIFT_IMAGE = "Swift"; static final String SAMPLE_IMAGE =
> >>>>>>>>> "Sample"; static final String SMB = "NFS"; static final String
> >>>>>>>>> DEFAULT_PRIMARY = "DefaultPrimary";
> >>>>>>>>>
> >>>>>>>>> Try passing S3 in the provider.
> >>>>>>>>> BTW when you setup simulator the image provider is NFS.
> >>>>>>>>>
> >>>>>>>>> -----Original Message-----
> >>>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
> >>>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
> >>>>>>>>> To: dev@cloudstack.apache.org
> >>>>>>>>> Subject: S3 use with simulator
> >>>>>>>>>
> >>>>>>>>> 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
> >>>>>>>>>> &
> >>>>>>>>>> deta
> >>>>>>>>>> ils
> >>>>>>>>>> [1
> >>>>>>>>>>
> >>>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl
> >>>>>>>>>> 5
> >>>>>>>>>> Z7Ni
> >>>>>>>>>> WKs
> >>>>>>>>>> g=
> >>>>>>>>>> =
> >>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
> >>>>>>>>> simulator image store has to be associated with a data center
> >>>>>>>>>
> >>>>>>>>> I am not sure if the arguments are right, has anyone done this
> >>>>>>>>> before ?
> >>>>>>>>>
> >>>>>>>>> thanks,
> >>>>>>>>>
> >>>>>>>>> -sebastien
> >>>>>>>
> >>>>>
> >>>>
> >>>
> >>
> >
--
Prasanna.,
------------------------
Powered by BigRock.com
Re: S3 use with simulator
Posted by sebgoa <ru...@gmail.com>.
On Jun 23, 2014, at 2:30 PM, Koushik Das <ko...@citrix.com> wrote:
> This has nothing to do with the zoneId. If you search the source code for the error message "Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center", it points toSimulatorImageStoreLifeCycleImpl.initialize() method. This indicates that somehow the image store provider for Simulator is getting picked up. For S3 provider type, the S3ImageStoreLifeCycleImpl should get invoked and in that the zoneId is not used so there won't be issues.
Happy to discuss it on IRC, if you could join.
in SimulatorImageStoreLifeCycleImpl.initialize() on 4.4-forward I see:
Long dcId = (Long)dsInfos.get("zoneId");
String url = (String)dsInfos.get("url");
String name = (String)dsInfos.get("name");
if (name == null) {
name = url;
}
...
if (dcId == null) {
throw new InvalidParameterValueException("DataCenter id is null, and simulator image store has to be associated with a data center");
}
So my non Java expertise tells me that dcId is null because zoneId is not set ???
>
>
> -----Original Message-----
> From: Sebastien Goasguen [mailto:runseb@gmail.com]
> Sent: Monday, 23 June 2014 5:47 PM
> To: dev@cloudstack.apache.org
> Subject: Re: S3 use with simulator
>
>
> On Jun 23, 2014, at 7:14 AM, Koushik Das <ko...@citrix.com> wrote:
>
>> This is the request
>>
>> http://localhost:8096/api?command=updateCloudToUseObjectStore&url=http
>> ://localhost:1234/test&name=test&provider=S3&details[0].key=accesskey&
>> details[0].value=dummy&details[1].key=secretkey&details[1].value=dummy
>
> Any chance you can try with a signed api request ?
>
> It looks like it's not finding a zoneId ...hence dcId is null....
>
>>
>>
>> -----Original Message-----
>> From: sebgoa [mailto:runseb@gmail.com]
>> Sent: Monday, 23 June 2014 4:40 PM
>> To: dev@cloudstack.apache.org
>> Subject: Re: S3 use with simulator
>>
>>
>> On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
>>
>>> inline
>>>
>>> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
>>>
>>>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>>>>
>>>> I still add the same error:
>>>>
>>>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs
>>>>> name=riakcs provider=s3 details[0].key=accesskey
>>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>> image store has to be associated with a data center
>>>>
>>>> However this actually *removed* the NFS store (from the simulated basic zone).
>>>>
>>>
>>> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
>>> <updatecloudtouseobjectstoreresponse
>>> cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4d
>>> a
>>> 8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/t
>>> e
>>> st</url><protocol>http</protocol><providername>S3</providername><scop
>>> e
>>>> REGION</scope><details><name>secretkey</name><value>dummy</value></d
>>>> e
>>> tails><details><name>accesskey</name><value>dummy</value></details></
>>> tails>i
>>> magestore></updatecloudtouseobjectstoreresponse>
>>>
>>
>> Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
>>
>> Can you send the exact request that you sent ?
>>
>>> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
>>>
>>> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS',
>>> 'nfs', 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1',
>>> 'ZONE', 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863',
>>> '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58',
>>> NULL, NULL, NULL '2', 'test', 'S3', 'http',
>>> 'http://localhost:1234/test', NULL, 'REGION', 'Image',
>>> '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55',
>>> NULL, NULL, NULL
>>>
>>
>> Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
>>
>>>
>>>> I was then able to add:
>>>>
>>>>> add imagestore name=riakcs provider=S3
>>>>> url=http://localhost:9081/riak-cs details[0].key=accesskey
>>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>>> imagestore:
>>>> name = riakcs
>>>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
>>>> details:
>>>> +-----------+------------------------------------------+
>>>> | name | value |
>>>> +-----------+------------------------------------------+
>>>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
>>>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
>>>> +-----------+------------------------------------------+
>>>> protocol = http
>>>> providername = S3
>>>> scope = REGION
>>>> url = http://localhost:9081/riak-cs
>>>>
>>>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>>>>
>>>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>>>>
>>>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>>>>> I tried the same on a 4.4-forward setup and got a different error (as below).
>>>>> "You can only add new image stores from the same provider NFS already added"
>>>>>
>>>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>>>>> This is the change I made
>>>>>
>>>>> diff --git
>>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>> b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>> index edf1e28..537c7bd 100644
>>>>> ---
>>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/stora
>>>>> +++ g e/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>>>>> */
>>>>> @Override
>>>>> public boolean migrateToObjectStore(DataStore store) {
>>>>> - return false;
>>>>> + return imageStoreHelper.convertToStagingStore(store);
>>>>> }
>>>>>
>>>>> }
>>>>>
>>>>> -----Original Message-----
>>>>> From: Min Chen [mailto:min.chen@citrix.com]
>>>>> Sent: Saturday, 21 June 2014 3:44 AM
>>>>> To: dev@cloudstack.apache.org
>>>>> Subject: Re: S3 use with simulator
>>>>>
>>>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>>>>
>>>>> Thanks
>>>>> -min
>>>>>
>>>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>
>>>>>> I already have an Nsf secondary storage. I understood that i could
>>>>>> not add a second secondary storage that is s3 based, and that the
>>>>>> only way was to use the updatecloud.... Api
>>>>>>
>>>>>> -Sebastien
>>>>>>
>>>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>>>>
>>>>>>> Hi Sebastien,
>>>>>>>
>>>>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>>>>> add S3 as a secondary store in your data center? To set up a
>>>>>>> data center using S3, you need to use addImageStore api.
>>>>>>>
>>>>>>> Thanks
>>>>>>> -min
>>>>>>>
>>>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>>>
>>>>>>>> I switch to provider=S3 but I get:
>>>>>>>>
>>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>
>>>>>>>>
>>>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das
>>>>>>>>> <ko...@citrix.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> As per the code the following are the supported image store
>>>>>>>>> provider types
>>>>>>>>>
>>>>>>>>> // constants for provider names static final String NFS_IMAGE =
>>>>>>>>> "NFS"; static final String S3_IMAGE = "S3"; static final String
>>>>>>>>> SWIFT_IMAGE = "Swift"; static final String SAMPLE_IMAGE =
>>>>>>>>> "Sample"; static final String SMB = "NFS"; static final String
>>>>>>>>> DEFAULT_PRIMARY = "DefaultPrimary";
>>>>>>>>>
>>>>>>>>> Try passing S3 in the provider.
>>>>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>>>>
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>>>>> To: dev@cloudstack.apache.org
>>>>>>>>> Subject: S3 use with simulator
>>>>>>>>>
>>>>>>>>> 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
>>>>>>>>>> &
>>>>>>>>>> deta
>>>>>>>>>> ils
>>>>>>>>>> [1
>>>>>>>>>>
>>>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl
>>>>>>>>>> 5
>>>>>>>>>> Z7Ni
>>>>>>>>>> WKs
>>>>>>>>>> g=
>>>>>>>>>> =
>>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>>
>>>>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>>>>> before ?
>>>>>>>>>
>>>>>>>>> thanks,
>>>>>>>>>
>>>>>>>>> -sebastien
>>>>>>>
>>>>>
>>>>
>>>
>>
>
RE: S3 use with simulator
Posted by Koushik Das <ko...@citrix.com>.
This has nothing to do with the zoneId. If you search the source code for the error message "Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center", it points to SimulatorImageStoreLifeCycleImpl.initialize() method. This indicates that somehow the image store provider for Simulator is getting picked up. For S3 provider type, the S3ImageStoreLifeCycleImpl should get invoked and in that the zoneId is not used so there won't be issues.
-----Original Message-----
From: Sebastien Goasguen [mailto:runseb@gmail.com]
Sent: Monday, 23 June 2014 5:47 PM
To: dev@cloudstack.apache.org
Subject: Re: S3 use with simulator
On Jun 23, 2014, at 7:14 AM, Koushik Das <ko...@citrix.com> wrote:
> This is the request
>
> http://localhost:8096/api?command=updateCloudToUseObjectStore&url=http
> ://localhost:1234/test&name=test&provider=S3&details[0].key=accesskey&
> details[0].value=dummy&details[1].key=secretkey&details[1].value=dummy
Any chance you can try with a signed api request ?
It looks like it's not finding a zoneId ...hence dcId is null....
>
>
> -----Original Message-----
> From: sebgoa [mailto:runseb@gmail.com]
> Sent: Monday, 23 June 2014 4:40 PM
> To: dev@cloudstack.apache.org
> Subject: Re: S3 use with simulator
>
>
> On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
>
>> inline
>>
>> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
>>
>>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>>>
>>> I still add the same error:
>>>
>>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs
>>>> name=riakcs provider=s3 details[0].key=accesskey
>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>> image store has to be associated with a data center
>>>
>>> However this actually *removed* the NFS store (from the simulated basic zone).
>>>
>>
>> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
>> <updatecloudtouseobjectstoreresponse
>> cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4d
>> a
>> 8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/t
>> e
>> st</url><protocol>http</protocol><providername>S3</providername><scop
>> e
>>> REGION</scope><details><name>secretkey</name><value>dummy</value></d
>>> e
>> tails><details><name>accesskey</name><value>dummy</value></details></
>> tails>i
>> magestore></updatecloudtouseobjectstoreresponse>
>>
>
> Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
>
> Can you send the exact request that you sent ?
>
>> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
>>
>> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS',
>> 'nfs', 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1',
>> 'ZONE', 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863',
>> '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58',
>> NULL, NULL, NULL '2', 'test', 'S3', 'http',
>> 'http://localhost:1234/test', NULL, 'REGION', 'Image',
>> '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55',
>> NULL, NULL, NULL
>>
>
> Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
>
>>
>>> I was then able to add:
>>>
>>>> add imagestore name=riakcs provider=S3
>>>> url=http://localhost:9081/riak-cs details[0].key=accesskey
>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>> imagestore:
>>> name = riakcs
>>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
>>> details:
>>> +-----------+------------------------------------------+
>>> | name | value |
>>> +-----------+------------------------------------------+
>>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
>>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
>>> +-----------+------------------------------------------+
>>> protocol = http
>>> providername = S3
>>> scope = REGION
>>> url = http://localhost:9081/riak-cs
>>>
>>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>>>
>>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>>>
>>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>>>> I tried the same on a 4.4-forward setup and got a different error (as below).
>>>> "You can only add new image stores from the same provider NFS already added"
>>>>
>>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>>>> This is the change I made
>>>>
>>>> diff --git
>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> index edf1e28..537c7bd 100644
>>>> ---
>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/d
>>>> a tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/stora
>>>> +++ g e/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>>>> */
>>>> @Override
>>>> public boolean migrateToObjectStore(DataStore store) {
>>>> - return false;
>>>> + return imageStoreHelper.convertToStagingStore(store);
>>>> }
>>>>
>>>> }
>>>>
>>>> -----Original Message-----
>>>> From: Min Chen [mailto:min.chen@citrix.com]
>>>> Sent: Saturday, 21 June 2014 3:44 AM
>>>> To: dev@cloudstack.apache.org
>>>> Subject: Re: S3 use with simulator
>>>>
>>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>>>
>>>> Thanks
>>>> -min
>>>>
>>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>
>>>>> I already have an Nsf secondary storage. I understood that i could
>>>>> not add a second secondary storage that is s3 based, and that the
>>>>> only way was to use the updatecloud.... Api
>>>>>
>>>>> -Sebastien
>>>>>
>>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>>>
>>>>>> Hi Sebastien,
>>>>>>
>>>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>>>> add S3 as a secondary store in your data center? To set up a
>>>>>> data center using S3, you need to use addImageStore api.
>>>>>>
>>>>>> Thanks
>>>>>> -min
>>>>>>
>>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>>
>>>>>>> I switch to provider=S3 but I get:
>>>>>>>
>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>
>>>>>>>
>>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das
>>>>>>>> <ko...@citrix.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> As per the code the following are the supported image store
>>>>>>>> provider types
>>>>>>>>
>>>>>>>> // constants for provider names static final String NFS_IMAGE =
>>>>>>>> "NFS"; static final String S3_IMAGE = "S3"; static final String
>>>>>>>> SWIFT_IMAGE = "Swift"; static final String SAMPLE_IMAGE =
>>>>>>>> "Sample"; static final String SMB = "NFS"; static final String
>>>>>>>> DEFAULT_PRIMARY = "DefaultPrimary";
>>>>>>>>
>>>>>>>> Try passing S3 in the provider.
>>>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>>>> To: dev@cloudstack.apache.org
>>>>>>>> Subject: S3 use with simulator
>>>>>>>>
>>>>>>>> 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
>>>>>>>>> &
>>>>>>>>> deta
>>>>>>>>> ils
>>>>>>>>> [1
>>>>>>>>>
>>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl
>>>>>>>>> 5
>>>>>>>>> Z7Ni
>>>>>>>>> WKs
>>>>>>>>> g=
>>>>>>>>> =
>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>
>>>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>>>> before ?
>>>>>>>>
>>>>>>>> thanks,
>>>>>>>>
>>>>>>>> -sebastien
>>>>>>
>>>>
>>>
>>
>
Re: S3 use with simulator
Posted by Sebastien Goasguen <ru...@gmail.com>.
On Jun 23, 2014, at 7:14 AM, Koushik Das <ko...@citrix.com> wrote:
> This is the request
>
> http://localhost:8096/api?command=updateCloudToUseObjectStore&url=http://localhost:1234/test&name=test&provider=S3&details[0].key=accesskey&details[0].value=dummy&details[1].key=secretkey&details[1].value=dummy
Any chance you can try with a signed api request ?
It looks like it's not finding a zoneId …hence dcId is null….
>
>
> -----Original Message-----
> From: sebgoa [mailto:runseb@gmail.com]
> Sent: Monday, 23 June 2014 4:40 PM
> To: dev@cloudstack.apache.org
> Subject: Re: S3 use with simulator
>
>
> On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
>
>> inline
>>
>> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
>>
>>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>>>
>>> I still add the same error:
>>>
>>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs
>>>> name=riakcs provider=s3 details[0].key=accesskey
>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>> image store has to be associated with a data center
>>>
>>> However this actually *removed* the NFS store (from the simulated basic zone).
>>>
>>
>> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
>> <updatecloudtouseobjectstoreresponse
>> cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4da
>> 8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/te
>> st</url><protocol>http</protocol><providername>S3</providername><scope
>>> REGION</scope><details><name>secretkey</name><value>dummy</value></de
>> tails><details><name>accesskey</name><value>dummy</value></details></i
>> magestore></updatecloudtouseobjectstoreresponse>
>>
>
> Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
>
> Can you send the exact request that you sent ?
>
>> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
>>
>> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS', 'nfs',
>> 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1', 'ZONE',
>> 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863',
>> '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58',
>> NULL, NULL, NULL '2', 'test', 'S3', 'http',
>> 'http://localhost:1234/test', NULL, 'REGION', 'Image',
>> '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55',
>> NULL, NULL, NULL
>>
>
> Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
>
>>
>>> I was then able to add:
>>>
>>>> add imagestore name=riakcs provider=S3
>>>> url=http://localhost:9081/riak-cs details[0].key=accesskey
>>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>>> imagestore:
>>> name = riakcs
>>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
>>> details:
>>> +-----------+------------------------------------------+
>>> | name | value |
>>> +-----------+------------------------------------------+
>>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
>>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
>>> +-----------+------------------------------------------+
>>> protocol = http
>>> providername = S3
>>> scope = REGION
>>> url = http://localhost:9081/riak-cs
>>>
>>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>>>
>>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>>>
>>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>>>> I tried the same on a 4.4-forward setup and got a different error (as below).
>>>> "You can only add new image stores from the same provider NFS already added"
>>>>
>>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>>>> This is the change I made
>>>>
>>>> diff --git
>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/da
>>>> tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/da
>>>> tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> index edf1e28..537c7bd 100644
>>>> ---
>>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/da
>>>> tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storag
>>>> +++ e/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>>>> */
>>>> @Override
>>>> public boolean migrateToObjectStore(DataStore store) {
>>>> - return false;
>>>> + return imageStoreHelper.convertToStagingStore(store);
>>>> }
>>>>
>>>> }
>>>>
>>>> -----Original Message-----
>>>> From: Min Chen [mailto:min.chen@citrix.com]
>>>> Sent: Saturday, 21 June 2014 3:44 AM
>>>> To: dev@cloudstack.apache.org
>>>> Subject: Re: S3 use with simulator
>>>>
>>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>>>
>>>> Thanks
>>>> -min
>>>>
>>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>
>>>>> I already have an Nsf secondary storage. I understood that i could
>>>>> not add a second secondary storage that is s3 based, and that the
>>>>> only way was to use the updatecloud.... Api
>>>>>
>>>>> -Sebastien
>>>>>
>>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>>>
>>>>>> Hi Sebastien,
>>>>>>
>>>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>>>> add S3 as a secondary store in your data center? To set up a data
>>>>>> center using S3, you need to use addImageStore api.
>>>>>>
>>>>>> Thanks
>>>>>> -min
>>>>>>
>>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>>
>>>>>>> I switch to provider=S3 but I get:
>>>>>>>
>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>
>>>>>>>
>>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das
>>>>>>>> <ko...@citrix.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> As per the code the following are the supported image store
>>>>>>>> provider types
>>>>>>>>
>>>>>>>> // constants for provider names
>>>>>>>> static final String NFS_IMAGE = "NFS"; static final String
>>>>>>>> S3_IMAGE = "S3"; static final String SWIFT_IMAGE = "Swift";
>>>>>>>> static final String SAMPLE_IMAGE = "Sample"; static final String
>>>>>>>> SMB = "NFS"; static final String DEFAULT_PRIMARY =
>>>>>>>> "DefaultPrimary";
>>>>>>>>
>>>>>>>> Try passing S3 in the provider.
>>>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>>>> To: dev@cloudstack.apache.org
>>>>>>>> Subject: S3 use with simulator
>>>>>>>>
>>>>>>>> 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&
>>>>>>>>> deta
>>>>>>>>> ils
>>>>>>>>> [1
>>>>>>>>>
>>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5
>>>>>>>>> Z7Ni
>>>>>>>>> WKs
>>>>>>>>> g=
>>>>>>>>> =
>>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>>> simulator image store has to be associated with a data center
>>>>>>>>
>>>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>>>> before ?
>>>>>>>>
>>>>>>>> thanks,
>>>>>>>>
>>>>>>>> -sebastien
>>>>>>
>>>>
>>>
>>
>
RE: S3 use with simulator
Posted by Koushik Das <ko...@citrix.com>.
This is the request
http://localhost:8096/api?command=updateCloudToUseObjectStore&url=http://localhost:1234/test&name=test&provider=S3&details[0].key=accesskey&details[0].value=dummy&details[1].key=secretkey&details[1].value=dummy
-----Original Message-----
From: sebgoa [mailto:runseb@gmail.com]
Sent: Monday, 23 June 2014 4:40 PM
To: dev@cloudstack.apache.org
Subject: Re: S3 use with simulator
On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
> inline
>
> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
>
>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>>
>> I still add the same error:
>>
>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs
>>> name=riakcs provider=s3 details[0].key=accesskey
>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>> 530: Failed to add data store: DataCenter id is null, and simulator
>> image store has to be associated with a data center
>>
>> However this actually *removed* the NFS store (from the simulated basic zone).
>>
>
> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
> <updatecloudtouseobjectstoreresponse
> cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4da
> 8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/te
> st</url><protocol>http</protocol><providername>S3</providername><scope
> >REGION</scope><details><name>secretkey</name><value>dummy</value></de
> tails><details><name>accesskey</name><value>dummy</value></details></i
> magestore></updatecloudtouseobjectstoreresponse>
>
Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
Can you send the exact request that you sent ?
> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
>
> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS', 'nfs',
> 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1', 'ZONE',
> 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863',
> '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58',
> NULL, NULL, NULL '2', 'test', 'S3', 'http',
> 'http://localhost:1234/test', NULL, 'REGION', 'Image',
> '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55',
> NULL, NULL, NULL
>
Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
>
>> I was then able to add:
>>
>>> add imagestore name=riakcs provider=S3
>>> url=http://localhost:9081/riak-cs details[0].key=accesskey
>>> details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey
>>> details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>> imagestore:
>> name = riakcs
>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
>> details:
>> +-----------+------------------------------------------+
>> | name | value |
>> +-----------+------------------------------------------+
>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
>> +-----------+------------------------------------------+
>> protocol = http
>> providername = S3
>> scope = REGION
>> url = http://localhost:9081/riak-cs
>>
>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>>
>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>>
>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>>> I tried the same on a 4.4-forward setup and got a different error (as below).
>>> "You can only add new image stores from the same provider NFS already added"
>>>
>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>>> This is the change I made
>>>
>>> diff --git
>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/da
>>> tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>> b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/da
>>> tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>> index edf1e28..537c7bd 100644
>>> ---
>>> a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/da
>>> tastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storag
>>> +++ e/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>>> */
>>> @Override
>>> public boolean migrateToObjectStore(DataStore store) {
>>> - return false;
>>> + return imageStoreHelper.convertToStagingStore(store);
>>> }
>>>
>>> }
>>>
>>> -----Original Message-----
>>> From: Min Chen [mailto:min.chen@citrix.com]
>>> Sent: Saturday, 21 June 2014 3:44 AM
>>> To: dev@cloudstack.apache.org
>>> Subject: Re: S3 use with simulator
>>>
>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>>
>>> Thanks
>>> -min
>>>
>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>
>>>> I already have an Nsf secondary storage. I understood that i could
>>>> not add a second secondary storage that is s3 based, and that the
>>>> only way was to use the updatecloud.... Api
>>>>
>>>> -Sebastien
>>>>
>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>>
>>>>> Hi Sebastien,
>>>>>
>>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>>> add S3 as a secondary store in your data center? To set up a data
>>>>> center using S3, you need to use addImageStore api.
>>>>>
>>>>> Thanks
>>>>> -min
>>>>>
>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>
>>>>>> I switch to provider=S3 but I get:
>>>>>>
>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>> simulator image store has to be associated with a data center
>>>>>>
>>>>>>
>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das
>>>>>>> <ko...@citrix.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> As per the code the following are the supported image store
>>>>>>> provider types
>>>>>>>
>>>>>>> // constants for provider names
>>>>>>> static final String NFS_IMAGE = "NFS"; static final String
>>>>>>> S3_IMAGE = "S3"; static final String SWIFT_IMAGE = "Swift";
>>>>>>> static final String SAMPLE_IMAGE = "Sample"; static final String
>>>>>>> SMB = "NFS"; static final String DEFAULT_PRIMARY =
>>>>>>> "DefaultPrimary";
>>>>>>>
>>>>>>> Try passing S3 in the provider.
>>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>>> To: dev@cloudstack.apache.org
>>>>>>> Subject: S3 use with simulator
>>>>>>>
>>>>>>> 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&
>>>>>>>> deta
>>>>>>>> ils
>>>>>>>> [1
>>>>>>>>
>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5
>>>>>>>> Z7Ni
>>>>>>>> WKs
>>>>>>>> g=
>>>>>>>> =
>>>>>>> 530: Failed to add data store: DataCenter id is null, and
>>>>>>> simulator image store has to be associated with a data center
>>>>>>>
>>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>>> before ?
>>>>>>>
>>>>>>> thanks,
>>>>>>>
>>>>>>> -sebastien
>>>>>
>>>
>>
>
Re: S3 use with simulator
Posted by sebgoa <ru...@gmail.com>.
On Jun 23, 2014, at 12:51 PM, Koushik Das <ko...@citrix.com> wrote:
> inline
>
> On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
>
>> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>>
>> I still add the same error:
>>
>>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs name=riakcs provider=s3 details[0].key=accesskey details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>> 530: Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center
>>
>> However this actually *removed* the NFS store (from the simulated basic zone).
>>
>
> I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
> <updatecloudtouseobjectstoreresponse cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4da8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/test</url><protocol>http</protocol><providername>S3</providername><scope>REGION</scope><details><name>secretkey</name><value>dummy</value></details><details><name>accesskey</name><value>dummy</value></details></imagestore></updatecloudtouseobjectstoreresponse>
>
Hum, strange. I just checked with an advanced zone from setup/dev/advanced.cfg and I get the same error 'datacenter id is null'.
Can you send the exact request that you sent ?
> Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
>
> '1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS', 'nfs', 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1', 'ZONE', 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863', '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58', NULL, NULL, NULL
> '2', 'test', 'S3', 'http', 'http://localhost:1234/test', NULL, 'REGION', 'Image', '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55', NULL, NULL, NULL
>
Yes I can confirm this. It gets listed in the UI under 'secondary staging store', and it's in the db.
>
>> I was then able to add:
>>
>>> add imagestore name=riakcs provider=S3 url=http://localhost:9081/riak-cs details[0].key=accesskey details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
>> imagestore:
>> name = riakcs
>> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
>> details:
>> +-----------+------------------------------------------+
>> | name | value |
>> +-----------+------------------------------------------+
>> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
>> | accesskey | ZMJD6-90S2MST4NZMK1Z |
>> +-----------+------------------------------------------+
>> protocol = http
>> providername = S3
>> scope = REGION
>> url = http://localhost:9081/riak-cs
>>
>> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>>
>> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>>
>>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>>> I tried the same on a 4.4-forward setup and got a different error (as below).
>>> "You can only add new image stores from the same provider NFS already added"
>>>
>>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>>> This is the change I made
>>>
>>> diff --git a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>> index edf1e28..537c7bd 100644
>>> --- a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>>> */
>>> @Override
>>> public boolean migrateToObjectStore(DataStore store) {
>>> - return false;
>>> + return imageStoreHelper.convertToStagingStore(store);
>>> }
>>>
>>> }
>>>
>>> -----Original Message-----
>>> From: Min Chen [mailto:min.chen@citrix.com]
>>> Sent: Saturday, 21 June 2014 3:44 AM
>>> To: dev@cloudstack.apache.org
>>> Subject: Re: S3 use with simulator
>>>
>>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>>
>>> Thanks
>>> -min
>>>
>>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>
>>>> I already have an Nsf secondary storage. I understood that i could not
>>>> add a second secondary storage that is s3 based, and that the only way
>>>> was to use the updatecloud.... Api
>>>>
>>>> -Sebastien
>>>>
>>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>>
>>>>> Hi Sebastien,
>>>>>
>>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>>> add S3 as a secondary store in your data center? To set up a data
>>>>> center using S3, you need to use addImageStore api.
>>>>>
>>>>> Thanks
>>>>> -min
>>>>>
>>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>>
>>>>>> I switch to provider=S3 but I get:
>>>>>>
>>>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>>>> image store has to be associated with a data center
>>>>>>
>>>>>>
>>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> As per the code the following are the supported image store
>>>>>>> provider types
>>>>>>>
>>>>>>> // constants for provider names
>>>>>>> static final String NFS_IMAGE = "NFS";
>>>>>>> static final String S3_IMAGE = "S3";
>>>>>>> static final String SWIFT_IMAGE = "Swift";
>>>>>>> static final String SAMPLE_IMAGE = "Sample";
>>>>>>> static final String SMB = "NFS";
>>>>>>> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>>>>>>>
>>>>>>> Try passing S3 in the provider.
>>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>>> To: dev@cloudstack.apache.org
>>>>>>> Subject: S3 use with simulator
>>>>>>>
>>>>>>> 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&deta
>>>>>>>> ils
>>>>>>>> [1
>>>>>>>>
>>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7Ni
>>>>>>>> WKs
>>>>>>>> g=
>>>>>>>> =
>>>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>>>> image store has to be associated with a data center
>>>>>>>
>>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>>> before ?
>>>>>>>
>>>>>>> thanks,
>>>>>>>
>>>>>>> -sebastien
>>>>>
>>>
>>
>
Re: S3 use with simulator
Posted by Koushik Das <ko...@citrix.com>.
inline
On 23-Jun-2014, at 4:05 PM, Sebastien Goasguen <ru...@gmail.com> wrote:
> Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
>
> I still add the same error:
>
>> update cloudtouseobjectstore url=http://localhost:9081/riak-cs name=riakcs provider=s3 details[0].key=accesskey details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
> 530: Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center
>
> However this actually *removed* the NFS store (from the simulated basic zone).
>
I verified using advanced zone, not sure if there are any issues with basic zone. The API response I get is the following:
<updatecloudtouseobjectstoreresponse cloud-stack-version="4.4.0-SNAPSHOT"><imagestore><id>55b7e6f7-ec27-4da8-b4a0-b209a3e3d825</id><name>test</name><url>http://localhost:1234/test</url><protocol>http</protocol><providername>S3</providername><scope>REGION</scope><details><name>secretkey</name><value>dummy</value></details><details><name>accesskey</name><value>dummy</value></details></imagestore></updatecloudtouseobjectstoreresponse>
Also in the image_store table the entries look like below, note that the 'role' of NFS store changed to 'ImageCache'.
'1', 'nfs://10.147.28.6:/export/home/sandbox/secondary', 'NFS', 'nfs', 'nfs://10.147.28.6:/export/home/sandbox/secondary', '1', 'ZONE', 'ImageCache', '8eb3e701-7e2b-4925-87f8-f8ea5f97b863', '/mnt/05b33ef7-da6a-33eb-9981-b4efb90ed99b/', '2014-06-23 06:27:58', NULL, NULL, NULL
'2', 'test', 'S3', 'http', 'http://localhost:1234/test', NULL, 'REGION', 'Image', '55b7e6f7-ec27-4da8-b4a0-b209a3e3d825', NULL, '2014-06-23 07:37:55', NULL, NULL, NULL
> I was then able to add:
>
>> add imagestore name=riakcs provider=S3 url=http://localhost:9081/riak-cs details[0].key=accesskey details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
> imagestore:
> name = riakcs
> id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
> details:
> +-----------+------------------------------------------+
> | name | value |
> +-----------+------------------------------------------+
> | secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
> | accesskey | ZMJD6-90S2MST4NZMK1Z |
> +-----------+------------------------------------------+
> protocol = http
> providername = S3
> scope = REGION
> url = http://localhost:9081/riak-cs
>
> Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
>
> On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
>
>> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
>> I tried the same on a 4.4-forward setup and got a different error (as below).
>> "You can only add new image stores from the same provider NFS already added"
>>
>> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
>> This is the change I made
>>
>> diff --git a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>> index edf1e28..537c7bd 100644
>> --- a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
>> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
>> */
>> @Override
>> public boolean migrateToObjectStore(DataStore store) {
>> - return false;
>> + return imageStoreHelper.convertToStagingStore(store);
>> }
>>
>> }
>>
>> -----Original Message-----
>> From: Min Chen [mailto:min.chen@citrix.com]
>> Sent: Saturday, 21 June 2014 3:44 AM
>> To: dev@cloudstack.apache.org
>> Subject: Re: S3 use with simulator
>>
>> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>>
>> Thanks
>> -min
>>
>> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>
>>> I already have an Nsf secondary storage. I understood that i could not
>>> add a second secondary storage that is s3 based, and that the only way
>>> was to use the updatecloud.... Api
>>>
>>> -Sebastien
>>>
>>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>>
>>>> Hi Sebastien,
>>>>
>>>> I am curious why you are using updateCloudToUseObjectStore api to
>>>> add S3 as a secondary store in your data center? To set up a data
>>>> center using S3, you need to use addImageStore api.
>>>>
>>>> Thanks
>>>> -min
>>>>
>>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>>
>>>>> I switch to provider=S3 but I get:
>>>>>
>>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>>> image store has to be associated with a data center
>>>>>
>>>>>
>>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com>
>>>>>> wrote:
>>>>>>
>>>>>> As per the code the following are the supported image store
>>>>>> provider types
>>>>>>
>>>>>> // constants for provider names
>>>>>> static final String NFS_IMAGE = "NFS";
>>>>>> static final String S3_IMAGE = "S3";
>>>>>> static final String SWIFT_IMAGE = "Swift";
>>>>>> static final String SAMPLE_IMAGE = "Sample";
>>>>>> static final String SMB = "NFS";
>>>>>> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>>>>>>
>>>>>> Try passing S3 in the provider.
>>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>>> To: dev@cloudstack.apache.org
>>>>>> Subject: S3 use with simulator
>>>>>>
>>>>>> 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&deta
>>>>>>> ils
>>>>>>> [1
>>>>>>>
>>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7Ni
>>>>>>> WKs
>>>>>>> g=
>>>>>>> =
>>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>>> image store has to be associated with a data center
>>>>>>
>>>>>> I am not sure if the arguments are right, has anyone done this
>>>>>> before ?
>>>>>>
>>>>>> thanks,
>>>>>>
>>>>>> -sebastien
>>>>
>>
>
Re: S3 use with simulator
Posted by Sebastien Goasguen <ru...@gmail.com>.
Hi Koushik, thanks for the hint, I checked out 4.4-forward and made that small change.
I still add the same error:
> update cloudtouseobjectstore url=http://localhost:9081/riak-cs name=riakcs provider=s3 details[0].key=accesskey details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
530: Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center
However this actually *removed* the NFS store (from the simulated basic zone).
I was then able to add:
> add imagestore name=riakcs provider=S3 url=http://localhost:9081/riak-cs details[0].key=accesskey details[0].value=ZMJD6-90S2MST4NZMK1Z details[1].key=secretkey details[1].value=ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q==
imagestore:
name = riakcs
id = 1a60d62a-c1e9-4d1c-8b35-d5cd687f6de4
details:
+-----------+------------------------------------------+
| name | value |
+-----------+------------------------------------------+
| secretkey | ecJlaZebrYKj_qYaIfzlRR_1izojGVWjBRFx0Q== |
| accesskey | ZMJD6-90S2MST4NZMK1Z |
+-----------+------------------------------------------+
protocol = http
providername = S3
scope = REGION
url = http://localhost:9081/riak-cs
Apparently successfully, even though the removal of the NFS store entirely is a bit worrisome.
On Jun 23, 2014, at 4:32 AM, Koushik Das <ko...@citrix.com> wrote:
> The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
> I tried the same on a 4.4-forward setup and got a different error (as below).
> "You can only add new image stores from the same provider NFS already added"
>
> This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
> This is the change I made
>
> diff --git a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
> index edf1e28..537c7bd 100644
> --- a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
> +++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
> @@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
> */
> @Override
> public boolean migrateToObjectStore(DataStore store) {
> - return false;
> + return imageStoreHelper.convertToStagingStore(store);
> }
>
> }
>
> -----Original Message-----
> From: Min Chen [mailto:min.chen@citrix.com]
> Sent: Saturday, 21 June 2014 3:44 AM
> To: dev@cloudstack.apache.org
> Subject: Re: S3 use with simulator
>
> Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
>
> Thanks
> -min
>
> On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>
>> I already have an Nsf secondary storage. I understood that i could not
>> add a second secondary storage that is s3 based, and that the only way
>> was to use the updatecloud.... Api
>>
>> -Sebastien
>>
>>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>>
>>> Hi Sebastien,
>>>
>>> I am curious why you are using updateCloudToUseObjectStore api to
>>> add S3 as a secondary store in your data center? To set up a data
>>> center using S3, you need to use addImageStore api.
>>>
>>> Thanks
>>> -min
>>>
>>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>>
>>>> I switch to provider=S3 but I get:
>>>>
>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>> image store has to be associated with a data center
>>>>
>>>>
>>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com>
>>>>> wrote:
>>>>>
>>>>> As per the code the following are the supported image store
>>>>> provider types
>>>>>
>>>>> // constants for provider names
>>>>> static final String NFS_IMAGE = "NFS";
>>>>> static final String S3_IMAGE = "S3";
>>>>> static final String SWIFT_IMAGE = "Swift";
>>>>> static final String SAMPLE_IMAGE = "Sample";
>>>>> static final String SMB = "NFS";
>>>>> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>>>>>
>>>>> Try passing S3 in the provider.
>>>>> BTW when you setup simulator the image provider is NFS.
>>>>>
>>>>> -----Original Message-----
>>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>>> To: dev@cloudstack.apache.org
>>>>> Subject: S3 use with simulator
>>>>>
>>>>> 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&deta
>>>>>> ils
>>>>>> [1
>>>>>>
>>>>>> ].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7Ni
>>>>>> WKs
>>>>>> g=
>>>>>> =
>>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>>> image store has to be associated with a data center
>>>>>
>>>>> I am not sure if the arguments are right, has anyone done this
>>>>> before ?
>>>>>
>>>>> thanks,
>>>>>
>>>>> -sebastien
>>>
>
RE: S3 use with simulator
Posted by Koushik Das <ko...@citrix.com>.
The error message is from the simulator storage plugin, not sure why you are getting it even after setting provider types as S3.
I tried the same on a 4.4-forward setup and got a different error (as below).
"You can only add new image stores from the same provider NFS already added"
This error is there as the simulator storage provider doesn't support migration to object store. Once I fixed it, the image store got added successfully and the NFS store was converted to a cache store.
This is the change I made
diff --git a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
index edf1e28..537c7bd 100644
--- a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
+++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/lifecycle/SimulatorImageStoreLifeCycleImpl.java
@@ -133,7 +133,7 @@ public class SimulatorImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
*/
@Override
public boolean migrateToObjectStore(DataStore store) {
- return false;
+ return imageStoreHelper.convertToStagingStore(store);
}
}
-----Original Message-----
From: Min Chen [mailto:min.chen@citrix.com]
Sent: Saturday, 21 June 2014 3:44 AM
To: dev@cloudstack.apache.org
Subject: Re: S3 use with simulator
Got it. The error seems from simulator, maybe Koushik has better idea on that. I didn't use that on simulator env though.
Thanks
-min
On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>I already have an Nsf secondary storage. I understood that i could not
>add a second secondary storage that is s3 based, and that the only way
>was to use the updatecloud.... Api
>
>-Sebastien
>
>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>
>> Hi Sebastien,
>>
>> I am curious why you are using updateCloudToUseObjectStore api to
>>add S3 as a secondary store in your data center? To set up a data
>>center using S3, you need to use addImageStore api.
>>
>> Thanks
>> -min
>>
>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>
>>> I switch to provider=S3 but I get:
>>>
>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>> image store has to be associated with a data center
>>>
>>>
>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com>
>>>>wrote:
>>>>
>>>> As per the code the following are the supported image store
>>>> provider types
>>>>
>>>> // constants for provider names
>>>> static final String NFS_IMAGE = "NFS";
>>>> static final String S3_IMAGE = "S3";
>>>> static final String SWIFT_IMAGE = "Swift";
>>>> static final String SAMPLE_IMAGE = "Sample";
>>>> static final String SMB = "NFS";
>>>> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>>>>
>>>> Try passing S3 in the provider.
>>>> BTW when you setup simulator the image provider is NFS.
>>>>
>>>> -----Original Message-----
>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>> To: dev@cloudstack.apache.org
>>>> Subject: S3 use with simulator
>>>>
>>>> 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&deta
>>>>>ils
>>>>>[1
>>>>>
>>>>>].key=secretkey&details[1].value=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7Ni
>>>>>WKs
>>>>>g=
>>>>> =
>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>> image store has to be associated with a data center
>>>>
>>>> I am not sure if the arguments are right, has anyone done this
>>>>before ?
>>>>
>>>> thanks,
>>>>
>>>> -sebastien
>>
Re: S3 use with simulator
Posted by Min Chen <mi...@citrix.com>.
Got it. The error seems from simulator, maybe Koushik has better idea on
that. I didn't use that on simulator env though.
Thanks
-min
On 6/20/14 11:05 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>I already have an Nsf secondary storage. I understood that i could not
>add a second secondary storage that is s3 based, and that the only way
>was to use the updatecloud.... Api
>
>-Sebastien
>
>> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>>
>> Hi Sebastien,
>>
>> I am curious why you are using updateCloudToUseObjectStore api to
>>add S3
>> as a secondary store in your data center? To set up a data center using
>> S3, you need to use addImageStore api.
>>
>> Thanks
>> -min
>>
>>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>>
>>> I switch to provider=S3 but I get:
>>>
>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>> image store has to be associated with a data center
>>>
>>>
>>>> On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com>
>>>>wrote:
>>>>
>>>> As per the code the following are the supported image store provider
>>>> types
>>>>
>>>> // constants for provider names
>>>> static final String NFS_IMAGE = "NFS";
>>>> static final String S3_IMAGE = "S3";
>>>> static final String SWIFT_IMAGE = "Swift";
>>>> static final String SAMPLE_IMAGE = "Sample";
>>>> static final String SMB = "NFS";
>>>> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>>>>
>>>> Try passing S3 in the provider.
>>>> BTW when you setup simulator the image provider is NFS.
>>>>
>>>> -----Original Message-----
>>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>>> Sent: Thursday, 19 June 2014 5:08 PM
>>>> To: dev@cloudstack.apache.org
>>>> Subject: S3 use with simulator
>>>>
>>>> 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=8OuY3mHDXihu0Tdb2aVJ4vuYZLBAl5Z7NiWKs
>>>>>g=
>>>>> =
>>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>>> image store has to be associated with a data center
>>>>
>>>> I am not sure if the arguments are right, has anyone done this before
>>>>?
>>>>
>>>> thanks,
>>>>
>>>> -sebastien
>>
Re: S3 use with simulator
Posted by Sebastien Goasguen <ru...@gmail.com>.
I already have an Nsf secondary storage. I understood that i could not add a second secondary storage that is s3 based, and that the only way was to use the updatecloud.... Api
-Sebastien
> On 20 Jun 2014, at 18:49, Min Chen <mi...@citrix.com> wrote:
>
> Hi Sebastien,
>
> I am curious why you are using updateCloudToUseObjectStore api to add S3
> as a secondary store in your data center? To set up a data center using
> S3, you need to use addImageStore api.
>
> Thanks
> -min
>
>> On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>
>> I switch to provider=S3 but I get:
>>
>>> 530: Failed to add data store: DataCenter id is null, and simulator
>>> image store has to be associated with a data center
>>
>>
>>> On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com> wrote:
>>>
>>> As per the code the following are the supported image store provider
>>> types
>>>
>>> // constants for provider names
>>> static final String NFS_IMAGE = "NFS";
>>> static final String S3_IMAGE = "S3";
>>> static final String SWIFT_IMAGE = "Swift";
>>> static final String SAMPLE_IMAGE = "Sample";
>>> static final String SMB = "NFS";
>>> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>>>
>>> Try passing S3 in the provider.
>>> BTW when you setup simulator the image provider is NFS.
>>>
>>> -----Original Message-----
>>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>>> Sent: Thursday, 19 June 2014 5:08 PM
>>> To: dev@cloudstack.apache.org
>>> Subject: S3 use with simulator
>>>
>>> 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
>>>
>>> I am not sure if the arguments are right, has anyone done this before ?
>>>
>>> thanks,
>>>
>>> -sebastien
>
Re: S3 use with simulator
Posted by Min Chen <mi...@citrix.com>.
Hi Sebastien,
I am curious why you are using updateCloudToUseObjectStore api to add S3
as a secondary store in your data center? To set up a data center using
S3, you need to use addImageStore api.
Thanks
-min
On 6/20/14 7:47 AM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>I switch to provider=S3 but I get:
>
>> 530: Failed to add data store: DataCenter id is null, and simulator
>>image store has to be associated with a data center
>
>
>On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com> wrote:
>
>> As per the code the following are the supported image store provider
>>types
>>
>> // constants for provider names
>> static final String NFS_IMAGE = "NFS";
>> static final String S3_IMAGE = "S3";
>> static final String SWIFT_IMAGE = "Swift";
>> static final String SAMPLE_IMAGE = "Sample";
>> static final String SMB = "NFS";
>> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>>
>> Try passing S3 in the provider.
>> BTW when you setup simulator the image provider is NFS.
>>
>> -----Original Message-----
>> From: Sebastien Goasguen [mailto:runseb@gmail.com]
>> Sent: Thursday, 19 June 2014 5:08 PM
>> To: dev@cloudstack.apache.org
>> Subject: S3 use with simulator
>>
>> 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
>>
>> I am not sure if the arguments are right, has anyone done this before ?
>>
>> thanks,
>>
>> -sebastien
>
Re: S3 use with simulator
Posted by Sebastien Goasguen <ru...@gmail.com>.
I switch to provider=S3 but I get:
> 530: Failed to add data store: DataCenter id is null, and simulator image store has to be associated with a data center
On Jun 20, 2014, at 7:07 AM, Koushik Das <ko...@citrix.com> wrote:
> As per the code the following are the supported image store provider types
>
> // constants for provider names
> static final String NFS_IMAGE = "NFS";
> static final String S3_IMAGE = "S3";
> static final String SWIFT_IMAGE = "Swift";
> static final String SAMPLE_IMAGE = "Sample";
> static final String SMB = "NFS";
> static final String DEFAULT_PRIMARY = "DefaultPrimary";
>
> Try passing S3 in the provider.
> BTW when you setup simulator the image provider is NFS.
>
> -----Original Message-----
> From: Sebastien Goasguen [mailto:runseb@gmail.com]
> Sent: Thursday, 19 June 2014 5:08 PM
> To: dev@cloudstack.apache.org
> Subject: S3 use with simulator
>
> 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
>
> I am not sure if the arguments are right, has anyone done this before ?
>
> thanks,
>
> -sebastien
RE: S3 use with simulator
Posted by Koushik Das <ko...@citrix.com>.
As per the code the following are the supported image store provider types
// constants for provider names
static final String NFS_IMAGE = "NFS";
static final String S3_IMAGE = "S3";
static final String SWIFT_IMAGE = "Swift";
static final String SAMPLE_IMAGE = "Sample";
static final String SMB = "NFS";
static final String DEFAULT_PRIMARY = "DefaultPrimary";
Try passing S3 in the provider.
BTW when you setup simulator the image provider is NFS.
-----Original Message-----
From: Sebastien Goasguen [mailto:runseb@gmail.com]
Sent: Thursday, 19 June 2014 5:08 PM
To: dev@cloudstack.apache.org
Subject: S3 use with simulator
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
I am not sure if the arguments are right, has anyone done this before ?
thanks,
-sebastien
Re: S3 use with simulator
Posted by Rohit Yadav <bh...@apache.org>.
Hi Sebastien,
If you see the help doc's example it suggests how you pass in the URL. So,
you replace & with space and you run the following for any API that
needs to receive map arguments:
clodumonkey update cloudtouseobjectstore details[0].key=accesskey
details[0].value=valuex details[1].key=key2 details[1].value=valuey
`cloudmonkey` simply takes the args provided on the command line and joins
them using & to create a URL it requests (GET) to the management server.
The ACS ApiServer/Servlet does not handle multiple same named fields as
array (bug) and the way we handle maps is yet another ugly hack as the API
is query based (we cannot POST a json data for example, everything has be a
GET request with args as url query) and we're stuck with maintaining
backward compatibility.
The implementation differs (and used to differ a lot) for integration port
(8096) and normal authenticated server:
https://github.com/apache/cloudstack/blob/master/server/src/com/cloud/api/ApiServer.java#L493
(normal
handler)
https://github.com/apache/cloudstack/blob/master/server/src/com/cloud/api/ApiServer.java#L407
(integration
server handler)
Hope this helps.
Regards.
On Fri, Jun 20, 2014 at 2:11 PM, Sebastien Goasguen <ru...@gmail.com>
wrote:
> Adding Min,
>
> @Min, it looks like you wrote:
>
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Migration+of+NFS+Secondary+Storage+to+Object+Store
>
> Can you confirm that this api (updateCloudToObjectStore) can be tested
> using the simulator and an external S3 store ?
> Should this work on basic zones ?
>
> On Jun 19, 2014, at 7:37 AM, Sebastien Goasguen <ru...@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
> >
> > I am not sure if the arguments are right, has anyone done this before ?
> >
> > thanks,
> >
> > -sebastien
>
>
Re: S3 use with simulator
Posted by Sebastien Goasguen <ru...@gmail.com>.
Adding Min,
@Min, it looks like you wrote:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Migration+of+NFS+Secondary+Storage+to+Object+Store
Can you confirm that this api (updateCloudToObjectStore) can be tested using the simulator and an external S3 store ?
Should this work on basic zones ?
On Jun 19, 2014, at 7:37 AM, Sebastien Goasguen <ru...@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
>
> I am not sure if the arguments are right, has anyone done this before ?
>
> thanks,
>
> -sebastien
Re: S3 use with simulator
Posted by Rohit Yadav <bh...@apache.org>.
On Fri, Jun 20, 2014 at 3:33 PM, Sebastien Goasguen <ru...@gmail.com>
wrote:
>
>
> 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
> <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
> ========
>
>
That's good news.
>
> 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)
>
Looking at the code -- I think the storage manager implementation assumes
regional deployment when dcId is null, in which case we should ask Edison,
Mike and other storage ninjas who have knowledge about this. And, yes it
could be a case that simulator does not support storage stuff in which case
the code should have failed at later stages and not at
https://github.com/apache/cloudstack/blob/master/server/src/com/cloud/storage/StorageManagerImpl.java#L1723
Regards.
> 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
>
>
Re: S3 use with simulator
Posted by Sebastien Goasguen <ru...@gmail.com>.
On Jun 20, 2014, at 5:59 AM, Rohit Yadav <bh...@apache.org> wrote:
> On Thu, Jun 19, 2014 at 5:07 PM, Sebastien Goasguen <ru...@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
Re: S3 use with simulator
Posted by Rohit Yadav <bh...@apache.org>.
On Thu, Jun 19, 2014 at 5:07 PM, Sebastien Goasguen <ru...@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.
> I am not sure if the arguments are right, has anyone done this before ?
>
> thanks,
>
> -sebastien