-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Physical Server details #14275
Physical Server details #14275
Conversation
@blomquisg @juliancheal @rodneyhbrown7 Can you guys comment about the properties data types which has comments? |
Which editors do you use? Some like Atom & Sublime (I think) can run Rubocop inline. Also might be worth if your editor can't run Rubocop using https://github.com/m4i/rubocop-git to just run Rubocop on the diffs. Might save having to do a second commit to remove things like the extra space above. 🍰 |
Actually thinking about it, I'm not sure if these details should be in PhysicalServer as looking at their data types some of them should probably be Also are I'm looking to see if we have existing tables these details can be stored in, or if we should extract it to a separate table. As I imagine if we in the future create tables like Is this data already in XClarity? How much of this do we need to store in ManageIQ? Things like if a server requires maintenance, a warning might come from ManageIQ, but a technician would could get that data via an API call to XClairty, or the XClairty app? |
I had a thought about creating a separate tables for contact information and maybe a second one for location details. The description is meant to be more of a free form string the user can use to provide additional information about the server, location is typically the location of the rack and may be an address, the rack-name identifies the rack at that location. These details are availabe in Xclarity today. One of the automations/services that we might include is to identify failing hardware, relocate vms and then notify an admin that hardware requires attention. I will also note that some of the location details may be related to Region/Zone information. |
@rodneyhbrown7 @juliancheal the VM has a column named location, so I think the location should be in physical_servers table or we can add a table containing only three columns(id, location and room_id) instead. About the support_contact the XClarity REST API has a string property named "contact", I think don't sonds good create a table to save only two columns(ID and support_contact). About the rack informations, are you sure that it should be an other table? So, there are only three columns in this table(id, rack_name and lowest_rack_unit), right? For now I'll remove this columns from migration and I will let only description and contact in migration. Once you guys answer, I do the other changes. |
We discussed this offline, and we decided that instead of creating two tables, we'll create a single new table, named assets, that contains: description, location, room_id, rack_name, and lowest_rack_unit. |
@walteraa Just a suggestion, if you have time, consider changing assets_details to asset_details |
For sure, @skovic |
@walteraa can you clean up the rubocop messages? |
This pull request is not mergeable. Please rebase and repush. |
@@ -0,0 +1,5 @@ | |||
class AddAssetsDetailsRefToPhysicalServer < ActiveRecord::Migration[5.0] | |||
def change | |||
add_reference :physical_servers, :asset_details, index: true, foreign_key: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things here:
- Remove the
foreign_key
constraint - add
type: :bigint
Also, @Fryguy will probably be happier if you use Hash Rockets instead. I.e.,
add_reference :physical_servers, :asset_details, :index => true, :type => :bigint
t.text :location | ||
t.text :room | ||
t.text :rack_name | ||
t.text :lowest_rack_unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure this is needed, but you might want to add t.timestamps
to this table to track created and last updated dates.
I should to change the ref between asset details and Physical server. |
Add a migration to create asset_details table.
Add properties to schema.yml referring to the new table(asset_details).
@blomquisg Can you review this PR and #14827, #14749 as well? |
t.bigint :resource_id | ||
t.string :resource_type | ||
t.timestamps | ||
t.index %w(resource_id resource_type), :name => "index_asset_details_on_resource_id_and_resource_type", :using => :btree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not need the name
nor using
, as Rails will default those properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one comment on the index, but otherwise LGTM
LGTM 👍 |
Remove 'name' and 'using' from asset details index.
Checked commits https://github.com/lenovo/manageiq/compare/7069f6134f686c68d626faf2d10ded50c1a0cb7a~...33eecf1231055ea139a6148703969d04f2c7131a with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
🎂🎂 |
This PR contains a migration to add the follow informations in physical server table:
Support contact: String
Description: String
Location: String
Room ID: String (I am not sure if this information can be a String or a Integer)
Rack name: String
Lowest rack unit: String (I am not sure about this data)