Red Hat Bugzilla – Bug 1277335
[RFE] Provide a functionality to reset cfme appliance.
Last modified: 2016-06-29 11:02:06 EDT
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): 5.4.3
Does the "Setup Database Region" appliance_console option not do this? It is my understanding that it will recreate the database region from scratch.
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.
I was just able to do this on 5.5.2.4 Steps: 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? Thanks
https://github.com/ManageIQ/manageiq/pull/7407 This change should make the option more clear.
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/d8ba11c35249d90c55e60b1bf80bd2991f2be83c 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. https://bugzilla.redhat.com/show_bug.cgi?id=1277335 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(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/8e17c5168d2ace7673832302a219d409e303545f 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 https://bugzilla.redhat.com/show_bug.cgi?id=1277335 gems/pending/appliance_console.rb | 33 +++++----------------- .../appliance_console/database_configuration.rb | 16 +++++++++++ 2 files changed, 23 insertions(+), 26 deletions(-)
Verified in 5.6 Beta 2
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. https://access.redhat.com/errata/RHBA-2016:1348