Skip to content

Commit

Permalink
ASM failgroups support
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilo Solbrig committed Apr 19, 2024
1 parent 610f983 commit 45b0f3e
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 19 deletions.
6 changes: 3 additions & 3 deletions roles/orahost_meta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ asm_diskgroups:
- {name: 'compatible.rdbms', value: 11.2.0.4.0}
- {name: 'compatible.asm', value: 12.1.0.2.0}
disk:
- {device: /dev/sdc, asmlabel: crs01}
- {device: /dev/sdd, asmlabel: crs02}
- {device: /dev/sde, asmlabel: crs03}
- {device: /dev/sdc, asmlabel: crs01, failure_group: storage01}
- {device: /dev/sdd, asmlabel: crs02, failure_group: storage02}
- {device: /dev/sde, asmlabel: crs03, failure_group: nfs, quorum: true}
- diskgroup: data
properties:
- {redundancy: external, ausize: 4}
Expand Down
28 changes: 24 additions & 4 deletions roles/oraswgi_install/templates/grid-install.rsp.12.2.0.1.j2
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}
# tuples.
# Else just specify as list of failure group names
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.FailureGroups=
oracle.install.asm.diskGroup.FailureGroups={%- for disk in item.disk|selectattr('failure_group','defined') -%}
{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# List of disks and their failure groups to create a ASM DiskGroup
Expand All @@ -435,7 +437,16 @@ oracle.install.asm.diskGroup.FailureGroups=
#
#-------------------------------------------------------------------------------
#oracle.install.asm.diskGroup.disksWithFailureGroupNames=ORCL:CRS01,
oracle.install.asm.diskGroup.disksWithFailureGroupNames=
oracle.install.asm.diskGroup.disksWithFailureGroupNames={%- for disk in item.disk|selectattr('failure_group','defined') -%}
{%- if device_persistence in ['udev',''] -%}{{ disk.device }}
{%- elif device_persistence=='asmfd' -%}AFD:{{ disk.asmlabel | upper }}
{%- else -%}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}
,{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# List of disks to create a ASM DiskGroup
Expand All @@ -447,15 +458,24 @@ oracle.install.asm.diskGroup.disksWithFailureGroupNames=
# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1
#
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.disks={% if device_persistence=='udev' %}{% for disk in item.disk -%} {{ oracle_asm_disk_string }}{{ disk.asmlabel }}{%- if not loop.last -%} , {%- endif -%} {%- endfor %}{% else %}{% for disk in item.disk -%} ORCL:{{ disk.asmlabel|upper }}{%- if not loop.last -%} , {%- endif -%} {%- endfor %} {% endif %}
oracle.install.asm.diskGroup.disks={%- for disk in item.disk %}
{%- if device_persistence in ['udev',''] -%}{{ disk.device }}
{%- elif device_persistence=='asmfd' -%}AFD:{{ disk.asmlabel | upper }}
{%- else -%}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}{%- if not loop.last %},{% endif %}{% endfor %}

#-------------------------------------------------------------------------------
# List of failure groups to be marked as QUORUM.
# Quorum failure groups contain only voting disk data, no user data is stored
# Example:
# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.quorumFailureGroupNames=
oracle.install.asm.diskGroup.quorumFailureGroupNames={%- for disk in item.disk|selectattr('quorum','defined')|selectattr('quorum','equalto',true) -%}
{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}
#-------------------------------------------------------------------------------
# The disk discovery string to be used to discover the disks used create a ASM DiskGroup
#
Expand Down
29 changes: 25 additions & 4 deletions roles/oraswgi_install/templates/grid-install.rsp.18.3.0.0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}
# tuples.
# Else just specify as list of failure group names
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.FailureGroups=
oracle.install.asm.diskGroup.FailureGroups={%- for disk in item.disk|selectattr('failure_group','defined') -%}
{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# List of disks and their failure groups to create a ASM DiskGroup
Expand All @@ -452,7 +454,16 @@ oracle.install.asm.diskGroup.FailureGroups=
# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName
#
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.disksWithFailureGroupNames=
oracle.install.asm.diskGroup.disksWithFailureGroupNames={%- for disk in item.disk|selectattr('failure_group','defined') -%}
{%- if device_persistence in ['udev',''] -%}{{ disk.device }}
{%- elif device_persistence=='asmfd' -%}AFD:{{ disk.asmlabel | upper }}
{%- else -%}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}
,{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# List of disks to create a ASM DiskGroup
Expand All @@ -464,15 +475,25 @@ oracle.install.asm.diskGroup.disksWithFailureGroupNames=
# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1
#
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.disks={% if device_persistence=='udev' %}{% for disk in item.disk -%} {{ oracle_asm_disk_string }}{{ disk.asmlabel }}{%- if not loop.last -%} , {%- endif -%} {%- endfor %}{% else %}{% for disk in item.disk -%} ORCL:{{ disk.asmlabel|upper }}{%- if not loop.last -%} , {%- endif -%} {%- endfor %} {% endif %}
oracle.install.asm.diskGroup.disks={%- for disk in item.disk %}
{%- if device_persistence in ['udev',''] -%}{{ disk.device }}
{%- elif device_persistence=='asmfd' -%}AFD:{{ disk.asmlabel | upper }}
{%- else -%}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}{%- if not loop.last %},{% endif %}{% endfor %}

#-------------------------------------------------------------------------------
# List of failure groups to be marked as QUORUM.
# Quorum failure groups contain only voting disk data, no user data is stored
# Example:
# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.quorumFailureGroupNames=
oracle.install.asm.diskGroup.quorumFailureGroupNames={%- for disk in item.disk|selectattr('quorum','defined')|selectattr('quorum','equalto',true) -%}
{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# The disk discovery string to be used to discover the disks used create a ASM DiskGroup
#
Expand Down
22 changes: 18 additions & 4 deletions roles/oraswgi_install/templates/grid-install.rsp.19.3.0.0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}
# tuples.
# Else just specify as list of failure group names
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.FailureGroups=
oracle.install.asm.diskGroup.FailureGroups={%- for disk in item.disk|selectattr('failure_group','defined') -%}
{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# List of disks and their failure groups to create a ASM DiskGroup
Expand All @@ -440,7 +442,16 @@ oracle.install.asm.diskGroup.FailureGroups=
# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName
#
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.disksWithFailureGroupNames=
oracle.install.asm.diskGroup.disksWithFailureGroupNames={%- for disk in item.disk|selectattr('failure_group','defined') -%}
{%- if device_persistence in ['udev',''] -%}{{ disk.device }}
{%- elif device_persistence=='asmfd' -%}AFD:{{ disk.asmlabel | upper }}
{%- else -%}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}
,{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# List of disks to create a ASM DiskGroup
Expand All @@ -459,15 +470,18 @@ oracle.install.asm.diskGroup.disks={%- for disk in item.disk %}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}{%- if not loop.last %} , {% endif %}{% endfor %}
{%- endif -%}{%- if not loop.last %},{% endif %}{% endfor %}

#-------------------------------------------------------------------------------
# List of failure groups to be marked as QUORUM.
# Quorum failure groups contain only voting disk data, no user data is stored
# Example:
# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.quorumFailureGroupNames=
oracle.install.asm.diskGroup.quorumFailureGroupNames={%- for disk in item.disk|selectattr('quorum','defined')|selectattr('quorum','equalto',true) -%}
{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# The disk discovery string to be used to discover the disks used create a ASM DiskGroup
#
Expand Down
19 changes: 15 additions & 4 deletions roles/oraswgi_install/templates/grid-install.rsp.21.3.0.0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,16 @@ oracle.install.asm.diskGroup.FailureGroups=
# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName
#
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.disksWithFailureGroupNames=
oracle.install.asm.diskGroup.disksWithFailureGroupNames={%- for disk in item.disk|selectattr('failure_group','defined') -%}
{%- if device_persistence in ['udev',''] -%}{{ disk.device }}
{%- elif device_persistence=='asmfd' -%}AFD:{{ disk.asmlabel | upper }}
{%- else -%}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}
,{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}

#-------------------------------------------------------------------------------
# List of disks to create a ASM DiskGroup
Expand All @@ -437,20 +446,22 @@ oracle.install.asm.diskGroup.disksWithFailureGroupNames=
#
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.disks={%- for disk in item.disk %}
{%- if device_persistence=='udev' -%}{{ disk.device }}
{%- if device_persistence in ['udev',''] -%}{{ disk.device }}
{%- else -%}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else -%}{{ oracle_asm_disk_string }}
{%- endif -%}{{ disk.asmlabel | upper }}
{%- endif -%}{%- if not loop.last %} , {% endif %}{% endfor %}
{%- endif -%}{%- if not loop.last %},{% endif %}{% endfor %}

#-------------------------------------------------------------------------------
# List of failure groups to be marked as QUORUM.
# Quorum failure groups contain only voting disk data, no user data is stored
# Example:
# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2
#-------------------------------------------------------------------------------
oracle.install.asm.diskGroup.quorumFailureGroupNames=
oracle.install.asm.diskGroup.quorumFailureGroupNames={%- for disk in item.disk|selectattr('quorum','defined')|selectattr('quorum','equalto',true) -%}
{{ disk.failure_group }}{%- if not loop.last %},{% endif %}
{% endfor %}
#-------------------------------------------------------------------------------
# The disk discovery string to be used to discover the disks used create a ASM DiskGroup
#
Expand Down

0 comments on commit 45b0f3e

Please sign in to comment.