You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Syed Ahmed <sa...@cloudops.com> on 2016/11/04 19:29:00 UTC

Adding a Config value to Cloudstack

Hi Guys,

I've been trying to add a new global config to Cloudstack. I've been
following the instructions mentioned at
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration but
when I reinstall my Cloudstack, I don't see the setting in the
configuration table in Cloudstack. Does anyone has experience in adding
Config values?

Thanks,
-Syed

Re: Adding a Config value to Cloudstack

Posted by Syed Ahmed <sa...@cloudops.com>.
Kaushik,

I believe that was an evironmental issue. I am setting up my cloudstack
again on a different server. If I run into this problem again. I will
report back.

On Wed, Nov 9, 2016 at 1:59 AM, Koushik Das <ko...@accelerite.com>
wrote:

> Please share the code/PR if possible.
>
> From: Syed Ahmed <sa...@cloudops.com>
> Reply-To: "dev@cloudstack.apache.org" <de...@cloudstack.apache.org>
> Date: Tuesday, 8 November 2016 at 10:49 PM
> To: "dev@cloudstack.apache.org" <de...@cloudstack.apache.org>
> Subject: Re: Adding a Config value to Cloudstack
>
> Yes init is destructive. Unfortunately it was the only option that I had.
> Since it was a Dev env it was mostly fine.
> On Tue, Nov 8, 2016 at 10:37 AM Linas Žilinskas <linas@host1plus.com
> <ma...@host1plus.com>> wrote:
>
> Be careful with setting the init to false. It does lot more than just
> adding new configs. I've found out that the hard way.
>
> At least on our multiple deployments, the default networks were recreated
> and user_ip_address table had duplicated ips in them, which i had to remove
> manually. Not sure if anything else is (un)affected. Didn't had the time to
> review what the 'init' actually does.
>
> On 2016-11-04 20:09, Syed Ahmed wrote:
>
> Yes, I've done exactly what you've shown here Nicolas, make the class
>
> implement Configurable, add the getConfigKeys and created the Param.
>
> However when I reinstall Cloudstack, the startup does not seem to pick up
>
> the newly added config.
>
>
>
> As a workaround, I had to reset the "init" value as "false" in the
>
> configuration table for Cloudstack to re-read the config keys. Not the
>
> best  solution.
>
>
>
> On Fri, Nov 4, 2016 at 3:58 PM, Nicolás Vázquez <ni...@gmail.com><
> mailto:nicovazquez90@gmail.com>
>
> wrote:
>
>
>
> Hi Syed,
>
>
>
> You can do it using ConfigKey class
>
> (org.apache.cloudstack.framework.config.ConfigKey)
>
> like this:
>
>
>
>    - Define your new configuration as a variable in a class that implements
>
>    Configurable (org.apache.cloudstack.framework.config.Configurable)
>
> using
>
>    ConfigKey constructor in which you provide type, name, description,
>
> scope.
>
>    etc.
>
>    - Add your new configuration variable to getConfigKeys() return array
>
>
>
> You can also check at this link where I had added 2 configurations on
>
> VmwareGuru class:
>
> https://github.com/apache/cloudstack/pull/1542/commits/
>
> 8deb7dfc68380cfdca0eabd3cee831b8952915f3
>
>
>
> Hope this helps ;)
>
>
>
> Nicolas
>
>
>
> 2016-11-04 16:29 GMT-03:00 Syed Ahmed <sa...@cloudops.com><mailto:s
> ahmed@cloudops.com>:
>
>
>
> Hi Guys,
>
>
>
> I've been trying to add a new global config to Cloudstack. I've been
>
> following the instructions mentioned at
>
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration but
>
> when I reinstall my Cloudstack, I don't see the setting in the
>
> configuration table in Cloudstack. Does anyone has experience in adding
>
> Config values?
>
>
>
> Thanks,
>
> -Syed
>
>
>
> Linas Žilinskas
> Head of Development
> [cid:part1.F817C421.254B1E7F@host1plus.com]
> website<http://www.host1plus.com/> facebook<https://www.facebook.
> com/Host1Plus> twitter<https://twitter.com/Host1Plus> linkedin<
> https://www.linkedin.com/company/digital-energy-technologies-ltd.>
>
> Host1Plus is a division of Digital Energy Technologies Ltd.
>
> 26 York Street, London W1U 6PZ, United Kingdom
>
>
>
>
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Accelerite, a Persistent Systems business. It is intended
> only for the use of the individual or entity to which it is addressed. If
> you are not the intended recipient, you are not authorized to read, retain,
> copy, print, distribute or use this message. If you have received this
> communication in error, please notify the sender and delete all copies of
> this message. Accelerite, a Persistent Systems business does not accept any
> liability for virus infected mails.
>

Re: Adding a Config value to Cloudstack

Posted by Koushik Das <ko...@accelerite.com>.
Please share the code/PR if possible.

From: Syed Ahmed <sa...@cloudops.com>
Reply-To: "dev@cloudstack.apache.org" <de...@cloudstack.apache.org>
Date: Tuesday, 8 November 2016 at 10:49 PM
To: "dev@cloudstack.apache.org" <de...@cloudstack.apache.org>
Subject: Re: Adding a Config value to Cloudstack

Yes init is destructive. Unfortunately it was the only option that I had. Since it was a Dev env it was mostly fine.
On Tue, Nov 8, 2016 at 10:37 AM Linas Žilinskas <li...@host1plus.com>> wrote:

Be careful with setting the init to false. It does lot more than just adding new configs. I've found out that the hard way.

At least on our multiple deployments, the default networks were recreated and user_ip_address table had duplicated ips in them, which i had to remove manually. Not sure if anything else is (un)affected. Didn't had the time to review what the 'init' actually does.

On 2016-11-04 20:09, Syed Ahmed wrote:

Yes, I've done exactly what you've shown here Nicolas, make the class

implement Configurable, add the getConfigKeys and created the Param.

However when I reinstall Cloudstack, the startup does not seem to pick up

the newly added config.



As a workaround, I had to reset the "init" value as "false" in the

configuration table for Cloudstack to re-read the config keys. Not the

best  solution.



On Fri, Nov 4, 2016 at 3:58 PM, Nicolás Vázquez <ni...@gmail.com>

wrote:



Hi Syed,



You can do it using ConfigKey class

(org.apache.cloudstack.framework.config.ConfigKey)

like this:



   - Define your new configuration as a variable in a class that implements

   Configurable (org.apache.cloudstack.framework.config.Configurable)

using

   ConfigKey constructor in which you provide type, name, description,

scope.

   etc.

   - Add your new configuration variable to getConfigKeys() return array



You can also check at this link where I had added 2 configurations on

VmwareGuru class:

https://github.com/apache/cloudstack/pull/1542/commits/

8deb7dfc68380cfdca0eabd3cee831b8952915f3



Hope this helps ;)



Nicolas



2016-11-04 16:29 GMT-03:00 Syed Ahmed <sa...@cloudops.com>:



Hi Guys,



I've been trying to add a new global config to Cloudstack. I've been

following the instructions mentioned at

https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration but

when I reinstall my Cloudstack, I don't see the setting in the

configuration table in Cloudstack. Does anyone has experience in adding

Config values?



Thanks,

-Syed



Linas Žilinskas
Head of Development
[cid:part1.F817C421.254B1E7F@host1plus.com]
website<http://www.host1plus.com/> facebook<https://www.facebook.com/Host1Plus> twitter<https://twitter.com/Host1Plus> linkedin<https://www.linkedin.com/company/digital-energy-technologies-ltd.>

Host1Plus is a division of Digital Energy Technologies Ltd.

26 York Street, London W1U 6PZ, United Kingdom





DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Accelerite, a Persistent Systems business. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Accelerite, a Persistent Systems business does not accept any liability for virus infected mails.

Re: Adding a Config value to Cloudstack

Posted by Syed Ahmed <sa...@cloudops.com>.
Yes init is destructive. Unfortunately it was the only option that I had.
Since it was a Dev env it was mostly fine.
On Tue, Nov 8, 2016 at 10:37 AM Linas Žilinskas <li...@host1plus.com> wrote:

> Be careful with setting the init to false. It does lot more than just
> adding new configs. I've found out that the hard way.
>
> At least on our multiple deployments, the default networks were recreated
> and user_ip_address table had duplicated ips in them, which i had to remove
> manually. Not sure if anything else is (un)affected. Didn't had the time to
> review what the 'init' actually does.
>
> On 2016-11-04 20:09, Syed Ahmed wrote:
>
> Yes, I've done exactly what you've shown here Nicolas, make the class
> implement Configurable, add the getConfigKeys and created the Param.
> However when I reinstall Cloudstack, the startup does not seem to pick up
> the newly added config.
>
> As a workaround, I had to reset the "init" value as "false" in the
> configuration table for Cloudstack to re-read the config keys. Not the
> best  solution.
>
> On Fri, Nov 4, 2016 at 3:58 PM, Nicolás Vázquez <ni...@gmail.com> <ni...@gmail.com>
> wrote:
>
>
> Hi Syed,
>
> You can do it using ConfigKey class
> (org.apache.cloudstack.framework.config.ConfigKey)
> like this:
>
>    - Define your new configuration as a variable in a class that implements
>    Configurable (org.apache.cloudstack.framework.config.Configurable)
> using
>    ConfigKey constructor in which you provide type, name, description,
> scope.
>    etc.
>    - Add your new configuration variable to getConfigKeys() return array
>
> You can also check at this link where I had added 2 configurations on
> VmwareGuru class:https://github.com/apache/cloudstack/pull/1542/commits/
> 8deb7dfc68380cfdca0eabd3cee831b8952915f3
>
> Hope this helps ;)
>
> Nicolas
>
> 2016-11-04 16:29 GMT-03:00 Syed Ahmed <sa...@cloudops.com> <sa...@cloudops.com>:
>
>
> Hi Guys,
>
> I've been trying to add a new global config to Cloudstack. I've been
> following the instructions mentioned athttps://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration but
> when I reinstall my Cloudstack, I don't see the setting in the
> configuration table in Cloudstack. Does anyone has experience in adding
> Config values?
>
> Thanks,
> -Syed
>
>
>
> Linas Žilinskas
> Head of Development
> website <http://www.host1plus.com/> facebook
> <https://www.facebook.com/Host1Plus> twitter
> <https://twitter.com/Host1Plus> linkedin
> <https://www.linkedin.com/company/digital-energy-technologies-ltd.>
>
> Host1Plus is a division of Digital Energy Technologies Ltd.
>
> 26 York Street, London W1U 6PZ, United Kingdom
>
>
>

Re: Adding a Config value to Cloudstack

Posted by Linas Žilinskas <li...@host1plus.com>.
Be careful with setting the init to false. It does lot more than just 
adding new configs. I've found out that the hard way.

At least on our multiple deployments, the default networks were 
recreated and user_ip_address table had duplicated ips in them, which i 
had to remove manually. Not sure if anything else is (un)affected. 
Didn't had the time to review what the 'init' actually does.


On 2016-11-04 20:09, Syed Ahmed wrote:
> Yes, I've done exactly what you've shown here Nicolas, make the class
> implement Configurable, add the getConfigKeys and created the Param.
> However when I reinstall Cloudstack, the startup does not seem to pick up
> the newly added config.
>
> As a workaround, I had to reset the "init" value as "false" in the
> configuration table for Cloudstack to re-read the config keys. Not the
> best  solution.
>
> On Fri, Nov 4, 2016 at 3:58 PM, Nicol�s V�zquez <ni...@gmail.com>
> wrote:
>
>> Hi Syed,
>>
>> You can do it using ConfigKey class
>> (org.apache.cloudstack.framework.config.ConfigKey)
>> like this:
>>
>>     - Define your new configuration as a variable in a class that implements
>>     Configurable (org.apache.cloudstack.framework.config.Configurable)
>> using
>>     ConfigKey constructor in which you provide type, name, description,
>> scope.
>>     etc.
>>     - Add your new configuration variable to getConfigKeys() return array
>>
>> You can also check at this link where I had added 2 configurations on
>> VmwareGuru class:
>> https://github.com/apache/cloudstack/pull/1542/commits/
>> 8deb7dfc68380cfdca0eabd3cee831b8952915f3
>>
>> Hope this helps ;)
>>
>> Nicolas
>>
>> 2016-11-04 16:29 GMT-03:00 Syed Ahmed <sa...@cloudops.com>:
>>
>>> Hi Guys,
>>>
>>> I've been trying to add a new global config to Cloudstack. I've been
>>> following the instructions mentioned at
>>> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration but
>>> when I reinstall my Cloudstack, I don't see the setting in the
>>> configuration table in Cloudstack. Does anyone has experience in adding
>>> Config values?
>>>
>>> Thanks,
>>> -Syed
>>>

Linas \u017dilinskas
Head of Development
website <http://www.host1plus.com/> facebook 
<https://www.facebook.com/Host1Plus> twitter 
<https://twitter.com/Host1Plus> linkedin 
<https://www.linkedin.com/company/digital-energy-technologies-ltd.>

Host1Plus is a division of Digital Energy Technologies Ltd.

26 York Street, London W1U 6PZ, United Kingdom


Re: Adding a Config value to Cloudstack

Posted by Jeff Hair <je...@greenqloud.com>.
You pretty much have to insert it manually. You need to either make a
database migration for it, or just run a query for insert. We've run into
similar problems on our own fork, and our solution was to ensure all config
values get created on startup. This is the code we used to do it:
https://github.com/greenqloud/cloudstack/commit/fa534ea9ce19db6ce4335aede2d9482d8c9b180f

*Jeff Hair*
Technical Lead and Software Developer

Tel: (+354) 415 0200
jeff@greenqloud.com
www.greenqloud.com

On Fri, Nov 4, 2016 at 8:09 PM, Syed Ahmed <sa...@cloudops.com> wrote:

> Yes, I've done exactly what you've shown here Nicolas, make the class
> implement Configurable, add the getConfigKeys and created the Param.
> However when I reinstall Cloudstack, the startup does not seem to pick up
> the newly added config.
>
> As a workaround, I had to reset the "init" value as "false" in the
> configuration table for Cloudstack to re-read the config keys. Not the
> best  solution.
>
> On Fri, Nov 4, 2016 at 3:58 PM, Nicolás Vázquez <ni...@gmail.com>
> wrote:
>
> > Hi Syed,
> >
> > You can do it using ConfigKey class
> > (org.apache.cloudstack.framework.config.ConfigKey)
> > like this:
> >
> >    - Define your new configuration as a variable in a class that
> implements
> >    Configurable (org.apache.cloudstack.framework.config.Configurable)
> > using
> >    ConfigKey constructor in which you provide type, name, description,
> > scope.
> >    etc.
> >    - Add your new configuration variable to getConfigKeys() return array
> >
> > You can also check at this link where I had added 2 configurations on
> > VmwareGuru class:
> > https://github.com/apache/cloudstack/pull/1542/commits/
> > 8deb7dfc68380cfdca0eabd3cee831b8952915f3
> >
> > Hope this helps ;)
> >
> > Nicolas
> >
> > 2016-11-04 16:29 GMT-03:00 Syed Ahmed <sa...@cloudops.com>:
> >
> > > Hi Guys,
> > >
> > > I've been trying to add a new global config to Cloudstack. I've been
> > > following the instructions mentioned at
> > > https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration
> but
> > > when I reinstall my Cloudstack, I don't see the setting in the
> > > configuration table in Cloudstack. Does anyone has experience in adding
> > > Config values?
> > >
> > > Thanks,
> > > -Syed
> > >
> >
>

Re: Adding a Config value to Cloudstack

Posted by Syed Ahmed <sa...@cloudops.com>.
Yes, I've done exactly what you've shown here Nicolas, make the class
implement Configurable, add the getConfigKeys and created the Param.
However when I reinstall Cloudstack, the startup does not seem to pick up
the newly added config.

As a workaround, I had to reset the "init" value as "false" in the
configuration table for Cloudstack to re-read the config keys. Not the
best  solution.

On Fri, Nov 4, 2016 at 3:58 PM, Nicolás Vázquez <ni...@gmail.com>
wrote:

> Hi Syed,
>
> You can do it using ConfigKey class
> (org.apache.cloudstack.framework.config.ConfigKey)
> like this:
>
>    - Define your new configuration as a variable in a class that implements
>    Configurable (org.apache.cloudstack.framework.config.Configurable)
> using
>    ConfigKey constructor in which you provide type, name, description,
> scope.
>    etc.
>    - Add your new configuration variable to getConfigKeys() return array
>
> You can also check at this link where I had added 2 configurations on
> VmwareGuru class:
> https://github.com/apache/cloudstack/pull/1542/commits/
> 8deb7dfc68380cfdca0eabd3cee831b8952915f3
>
> Hope this helps ;)
>
> Nicolas
>
> 2016-11-04 16:29 GMT-03:00 Syed Ahmed <sa...@cloudops.com>:
>
> > Hi Guys,
> >
> > I've been trying to add a new global config to Cloudstack. I've been
> > following the instructions mentioned at
> > https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration but
> > when I reinstall my Cloudstack, I don't see the setting in the
> > configuration table in Cloudstack. Does anyone has experience in adding
> > Config values?
> >
> > Thanks,
> > -Syed
> >
>

Re: Adding a Config value to Cloudstack

Posted by Nicolás Vázquez <ni...@gmail.com>.
Hi Syed,

You can do it using ConfigKey class
(org.apache.cloudstack.framework.config.ConfigKey)
like this:

   - Define your new configuration as a variable in a class that implements
   Configurable (org.apache.cloudstack.framework.config.Configurable) using
   ConfigKey constructor in which you provide type, name, description, scope.
   etc.
   - Add your new configuration variable to getConfigKeys() return array

You can also check at this link where I had added 2 configurations on
VmwareGuru class:
https://github.com/apache/cloudstack/pull/1542/commits/8deb7dfc68380cfdca0eabd3cee831b8952915f3

Hope this helps ;)

Nicolas

2016-11-04 16:29 GMT-03:00 Syed Ahmed <sa...@cloudops.com>:

> Hi Guys,
>
> I've been trying to add a new global config to Cloudstack. I've been
> following the instructions mentioned at
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration but
> when I reinstall my Cloudstack, I don't see the setting in the
> configuration table in Cloudstack. Does anyone has experience in adding
> Config values?
>
> Thanks,
> -Syed
>