Bug 1414307 - Changes in server attributes in the Rails Console are not persistent
Summary: Changes in server attributes in the Rails Console are not persistent
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.7.0
Hardware: Unspecified
OS: Linux
medium
high
Target Milestone: GA
: cfme-future
Assignee: Gregg Tanzillo
QA Contact: Dave Johnson
URL:
Whiteboard: appliance:server_role
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-18 09:33 UTC by Krain Arnold
Modified: 2017-12-05 15:41 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-02 16:03:04 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Krain Arnold 2017-01-18 09:33:53 UTC
Description of problem:
Changes to server attributes in the rails console do not persist through evmserverd restarts, and take no effect on the appliance. An example of why this would be useful is if someone has turned on the UI role on a standalone appliance and needs to enable it again.

Version-Release number of selected component (if applicable):
5.7.0.17.20161219135818_725f92f

How reproducible:
100%

Steps to Reproduce:
1. Navigate to the rails console
2. change a server role (either by executing MiqServer.my_server.update_attributes(:name => 'testname') or MiqServer.my_server.name="testname"
3.Execute MiqServer.my_server.save
4. View the new value by executing MiqServer.my_server.name, the value "testname" is shown. Exit the rails console and start a new session. The value persists rails console sessions.
5. The value does not change in the configuration menu in the UI, and no record of the change is made in evm.log
6. Restart the cloudforms process with either rake evm:restart or systemctl restart evmserverd
7. Inspect the value of the changed variable in both the UI and the rails console.

Actual results:
The value has reverted back to the previous value.

Expected results:
Changing the value in the rails console should actually change the value.

Additional info:
talk.manageiq question on this is available here for reference: http://talk.manageiq.org/t/persistently-change-server-attributes-in-the-rails-console/2034

Comment 2 Yuri Rudman 2017-06-02 16:03:04 UTC
There is PR: https://github.com/ManageIQ/manageiq/pull/11204 introducing script to update settings:tools/configure_server_settings.rb. You can grab configure_server_settings.rb from PR, let us know if it is working for you.
Also, there is direct way to add role to server: MiqServer.my_server(true).assign_role("user_interface").


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