futuregrid / cloud-metrics

Project to create usage statistics from IaaS such as OpenStack, Eucalyptus, and Nimbus
2 stars 3 forks source link

Installation script for db setup (fg-metric-install) #110

Open lee212 opened 11 years ago

lee212 commented 11 years ago

Installation script would help to initialize MySQL database and a futuregrid.cfg configuration file.

$ fg-metric-install
==========================================
Installing Cloud Metrics ...
==========================================

If you have installed mysql database for Cloud Metrics,
you will be asked to type the database information.

---------------------------------------------------
mysql database info
---------------------------------------------------
1. db host ip address: <type ip address>
2. db port (default: 3306): <type port number or enter>
3. db username: <type username>
4. db password: <type password>
5. db name: <type dbname>

... creating $HOME/.futuregrid/futuregrid.cfg file ...
... database information successfully saved. ...

----------------------------------------------------
MySQL table creation
----------------------------------------------------
... creating MySQL tables for Cloud Metrics ...
... instance table created ...
... userinfo table created ...
... projectinfo table created ...
... cloudplatform table created ...

MySQL database setup successfully done.

Q1. When does this script need? At the first time use of Cloud Metrics, you need setup database information. Once you installed Cloud Metrics using pip install futuregrid-cloud-metric, you can setup database by fg-metric-install shell executable.

Q2. Why is this step required? Cloud Metric supports cloud usage analysis based on the data on database. You can not perform any analysis and get statistics without configuring database information.

laszewsk commented 11 years ago

what about just do the configuration in a yaml file and excluding the passwd that is than asked for.

e.g. -f config.yaml

cloud-metric:

database: host: ... port: ... username: .... password: input name: ...

note i put input as password which would result in prompting it . maybe same can applied with other fields.

maybe -o specifies where to store the output file ...

On Mar 23, 2013, at 5:04 PM, lee212 notifications@github.com wrote:

Installation script would help to initialize MySQL database and a futuregrid.cfg configuration file.

$ fg-metric-install

Installing Cloud Metrics ...

If you have installed mysql database for Cloud Metrics, you will be asked to type the database information.


mysql database info

  1. db host ip address:
  2. db port (default: 3306):
  3. db username:
  4. db password:
  5. db name:

... creating $HOME/.futuregrid/futuregrid.cfg file ... ... database information successfully saved. ...


MySQL table creation

... creating MySQL tables for Cloud Metrics ... ... instance table created ... ... userinfo table created ... ... projectinfo table created ... ... cloudplatform table created ...

MySQL database setup successfully done. Q1. When does this script need? At the first time use of Cloud Metrics, you need setup database information. Once you installed Cloud Metrics using pip install futuregrid-cloud-metric, you can setup database by fg-metric-install shell executable.

Q2. Why is this step required? Cloud Metric supports cloud usage analysis based on the data on database. You can not perform any analysis and get statistics without configuring database information.

— Reply to this email directly or view it on GitHub.

lee212 commented 11 years ago

getpass.getpass() prompts the user for a password without echoing. http://docs.python.org/2/library/getpass.html