Commit e12f91ca authored by Adam Robinson's avatar Adam Robinson
Browse files

Add new DisableSmartd Option

parent 6eca5251
......@@ -28,6 +28,11 @@ Role Variables
`Third_Party_Array_Not_Support_Max_HW_Transfer_Size`. You might want to override it if you have another
array in the environment that supports operations larger than the default but smaller than Pure's recomendation.
- `DisableSmartd` - There appears to be an issue where
[vSphere tries to read SMART data from Pure volumes](https://www.jacobhopkinson.com/2019/08/09/vmware-and-scsi-why-do-my-pure-storage-datastores-report-scsi-0x85-errors-every-30-minutes/)
, but those obviously don't support SMART. If you don't have any local storage, it should be safe
to disable SMART. Defaults to `false`.
### Required
- `vcenter_hostname` - The hostname or address of the vCenter server.
......
......@@ -5,3 +5,4 @@ vmware_password: "{{ lookup('env','VMWARE_PASSWORD') }}"
Third_Party_Array_Not_Support_ATS_HB: false
Third_Party_Array_Not_Support_Max_HW_Transfer_Size: false
MaxHWTransferSize: '{{4096 if Third_Party_Array_Not_Support_Max_HW_Transfer_Size|bool else 16384}}'
DisableSmartd: false
......@@ -106,4 +106,57 @@
password: '{{ vmware_password }}'
options:
'VMFS3.EnableBlockDelete': 1
delegate_to: localhost
\ No newline at end of file
delegate_to: localhost
# vSphere keeps trying to read SMART data from Pure volumes
# https://www.jacobhopkinson.com/2019/08/09/vmware-and-scsi-why-do-my-pure-storage-datastores-report-scsi-0x85-errors-every-30-minutes/
- when: DisableSmartd
block:
- name: Get status of smartd
shell: /etc/init.d/smartd status
vars:
ansible_user: '{{ vmware_user }}@{{ ad_domain|upper }}'
ansible_password: '{{ vmware_password }}'
ansible_connection: paramiko
ansible_python_interpreter: /bin/python
register: SmartdStatusCMD
failed_when: ( SmartdStatusCMD.rc not in [ 0, 3 ] ) # When smart is stopped the return code is 3
changed_when: False
- name: Set SmartdStatus fact
set_fact:
SmartdRunning: '{{ true if SmartdStatusCMD.rc == 0 else false }}'
- name: Stop smartd
shell: /etc/init.d/smartd stop
vars:
ansible_user: '{{ vmware_user }}@{{ ad_domain|upper }}'
ansible_password: '{{ vmware_password }}'
ansible_connection: paramiko
ansible_python_interpreter: /bin/python
when: SmartdRunning
- name: Check if smartd is enabled at boot
shell: chkconfig --list smartd
vars:
ansible_user: '{{ vmware_user }}@{{ ad_domain|upper }}'
ansible_password: '{{ vmware_password }}'
ansible_connection: paramiko
ansible_python_interpreter: /bin/python
register: SmartdEnabledCMD
failed_when: ( SmartdEnabledCMD.rc not in [ 0, 1 ] ) # When smart is disabled the return code is 1
changed_when: False
- name: Set SmartdEnabled fact
set_fact:
SmartdEnabled: '{{ true if SmartdEnabledCMD.rc == 0 else false }}'
- name: Disable smartd at boot
shell: chkconfig smartd off
vars:
ansible_user: '{{ vmware_user }}@{{ ad_domain|upper }}'
ansible_password: '{{ vmware_password }}'
ansible_connection: paramiko
ansible_python_interpreter: /bin/python
when: SmartdEnabled
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment