diff --git a/changelogs/asm_ausize.yml b/changelogs/asm_ausize.yml new file mode 100644 index 000000000..ccee70cdc --- /dev/null +++ b/changelogs/asm_ausize.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - "ASM disk's au_size setting not considered, except for initial diskgroup (#537)" diff --git a/roles/orahost_meta/README.md b/roles/orahost_meta/README.md index b8df26f3a..b6c54a62f 100644 --- a/roles/orahost_meta/README.md +++ b/roles/orahost_meta/README.md @@ -61,30 +61,44 @@ asm_diskgroups: [] asm_diskgroups: - diskgroup: crs properties: - - {redundancy: normal, ausize: 4} + - {redundancy: normal} attributes: - - {name: 'compatible.rdbms', value: 11.2.0.4.0} - - {name: 'compatible.asm', value: 12.1.0.2.0} + - {name: compatible.asm, value: 12.1.0.2.0} + - {name: compatible.rdbms, value: 11.2.0.4.0} + - {name: au_size, value: 4m} disk: - {device: /dev/sdc, asmlabel: crs01} - {device: /dev/sdd, asmlabel: crs02} - {device: /dev/sde, asmlabel: crs03} - diskgroup: data properties: - - {redundancy: external, ausize: 4} + - {redundancy: external} attributes: - - {name: compatible.rdbms, value: 11.2.0.4.0} - {name: compatible.asm, value: 12.1.0.2.0} + - {name: compatible.rdbms, value: 11.2.0.4.0} + - {name: au_size, value: 4m} disk: - {device: /dev/sdf, asmlabel: data01} - diskgroup: fra properties: - - {redundancy: external, ausize: 4} - attributes: - - {name: compatible.rdbms, value: 11.2.0.4.0} + - {redundancy: external} + attributes: - {name: compatible.asm, value: 12.1.0.2.0} + - {name: compatible.rdbms, value: 11.2.0.4.0} + - {name: au_size, value: 4m} disk: - {device: /dev/sdg, asmlabel: fra01} + +# Defining ausize in `properties` is still supported for backward compatibility. +# But, except for initial ASM diskgroup, it still won't be considered when creating the diskgroup, though. +asm_diskgroups: + - diskgroup: crs + properties: + - {redundancy: normal, ausize: 4} + attributes: + - {name: compatible.asm, value: 12.1.0.2.0} + - {name: compatible.rdbms, value: 11.2.0.4.0} + ... ``` ### asmadmin_group diff --git a/roles/orahost_meta/defaults/main.yml b/roles/orahost_meta/defaults/main.yml index dd31bd9bb..a497fb604 100644 --- a/roles/orahost_meta/defaults/main.yml +++ b/roles/orahost_meta/defaults/main.yml @@ -171,30 +171,44 @@ asm_diskgroups: [] # asm_diskgroups: # - diskgroup: crs # properties: -# - {redundancy: normal, ausize: 4} +# - {redundancy: normal} # attributes: -# - {name: 'compatible.rdbms', value: 11.2.0.4.0} -# - {name: 'compatible.asm', value: 12.1.0.2.0} +# - {name: compatible.asm, value: 12.1.0.2.0} +# - {name: compatible.rdbms, value: 11.2.0.4.0} +# - {name: au_size, value: 4m} # disk: # - {device: /dev/sdc, asmlabel: crs01} # - {device: /dev/sdd, asmlabel: crs02} # - {device: /dev/sde, asmlabel: crs03} # - diskgroup: data # properties: -# - {redundancy: external, ausize: 4} +# - {redundancy: external} # attributes: -# - {name: compatible.rdbms, value: 11.2.0.4.0} # - {name: compatible.asm, value: 12.1.0.2.0} +# - {name: compatible.rdbms, value: 11.2.0.4.0} +# - {name: au_size, value: 4m} # disk: # - {device: /dev/sdf, asmlabel: data01} # - diskgroup: fra # properties: -# - {redundancy: external, ausize: 4} -# attributes: -# - {name: compatible.rdbms, value: 11.2.0.4.0} +# - {redundancy: external} +# attributes: # - {name: compatible.asm, value: 12.1.0.2.0} +# - {name: compatible.rdbms, value: 11.2.0.4.0} +# - {name: au_size, value: 4m} # disk: # - {device: /dev/sdg, asmlabel: fra01} +# +# # Defining ausize in `properties` is still supported for backward compatibility. +# # But, except for initial ASM diskgroup, it still won't be considered when creating the diskgroup, though. +# asm_diskgroups: +# - diskgroup: crs +# properties: +# - {redundancy: normal, ausize: 4} +# attributes: +# - {name: compatible.asm, value: 12.1.0.2.0} +# - {name: compatible.rdbms, value: 11.2.0.4.0} +# ... # @end # @var oracle_nr_bg_processes:description: Estimated number of background processes of an Oracle instance. Used to calculate kernel SEMMNS diff --git a/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.1.j2 b/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.1.j2 index d654e6cc5..3517721b5 100644 --- a/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.1.j2 +++ b/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.1.j2 @@ -318,7 +318,15 @@ oracle.install.asm.diskGroup.redundancy={% for a in item.properties %}{{ a.redun # size unit is MB # #------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}{% endfor %} +oracle.install.asm.diskGroup.AUSize={%- if item.properties is defined + and item.properties | length > 0 + and item.properties[0].ausize is defined -%} + {{ item.properties[0].ausize }} + {%- elif item.attributes is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') | length > 0 -%} + {{ (item.attributes | selectattr('name', 'equalto', 'au_size'))[0]['value'] | regex_replace('[a-z]', '', ignorecase=true) }} + {%- endif %} #------------------------------------------------------------------------------- # List of disks to create a ASM DiskGroup diff --git a/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.2.j2 b/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.2.j2 index cee47d8a9..d7b179ec0 100644 --- a/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.2.j2 +++ b/roles/oraswgi_install/templates/grid-install.rsp.12.1.0.2.j2 @@ -319,7 +319,15 @@ oracle.install.asm.diskGroup.redundancy={% for a in item.properties %}{{ a.redun # size unit is MB # #------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}{% endfor %} +oracle.install.asm.diskGroup.AUSize={%- if item.properties is defined + and item.properties | length > 0 + and item.properties[0].ausize is defined -%} + {{ item.properties[0].ausize }} + {%- elif item.attributes is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') | length > 0 -%} + {{ (item.attributes | selectattr('name', 'equalto', 'au_size'))[0]['value'] | regex_replace('[a-z]', '', ignorecase=true) }} + {%- endif %} #------------------------------------------------------------------------------- # List of disks to create a ASM DiskGroup diff --git a/roles/oraswgi_install/templates/grid-install.rsp.12.2.0.1.j2 b/roles/oraswgi_install/templates/grid-install.rsp.12.2.0.1.j2 index 664053504..1b0f5349e 100644 --- a/roles/oraswgi_install/templates/grid-install.rsp.12.2.0.1.j2 +++ b/roles/oraswgi_install/templates/grid-install.rsp.12.2.0.1.j2 @@ -413,7 +413,15 @@ oracle.install.asm.diskGroup.redundancy={% for a in item.properties %}{{ a.redun # size unit is MB # #------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}{% endfor %} +oracle.install.asm.diskGroup.AUSize={%- if item.properties is defined + and item.properties | length > 0 + and item.properties[0].ausize is defined -%} + {{ item.properties[0].ausize }} + {%- elif item.attributes is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') | length > 0 -%} + {{ (item.attributes | selectattr('name', 'equalto', 'au_size'))[0]['value'] | regex_replace('[a-z]', '', ignorecase=true) }} + {%- endif %} #------------------------------------------------------------------------------- # Failure Groups for the disk group diff --git a/roles/oraswgi_install/templates/grid-install.rsp.18.3.0.0.j2 b/roles/oraswgi_install/templates/grid-install.rsp.18.3.0.0.j2 index bdb66fd0d..79f4ebe36 100644 --- a/roles/oraswgi_install/templates/grid-install.rsp.18.3.0.0.j2 +++ b/roles/oraswgi_install/templates/grid-install.rsp.18.3.0.0.j2 @@ -431,7 +431,15 @@ oracle.install.asm.diskGroup.redundancy={% for a in item.properties %}{{ a.redun # size unit is MB # #------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}{% endfor %} +oracle.install.asm.diskGroup.AUSize={%- if item.properties is defined + and item.properties | length > 0 + and item.properties[0].ausize is defined -%} + {{ item.properties[0].ausize }} + {%- elif item.attributes is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') | length > 0 -%} + {{ (item.attributes | selectattr('name', 'equalto', 'au_size'))[0]['value'] | regex_replace('[a-z]', '', ignorecase=true) }} + {%- endif %} #------------------------------------------------------------------------------- # Failure Groups for the disk group diff --git a/roles/oraswgi_install/templates/grid-install.rsp.19.3.0.0.j2 b/roles/oraswgi_install/templates/grid-install.rsp.19.3.0.0.j2 index 9f7fb778c..7db833b95 100644 --- a/roles/oraswgi_install/templates/grid-install.rsp.19.3.0.0.j2 +++ b/roles/oraswgi_install/templates/grid-install.rsp.19.3.0.0.j2 @@ -419,7 +419,15 @@ oracle.install.asm.diskGroup.redundancy={% for a in item.properties %}{{ a.redun # size unit is MB # #------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}{% endfor %} +oracle.install.asm.diskGroup.AUSize={%- if item.properties is defined + and item.properties | length > 0 + and item.properties[0].ausize is defined -%} + {{ item.properties[0].ausize }} + {%- elif item.attributes is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') | length > 0 -%} + {{ (item.attributes | selectattr('name', 'equalto', 'au_size'))[0]['value'] | regex_replace('[a-z]', '', ignorecase=true) }} + {%- endif %} #------------------------------------------------------------------------------- # Failure Groups for the disk group diff --git a/roles/oraswgi_install/templates/grid-install.rsp.21.3.0.0.j2 b/roles/oraswgi_install/templates/grid-install.rsp.21.3.0.0.j2 index d3607e59c..515608518 100644 --- a/roles/oraswgi_install/templates/grid-install.rsp.21.3.0.0.j2 +++ b/roles/oraswgi_install/templates/grid-install.rsp.21.3.0.0.j2 @@ -403,7 +403,15 @@ oracle.install.asm.diskGroup.redundancy={% for a in item.properties %}{{ a.redun # size unit is MB # #------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize={% for a in item.properties %}{{ a.ausize }}{% endfor %} +oracle.install.asm.diskGroup.AUSize={%- if item.properties is defined + and item.properties | length > 0 + and item.properties[0].ausize is defined -%} + {{ item.properties[0].ausize }} + {%- elif item.attributes is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') is defined + and item.attributes | selectattr('name', 'equalto', 'au_size') | length > 0 -%} + {{ (item.attributes | selectattr('name', 'equalto', 'au_size'))[0]['value'] | regex_replace('[a-z]', '', ignorecase=true) }} + {%- endif %} #------------------------------------------------------------------------------- # Failure Groups for the disk group