Bug 1277335 - [RFE] Provide a functionality to reset cfme appliance.
[RFE] Provide a functionality to reset cfme appliance.
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance (Show other bugs)
x86_64 Linux
medium Severity medium
: GA
: 5.6.0
Assigned To: Nick Carboni
Nandini Chandra
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2015-11-03 00:38 EST by Prasad Mukhedkar
Modified: 2016-06-29 11:02 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
There was a feature request to provide a functionality to reset CFME appliance. This was because if something went wrong with the CFME appliance configuration, like choosing an incorrect database region, having a "master reset" function to reset a broken appliance to a "freshly installed" state would be beneficial rather than re-installing or creating a new appliance. With this release, a new option to reset configured database has been created in appliance_console.
Story Points: ---
Clone Of:
Last Closed: 2016-06-29 11:02:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Prasad Mukhedkar 2015-11-03 00:38:24 EST
Description of problem:

If something goes wrong with cfme appliance configuration, like choosing 
non intended database region etc, The only option left is reinstalling
the appliance or create new. Having a "master reset" function to reset
a broken appliance to a "freshly installed" state would very beneficial
in such situations.

Version-Release number of selected component (if applicable):
Comment 2 Nick Carboni 2016-02-29 09:32:21 EST
Does the "Setup Database Region" appliance_console option not do this?  It is my understanding that it will recreate the database region from scratch.
Comment 3 Prasad Mukhedkar 2016-03-08 05:33:56 EST
Nick, I doesnt work. If you try to setup database region on a appliance 
where database is already existed. It throws following error :

Initialize postgresql starting
Initialize postgresql failed with error - service exit code: 1.
See /var/www/miq/vmdb/log/appliance_console.log for details.

[----] I, [2016-03-08T05:23:45.901128 #30792:963994]  INFO -- : MIQ(ApplianceConsole::InternalDatabaseConfiguration#initialize_postgresql) : starting
[----] E, [2016-03-08T05:23:46.091776 #30792:963994] ERROR -- : MIQ(ApplianceConsole::InternalDatabaseConfiguration#initialize_postgresql)  Command failed: service exit code: 1. Error: Hint: the preferred way to do this is now "/opt/rh/rh-postgresql94/root/usr/bin/postgresql-setup --initdb --unit rh-postgresql94-postgresql"
 * Initializing database in '/var/opt/rh/rh-postgresql94/lib/pgsql/data'
ERROR: Data directory /var/opt/rh/rh-postgresql94/lib/pgsql/data is not empty!
ERROR: Initializing database failed, possibly see /var/lib/pgsql/initdb_rh-postgresql94-postgresql.log
. Output: . At: /var/www/miq/vmdb/gems/pending/appliance_console/internal_database_configuration.rb:160:in `run_initdb'

If you first drop the database and then try "Setup Database Region", It 
works but I think we should provide a out-of-box option to reset an appliance.
My be a command or something with all the warning in-place.
Comment 4 Nick Carboni 2016-03-08 08:32:58 EST
I was just able to do this on

1. Create database (appliance_console option 8 "Configure Database")
2. Allow application to start
3. Stop evm server (appliance_console option 13 "Stop EVM Server Processes")
4. Reset region (appliance_console option 7 "Setup Database Region")
5. Start evm server (appliance_console option 14 "Start EVM Server Processes")

After this all of the data created between step 1 and 3 will be removed in place of a clean seeded database with the region number specified in step 4.

Note: Step 1 and 4 are different options in the console, it looks like you may have tried to use option 8 ("Configure Database") when you should have used option 7 ("Setup Database Region")

Can you please try these steps and let me know if this is what you are looking for?

Comment 5 Nick Carboni 2016-03-18 17:37:06 EDT

This change should make the option more clear.
Comment 7 CFME Bot 2016-03-24 09:40:59 EDT
New commit detected on ManageIQ/manageiq/master:

commit d8ba11c35249d90c55e60b1bf80bd2991f2be83c
Author:     Nick Carboni <ncarboni@redhat.com>
AuthorDate: Wed Mar 16 16:57:07 2016 -0400
Commit:     Nick Carboni <ncarboni@redhat.com>
CommitDate: Wed Mar 23 08:57:12 2016 -0400

    Combine appliance console database options
    Add a new menu after database config which lists
    more descriptive options instead of traversing
    multiple question menus.

 gems/pending/appliance_console.rb                  | 95 ++++++++++------------
 .../appliance_console/database_configuration.rb    | 13 ++-
 .../external_database_configuration.rb             | 12 +--
 .../internal_database_configuration.rb             | 11 +++
 gems/pending/appliance_console/locales/en.yml      |  2 -
 .../database_configuration_spec.rb                 |  2 +
 6 files changed, 73 insertions(+), 62 deletions(-)
Comment 8 CFME Bot 2016-03-24 09:41:03 EDT
New commit detected on ManageIQ/manageiq/master:

commit 8e17c5168d2ace7673832302a219d409e303545f
Author:     Nick Carboni <ncarboni@redhat.com>
AuthorDate: Tue Mar 22 09:51:40 2016 -0400
Commit:     Nick Carboni <ncarboni@redhat.com>
CommitDate: Wed Mar 23 08:57:12 2016 -0400

    Create interactive method for configuring a database

 gems/pending/appliance_console.rb                  | 33 +++++-----------------
 .../appliance_console/database_configuration.rb    | 16 +++++++++++
 2 files changed, 23 insertions(+), 26 deletions(-)
Comment 9 Nandini Chandra 2016-04-21 19:45:43 EDT
Verified in 5.6 Beta 2
Comment 11 errata-xmlrpc 2016-06-29 11:02:06 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.