cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yiping Zhang <yzh...@marketo.com>
Subject Re: cloudmonkey config file get reset to default settings
Date Thu, 26 May 2016 16:57:59 GMT
In my case, we have scripts running by Puppet,  and crond hourly, and by Nagios (once every
5 min, I think), all by root user or sudo to root user (in case of Nagios).  In most of our
scripts, we call “set display default” first. Only occasionally , admins would login and
manually run cloudmonkey with sudo.

As for the config file, we have puppet manage it to make sure that our apikey/secretkey, and
logfile location are set correctly. 

IMHO,  set command should NOT automatically save current settings to disk.  For interactive
use, set should just changes settings for current session, an explicit save cmd could persist
the changes to the disk. For CLI use, each call to cloudmonkey is its own session, therefore,
the user is better to have all correct settings in the config file to begin with.  

Thanks,
Yiping

On 5/25/16, 10:58 PM, "Rohit Yadav" <rohit.yadav@shapeblue.com> wrote:

>Correction from previous reply:
>
>"I'll see what I can do, in general you should NOT be replacing or changing the cloudmonkey
config file outside of cloudmonkey itself."
>
>Regards,
>Rohit Yadav
>
>
>rohit.yadav@shapeblue.com 
>www.shapeblue.com
>53 Chandos Place, Covent Garden, London  WC2N 4HSUK
>@shapeblue
>
>
>On May 26 2016, at 11:27 am, Rohit Yadav <rohit.yadav@shapeblue.com> wrote:
>Whenever a set command is called, it would save/update the config file. When you run set
profile xyz; it needs to make that profile the default profile and update other parameters
associated with the profile which may be set as well (such as url, username, password, apikey,
secretkey etc). When cloudmonkey is running, and you replace the config file; on calling 'set'
it would save the config file based on its in-memory config dictionary.
>
>I'll see what I can do, in general you should be replacing or changing the cloudmonkey
config file outside of cloudmonkey itself. If you want to create new profile, set new rules;
you should call cloudmonkey set <option> <values> either on command line or use
puppet to execute them. The tool was intended for single user, in case of multi-user or concurrent
usage, there is no concurrency control wrt configs.
>
>One solution could be that, each server profile has their own config file instead of a
single config file, and you can start cloudmonkey to pick a server profile with a command
line flag such as -p <profile>. I'll see how I may improve this, for this I would like
to know how exactly you are using puppet or any other automation?
>
>Regards,
>Rohit Yadav
>
>On May 26 2016, at 3:40 am, ilya <ilya.mailing.lists@gmail.com> wrote:
>
>I've seen the similar behaviour.
>
>For some reason cloudmonkey try to persist the configs each time your
>run something.
>
>If i open cloudmonkey in multiple terminals and use different profiles
>and execute commands in mutliple terminals in parallel - i've seen
>cloudmonkey mess up the config for one of open profiles.
>
>Specifically, the URL of cloudstack in profile1 might be changed with
>url of cloudstack in profile2.
>
>Rohit, is there a reason why cloudmonkey tries to update the settings in
>config file each time something gets executed?
>
>On 5/24/16 1:31 PM, Yiping Zhang wrote:
>> Hi,
>>
>> We have a few scripts that use cloudmonkey to talk to CloudStack server. The scripts
are invoked by Puppet once per hour.
>>
>> However, every once a while, the /root/.cloudmonkey/config file would be over written
with default settings. That is, blank apikey/secretkey, default password, default log file
location etc.
>>
>> I am wondering by any chance that cloudmonkey would put a default config file in
place for some reason ?
>>
>> Thanks,
>>
>> Yiping
>>

Mime
View raw message