Allow detecting if the disk is a SSD or HDD#28
Conversation
Signed-off-by: Saurabh Badhwar <sbadhwar@redhat.com>
jhutar
left a comment
There was a problem hiding this comment.
What about to ignore detection part and have simple and documented role instead?
| msg: "Checking if the disk {{ satellite_physical_disk }} is SSD" | ||
| - name: Retrieve the contents of the disk | ||
| shell: | ||
| cat "/sys/block/{{ satellite_physical_disk }}/queue/rotational |
| msg: "Checking if the disk {{ satellite_physical_disk }} is SSD" | ||
| - name: Retrieve the contents of the disk | ||
| shell: | ||
| cat "/sys/block/{{ satellite_physical_disk }}/queue/rotational |
There was a problem hiding this comment.
Given a default, this would expand into "/sys/block//dev/sda/queue/rotational" and that does not seems right
There was a problem hiding this comment.
@jhutar I am a little bit confused here on which approach to take:
- We can have a default disk set in the configuration, but that may cause mis-representation of facts if the user does not take care while running the tune utility.
- We can have this variable set to a blank value and we can check in playbook, if the variable is blank, then don't run this detection, otherwise run this detection mechanism
| @@ -0,0 +1,3 @@ | |||
| --- | |||
| satellite_physical_disk: /dev/sda | |||
There was a problem hiding this comment.
Can we autodetect this? In lots of cases this will be on LVM and mounted from somewhere else.
There was a problem hiding this comment.
Hmm, that would be probably too hard to do it right. What about simple role which would change the values + documentation for that role + having it commented out in https://github.com/redhat-performance/satellite-tune/blob/master/ansible/postgresql.yaml by default?
There was a problem hiding this comment.
@jhutar I agree, this will be a much better approach, leaving the control in the hand of user, if they want to run this detection feature or not.
Taking about autodetection, though it is a bit harder approach, but we can indeed autodetect this
There was a problem hiding this comment.
Yep, I would just call the role postgresql-on-ssd so it would be up to user to use the role or not. No auto-detection needed IMO.
The PR adds the functionality for detecting if the given disk is a HDD or an SSD.
This information can be obtained from the sysfs which sets the rotational parameter to 1 for HDDs and 0 for SSDs.
The role has a backdrop of not being able to determine the correct behavior in case of RAID volumes.
Signed-off-by: Saurabh Badhwar sbadhwar@redhat.com