-
Notifications
You must be signed in to change notification settings - Fork 125
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
Create Physical Disks migration #233
Conversation
2ee4e7f
to
074346d
Compare
074346d
to
d6d82f5
Compare
@agrare Please review. |
@EsdrasVP what is a storage driver exactly in this context? Can you give some examples? |
@agrare A storage driver is a disk driver inside a physical storage. It has its own health state (being something like: "Ok" or "Degraded"), size, model, serial number, etc. Initially I thought making Physical Storages have Storages as guest devices, since it is an existing component in ManageIQ, but I noticed they are way more complex than this ones. What do you think of this? We should still consider it as a Storage even when it have less information? |
@EsdrasVP So is it a physical disk drive, a group of drives on a controller, a LUN, a single read/write head? "A storage driver is a disk driver inside a physical storage" is still a little vague. |
Okay thanks, I don't want to spend too much time on a name but IMO |
@EsdrasVP offline corrected me that a "storage_drive" is actually a single disk, so I proposed "physical_disks" as the table name |
d6d82f5
to
9cecb47
Compare
@agrare Are the changes ok now? |
@@ -0,0 +1,5 @@ | |||
class AddPortStatusToPhysicalNetworkPorts < ActiveRecord::Migration[5.0] | |||
def change | |||
add_column :physical_network_ports, :port_status, :string |
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.
Is this related to this change or did this just sneak in?
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.
Sorry for it, this should be in another PR of mine. I'm removing it from here.
9cecb47
to
b9d0c07
Compare
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.
LGTM
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.
👍
ping @Fryguy |
@EsdrasVP can you add an index for |
Is this significantly different from the existing Disk model? |
b9d0c07
to
e139888
Compare
Checked commit EsdrasVP@e139888 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 db/migrate/20180726142030_create_physical_disk.rb
|
@bdunne a lot/most of the properties in the Disk model only apply to virtual/cloud envs:
Plus Storage and PhysicalStorage are already two different things for similar reasons. |
t.index :location | ||
t.string :serial_number | ||
t.string :health_state | ||
t.string :type |
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.
@EsdrasVP what is this type
column? It seems it's not related to definition of STI subclass, but some custom value...
When I ran specs, there is for example "SAS" value
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.
Good catch @slemrmartin. @agrare ?
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.
Ah you're right I assumed it was going to be used for STI. We'll need to rename this something like disk_type or actually do STI
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.
Ah you're right I assumed it was going to be used for STI. We'll need to rename this something like disk_type or actually do STI
I think we can go for disk_type
then, since this has nothing to do with existing STI classes.
This PR is able to: