From a205d1d12c3a1e4d8420ecd12dd74afd85c18bdf Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:54:24 -0400 Subject: [PATCH 1/6] sap_vm_provision: resolve anydb ha missing declarations --- .../platform_ansible/aws_ec2_vs/execute_main.yml | 2 +- .../platform_ansible/gcp_ce_vm/execute_main.yml | 2 +- .../ibmcloud_powervs/execute_main.yml | 15 ++++++++++++--- .../platform_ansible/ibmcloud_vs/execute_main.yml | 10 +++++++++- .../ibmpowervm_vm/execute_main.yml | 2 +- .../platform_ansible/kubevirt_vm/execute_main.yml | 2 +- .../platform_ansible/msazure_vm/execute_main.yml | 2 +- .../platform_ansible/ovirt_vm/execute_main.yml | 2 +- .../platform_ansible/vmware_vm/execute_main.yml | 2 +- 9 files changed, 28 insertions(+), 11 deletions(-) diff --git a/roles/sap_vm_provision/tasks/platform_ansible/aws_ec2_vs/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/aws_ec2_vs/execute_main.yml index 2c9c267..c0ed9da 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/aws_ec2_vs/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/aws_ec2_vs/execute_main.yml @@ -63,7 +63,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/gcp_ce_vm/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/gcp_ce_vm/execute_main.yml index 2cad5bd..d9b8265 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/gcp_ce_vm/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/gcp_ce_vm/execute_main.yml @@ -77,7 +77,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml index 0783a06..a100ef1 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml @@ -56,6 +56,7 @@ - name: Identify Resource Group info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_resource_group + run_once: true ibm.cloudcollection.ibm_resource_group_info: name: "{{ sap_vm_provision_ibmcloud_resource_group_name }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -65,6 +66,7 @@ - name: Identify Resource Group info for IBM Cloud Private DNS no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_resource_group_dns + run_once: true ibm.cloudcollection.ibm_resource_group_info: name: "{{ sap_vm_provision_ibmcloud_private_dns_resource_group_name }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -73,6 +75,7 @@ - name: Identify IBM Power Infrastructure Workspace no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_workspace_service_instance + run_once: true ibm.cloudcollection.ibm_resource_instance_info: resource_group_id: "{{ __sap_vm_provision_task_ibmcloud_resource_group.resource.id }}" location: "{{ sap_vm_provision_ibmcloud_powervs_location }}" @@ -83,6 +86,7 @@ - name: Identify pre-loaded IBM Power Infrastructure SSH Public Key info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_ssh_public_key + run_once: true environment: IC_REGION: "{{ sap_vm_provision_ibmcloud_powervs_region }}" ibm.cloudcollection.ibm_pi_key_info: @@ -93,6 +97,7 @@ - name: Identify IBM Power Infrastructure VLAN Subnet info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_subnet + run_once: true environment: IC_REGION: "{{ sap_vm_provision_ibmcloud_powervs_region }}" ibm.cloudcollection.ibm_pi_network_info: @@ -115,6 +120,7 @@ - name: Identify IBM Cloud Private DNS instance no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pdns_service_instance + run_once: true ibm.cloudcollection.ibm_resource_instance_info: resource_group_id: "{{ __sap_vm_provision_task_ibmcloud_resource_group.resource.id if __sap_vm_provision_task_ibmcloud_resource_group_dns is skipped else __sap_vm_provision_task_ibmcloud_resource_group_dns.resource.id }}" location: global @@ -125,6 +131,7 @@ - name: Identify IBM Cloud Private DNS Zone info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pdns + run_once: true ibm.cloudcollection.ibm_dns_zones_info: instance_id: "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.guid }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -132,6 +139,7 @@ - name: Identify IBM Power Infrastructure OS Catalog Stock Image list no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_os_image_list + run_once: true environment: IC_REGION: "{{ sap_vm_provision_ibmcloud_powervs_region }}" ibm.cloudcollection.ibm_pi_catalog_images_info: @@ -146,6 +154,7 @@ - name: Import Boot Image to current IBM Power Infrastructure Workspace from the IBM Power Infrastructure OS Catalog Stock Image no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_os_image_provisioned + run_once: true environment: IC_REGION: "{{ sap_vm_provision_ibmcloud_powervs_region }}" ibm.cloudcollection.ibm_pi_image: @@ -154,11 +163,11 @@ pi_image_name: "{{ sap_vm_provision_ibmcloud_powervs_host_os_image }}-boot" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" failed_when: not __sap_vm_provision_task_ibmcloud_pi_os_image_provisioned.rc == 0 and not 'already exists' in __sap_vm_provision_task_ibmcloud_pi_os_image_provisioned.stderr - run_once: true - name: Identify IBM Power Infrastructure Workspace imported OS Image list no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_imported_os_image_list + run_once: true environment: IC_REGION: "{{ sap_vm_provision_ibmcloud_powervs_region }}" ibm.cloudcollection.ibm_pi_images_info: @@ -173,13 +182,13 @@ - name: Check for existing Boot Image imported already from IBM Power Infrastructure OS Catalog Stock Image no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_os_image_existing + run_once: true environment: IC_REGION: "{{ sap_vm_provision_ibmcloud_powervs_region }}" ibm.cloudcollection.ibm_pi_image_info: pi_cloud_instance_id: "{{ __sap_vm_provision_task_ibmcloud_pi_workspace_service_instance.resource.guid }}" # must be GUID, not CRN pi_image_name: "{{ register_ibmcloud_pi_imported_os_image_selected.name }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" - run_once: true - name: Set fact to hold loop variables from include_tasks ansible.builtin.set_fact: @@ -215,7 +224,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml index e53b02d..5ffcbb2 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml @@ -12,6 +12,7 @@ - name: Identify Resource Group info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_resource_group + run_once: true ibm.cloudcollection.ibm_resource_group_info: name: "{{ sap_vm_provision_ibmcloud_resource_group_name }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -21,6 +22,7 @@ - name: Identify Resource Group info for Private DNS no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_resource_group_dns + run_once: true ibm.cloudcollection.ibm_resource_group_info: name: "{{ sap_vm_provision_ibmcloud_private_dns_resource_group_name }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -29,6 +31,7 @@ - name: Identify pre-loaded SSH Public Key info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_ssh_public_key + run_once: true ibm.cloudcollection.ibm_is_ssh_key_info: name: "{{ sap_vm_provision_ibmcloud_key_pair_name_ssh_host_public_key }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -36,6 +39,7 @@ - name: Identify VPC Subnet info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_vpc_subnet + run_once: true ibm.cloudcollection.ibm_is_subnet_info: name: "{{ sap_vm_provision_ibmcloud_vpc_subnet_name }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -43,6 +47,7 @@ - name: Identify VPC Security Group info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_vpc_sg + run_once: true ibm.cloudcollection.ibm_is_security_group_info: name: "{{ item }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -51,6 +56,7 @@ - name: Identify Private DNS instance no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pdns_service_instance + run_once: true ibm.cloudcollection.ibm_resource_instance_info: resource_group_id: "{{ __sap_vm_provision_task_ibmcloud_resource_group.resource.id }}" location: global @@ -61,6 +67,7 @@ - name: Identify Private DNS Zone info no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pdns + run_once: true ibm.cloudcollection.ibm_dns_zones_info: instance_id: "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.guid }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -68,6 +75,7 @@ - name: Identify OS Image list no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_os_image_list + run_once: true ibm.cloudcollection.ibm_is_images_info: status: available ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" @@ -105,7 +113,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_main.yml index 023dc59..f2bad0b 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_main.yml @@ -80,7 +80,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/kubevirt_vm/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/kubevirt_vm/execute_main.yml index 7563763..581073c 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/kubevirt_vm/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/kubevirt_vm/execute_main.yml @@ -68,7 +68,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/msazure_vm/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/msazure_vm/execute_main.yml index 6f5a96a..b74f61b 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/msazure_vm/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/msazure_vm/execute_main.yml @@ -82,7 +82,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ovirt_vm/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/ovirt_vm/execute_main.yml index adf33e8..028a8c9 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ovirt_vm/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ovirt_vm/execute_main.yml @@ -50,7 +50,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set diff --git a/roles/sap_vm_provision/tasks/platform_ansible/vmware_vm/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/vmware_vm/execute_main.yml index c340434..24d504d 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/vmware_vm/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/vmware_vm/execute_main.yml @@ -45,7 +45,7 @@ - name: Set fact to hold all inventory hosts in all groups ansible.builtin.set_fact: - groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" + groups_merged_list: "{{ [ [ groups['hana_primary'] | default([]) ] , [ groups['hana_secondary'] | default([]) ] , [ groups['anydb_primary'] | default([]) ] , [ groups['anydb_secondary'] | default([]) ] , [ groups['nwas_ascs'] | default([]) ] , [ groups['nwas_ers'] | default([]) ] , [ groups['nwas_pas'] | default([]) ] , [ groups['nwas_aas'] | default([]) ] ] | flatten | select() }}" - name: Set Ansible Vars register: __sap_vm_provision_task_ansible_vars_set From fae9d36f3b00d67f0df6fd59c65067708aa58711 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:58:11 -0400 Subject: [PATCH 2/6] sap_vm_provision: missing scale-out logic for ibm platforms --- .../ibmcloud_powervs/execute_provision.yml | 11 +++++++---- .../ibmcloud_vs/execute_provision.yml | 12 ++++++++---- .../ibmpowervm_vm/execute_provision.yml | 18 +++++++++--------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml index 3862b07..1ef2eb9 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml @@ -14,6 +14,9 @@ - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined - not inventory_hostname in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() +- name: Set fact for host specifications of the provision target + ansible.builtin.set_fact: + target_provision_host_spec: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)] }}" # Status will change from Building > Warning (VM = Active, Health = Warning) > Active. The Ansible Task will continue once the Active status has been reached. - name: Provision IBM Power Virtual Server instance on IBM Cloud @@ -25,9 +28,9 @@ pi_instance_name: "{{ inventory_hostname }}" pi_image_id: "{{ __sap_vm_provision_task_ibmcloud_pi_os_image_existing.resource.id }}" - pi_sys_type: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmcloud_powervs_hardware_machine_type }}" + pi_sys_type: "{{ target_provision_host_spec.ibmcloud_powervs_hardware_machine_type }}" - pi_sap_profile_id: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].virtual_machine_profile }}" + pi_sap_profile_id: "{{ target_provision_host_spec.virtual_machine_profile }}" pi_key_pair_name: "{{ sap_vm_provision_ibmcloud_powervs_key_pair_name_ssh_host_public_key }}" @@ -57,7 +60,7 @@ ansible.builtin.set_fact: storage_disks_map: | {% set disks_map = [] -%} - {% for storage_item in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].storage_definition -%} + {% for storage_item in target_provision_host_spec.storage_definition -%} {% for idx in range(0, storage_item.disk_count | default(1)) -%} {% if (storage_item.filesystem_type is defined) -%} {% if ('swap' in storage_item.filesystem_type and storage_item.swap_path is not defined) @@ -218,7 +221,7 @@ - name: Append loop value to register ansible.builtin.set_fact: - __sap_vm_provision_task_provision_host_single: "{{ __sap_vm_provision_task_provision_host_single | combine( { 'host_node' : inventory_hostname } , { 'sap_host_type' : lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].sap_host_type } , { 'sap_system_type' : (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].sap_system_type | default('')) } ) }}" + __sap_vm_provision_task_provision_host_single: "{{ __sap_vm_provision_task_provision_host_single | combine( { 'host_node' : inventory_hostname } , { 'sap_host_type' : target_provision_host_spec.sap_host_type } , { 'sap_system_type' : (target_provision_host_spec.sap_system_type | default('')) } ) }}" - name: Append output to merged register ansible.builtin.set_fact: diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml index dcb272e..1b14e58 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml @@ -14,6 +14,10 @@ - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined - not inventory_hostname in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() +- name: Set fact for host specifications of the provision target + ansible.builtin.set_fact: + target_provision_host_spec: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)] }}" + - name: Provision IBM Cloud Virtual Server instance no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_provision_host_single @@ -21,7 +25,7 @@ state: available name: "{{ inventory_hostname }}" image: "{{ (__sap_vm_provision_task_ibmcloud_os_image_list.resource.images | select('search', lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_os_image_dictionary')[sap_vm_provision_ibmcloud_vs_host_os_image]) | sort(reverse=True,case_sensitive=False,attribute='name') | first).id }}" - profile: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].virtual_machine_profile }}" + profile: "{{ target_provision_host_spec.virtual_machine_profile }}" keys: - "{{ __sap_vm_provision_task_ibmcloud_ssh_public_key.resource.id }}" @@ -34,7 +38,7 @@ primary_network_interface: - name: "{{ inventory_hostname }}-vnic0" subnet: "{{ __sap_vm_provision_task_ibmcloud_vpc_subnet.resource.id }}" - allow_ip_spoofing: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].disable_ip_anti_spoofing }}" # When disable the Anti IP Spoofing = true, then Allow IP Spoofing = true + allow_ip_spoofing: "{{ target_provision_host_spec.disable_ip_anti_spoofing }}" # When disable the Anti IP Spoofing = true, then Allow IP Spoofing = true security_groups: "{{ __sap_vm_provision_task_ibmcloud_vpc_sg.results | map(attribute='resource.id') }}" #network_interfaces: @@ -55,7 +59,7 @@ ansible.builtin.set_fact: storage_disks_map: | {% set disks_map = [] -%} - {% for storage_item in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].storage_definition -%} + {% for storage_item in target_provision_host_spec.storage_definition -%} {% for idx in range(0, storage_item.disk_count | default(1)) -%} {% if (storage_item.filesystem_type is defined) -%} {% if ('swap' in storage_item.filesystem_type and storage_item.swap_path is not defined) @@ -189,7 +193,7 @@ - name: Append loop value to register ansible.builtin.set_fact: - __sap_vm_provision_task_provision_host_single: "{{ __sap_vm_provision_task_provision_host_single | combine( { 'host_node' : inventory_hostname } , { 'sap_host_type' : lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].sap_host_type } , { 'sap_system_type' : (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].sap_system_type | default('')) } ) }}" + __sap_vm_provision_task_provision_host_single: "{{ __sap_vm_provision_task_provision_host_single | combine( { 'host_node' : inventory_hostname } , { 'sap_host_type' : target_provision_host_spec.sap_host_type } , { 'sap_system_type' : (target_provision_host_spec.sap_system_type | default('')) } ) }}" - name: Append output to merged register ansible.builtin.set_fact: diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_provision.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_provision.yml index 9103db1..fae18ea 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_provision.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmpowervm_vm/execute_provision.yml @@ -62,8 +62,8 @@ ## Virtual Machine main resources definition # Assume SMT-8, 1 IBM Power CPU Core therefore divide by 8 = CPU Threads - vcpus: "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_smt) | round(0, 'common') | int }}" # Virtual Processors (i.e. IBM Power CPU Cores), Desired. API must receive an integer - ram: "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_memory_gib * 1024) | int }}" # Memory (MiB), Desired + vcpus: "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_smt) | round(0, 'common') | int }}" # Virtual Processors (i.e. IBM Power CPU Cores), Desired. API must receive an integer + ram: "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_memory_gib * 1024) | int }}" # Memory (MiB), Desired disk: 0 # Must be set to 0 otherwise conflicts with OS Image template swap: 0 # Must be set to 0 otherwise error "failed with exception: Build of instance xxxx was re-scheduled: list index out of range" is_public: true @@ -71,16 +71,16 @@ # After creation, modifications to extra_specs parameters may not be identified extra_specs: #### Virtual Processors (i.e. IBM Power CPU Cores) - for Production systems must be minimum of 4 #### - "powervm:min_vcpu": "{{ [((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_smt) * 0.75) | round(0, 'floor'), 1] | max | int }}" # Virtual Processors (i.e. IBM Power CPU Cores), Minimum. Value of 1 is lowest possible. API must receive an integer - "powervm:max_vcpu": "{{ ((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_smt) * 1.20) | round(0, 'ceil') | int }}" # Virtual Processors (i.e. IBM Power CPU Cores), Maximum. API must receive an integer + "powervm:min_vcpu": "{{ [((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_smt) * 0.75) | round(0, 'floor'), 1] | max | int }}" # Virtual Processors (i.e. IBM Power CPU Cores), Minimum. Value of 1 is lowest possible. API must receive an integer + "powervm:max_vcpu": "{{ ((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_smt) * 1.20) | round(0, 'ceil') | int }}" # Virtual Processors (i.e. IBM Power CPU Cores), Maximum. API must receive an integer #### Dynamic LPAR Entitled Capacity of Virtual Processor units (i.e. IBM Power CPU Cores guaranteed to be available) #### # Processing units set minimum to 80% of the minimum Virtual Processors (i.e. IBM Power CPU Cores) # Processing units set standard to 80% of the Virtual Processors (i.e. IBM Power CPU Cores) # Processing units set maximum to 100% of the maximum Virtual Processors (i.e. IBM Power CPU Cores) - "powervm:min_proc_units": "{{ ((((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_smt) * 0.75) | round(1, 'floor')) * 0.8) | round(2, 'floor') | float }}" # Processing units, Minimum - "powervm:proc_units": "{{ ((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_smt) | round(0, 'common')) * 0.8 | round(2, 'common') | float }}" # Processing units, Desired - "powervm:max_proc_units": "{{ ((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_cpu_smt) * 1.20) | round(0, 'ceil') | float }}" # Processing units, Maximum + "powervm:min_proc_units": "{{ ((((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_smt) * 0.75) | round(1, 'floor')) * 0.8) | round(2, 'floor') | float }}" # Processing units, Minimum + "powervm:proc_units": "{{ ((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_smt) | round(0, 'common')) * 0.8 | round(2, 'common') | float }}" # Processing units, Desired + "powervm:max_proc_units": "{{ ((lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_threads / lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_cpu_smt) * 1.20) | round(0, 'ceil') | float }}" # Processing units, Maximum "powervm:dedicated_proc": "false" #"powervm:dedicated_sharing_mode": "share_idle_procs" # When 'dedicated_proc' true, share_idle_procs = "Allow processor sharing when the virtual machine is inactive" @@ -89,8 +89,8 @@ "powervm:shared_proc_pool_name": "{{ sap_vm_provision_ibmpowervm_host_group_shared_procesor_pool_name }}" "powervm:processor_compatibility": "default" - "powervm:min_mem": "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_memory_gib * 1024) - (0.25 * (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_memory_gib * 1024)) | round(0, 'ceil') | int }}" # Memory, Minimum. API must receive an integer - "powervm:max_mem": "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname].ibmpowervm_vm_memory_gib * 1024) | round(0, 'ceil') | int }}" # Memory, Maximum. API must receive an integer + "powervm:min_mem": "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_memory_gib * 1024) - (0.25 * (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_memory_gib * 1024)) | round(0, 'ceil') | int }}" # Memory, Minimum. API must receive an integer + "powervm:max_mem": "{{ (lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].ibmpowervm_vm_memory_gib * 1024) | round(0, 'ceil') | int }}" # Memory, Maximum. API must receive an integer #"powervm:ame_expansion_factor": 0 "powervm:enforce_affinity_check": "true" From 71b4847b87e9d93c1ffaebb538a6132a94f008ac Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:00:00 -0400 Subject: [PATCH 3/6] sap_vm_provision: fix var declare structure --- .../tasks/common/set_ansible_vars.yml | 31 ++++++++++--------- .../tasks/common/set_ansible_vars_storage.yml | 2 +- .../tasks/common/set_etc_hosts_ha.yml | 4 +-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/roles/sap_vm_provision/tasks/common/set_ansible_vars.yml b/roles/sap_vm_provision/tasks/common/set_ansible_vars.yml index a6140c6..9b151dc 100644 --- a/roles/sap_vm_provision/tasks/common/set_ansible_vars.yml +++ b/roles/sap_vm_provision/tasks/common/set_ansible_vars.yml @@ -1,5 +1,18 @@ --- +# Required when defining Ansible Role variables within the host_specifications_dictionary for multiple SAP Systems / SAP Landscapes +- name: Set facts for all hosts - use facts from localhost - SAP Variables from host_specifications_dictionary + ansible.builtin.set_fact: + "{{ host_spec_sap_item }}": "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)][host_spec_sap_item] }}" + loop: "{{ vars['sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary'][sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].keys() | map('regex_findall', '^sap_.*') | flatten | select() | list }}" + loop_control: + loop_var: host_spec_sap_item + +- name: Set facts for all hosts - use facts from localhost - Host Specifications Dictionary + ansible.builtin.set_fact: + host_specifications_dictionary: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary') }}" + + - name: Set facts for all hosts - use facts from localhost - Generic ansible.builtin.set_fact: sap_vm_provision_dns_root_domain: "{{ sap_vm_provision_dns_root_domain }}" @@ -22,13 +35,13 @@ - name: Set facts for all hosts - use facts from localhost - SAP HANA ansible.builtin.set_fact: - sap_hana_sid: "{{ sap_hana_sid | default(sap_system_hana_db_sid) }}" + sap_hana_install_sid: "{{ sap_hana_install_sid | default(sap_system_hana_db_sid) }}" sap_hana_install_instance_nr: "{{ sap_hana_install_instance_nr | default(sap_system_hana_db_instance_nr) }}" sap_hana_install_use_master_password: "{{ sap_hana_install_use_master_password | default('y') }}" sap_hana_install_master_password: "{{ sap_hana_install_master_password | default('') }}" sap_hana_install_software_directory: "{{ sap_software_download_directory | default('/software') }}" when: - - (sap_hana_sid is defined or sap_system_hana_db_sid is defined) or (hostvars[inventory_hostname].vars['sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary'][sap_vm_provision_host_specification_plan][inventory_hostname].sap_system_hana_db_sid is defined) + - (sap_hana_install_sid is defined or sap_system_hana_db_sid is defined) or (hostvars[inventory_hostname].vars['sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary'][sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].sap_system_hana_db_sid is defined) - name: Set facts for all hosts - use facts from localhost - SAP SWPM @@ -42,7 +55,7 @@ sap_swpm_db_sid: "{{ sap_swpm_db_sid | default(sap_system_hana_db_sid) | default('') }}" sap_swpm_db_instance_nr: "{{ sap_swpm_db_instance_nr | default(sap_system_hana_db_instance_nr) | default('') }}" when: - - (sap_swpm_sid is defined or sap_system_sid is defined) or (hostvars[inventory_hostname].vars['sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary'][sap_vm_provision_host_specification_plan][inventory_hostname].sap_system_sid is defined) + - (sap_swpm_sid is defined or sap_system_sid is defined) or (hostvars[inventory_hostname].vars['sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary'][sap_vm_provision_host_specification_plan][scaleout_origin_host_spec | default(inventory_hostname)].sap_system_sid is defined) - (sap_swpm_templates_install_dictionary is defined or sap_system_sid is defined) or hostvars[inventory_hostname].sap_swpm_templates_install_dictionary is defined @@ -131,18 +144,6 @@ - sap_vm_provision_iac_platform == "ibmpowervm_vm" or sap_vm_provision_iac_platform == "ibmcloud_powervs" -# Required when defining Ansible Role variables within the host_specifications_dictionary for multiple SAP Systems / SAP Landscapes -- name: Set facts for all hosts - use facts from localhost - SAP Variables from host_specifications_dictionary - ansible.builtin.set_fact: - "{{ host_spec_sap_item }}": "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][inventory_hostname][host_spec_sap_item] }}" - loop: "{{ vars['sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary'][sap_vm_provision_host_specification_plan][inventory_hostname].keys() | map('regex_findall', '^sap_.*') | flatten | select() | list }}" - loop_control: - loop_var: host_spec_sap_item - -- name: Set facts for all hosts - use facts from localhost - Host Specifications Dictionary - ansible.builtin.set_fact: - host_specifications_dictionary: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary') }}" - # Set default to none, this will not set the var if the group does not exist - name: Set facts for all hosts - sap_vm_provision_dynamic_inventory_* hostname variables to identify hosts for other Ansible Roles ansible.builtin.set_fact: diff --git a/roles/sap_vm_provision/tasks/common/set_ansible_vars_storage.yml b/roles/sap_vm_provision/tasks/common/set_ansible_vars_storage.yml index 8bd2674..53bcd0d 100644 --- a/roles/sap_vm_provision/tasks/common/set_ansible_vars_storage.yml +++ b/roles/sap_vm_provision/tasks/common/set_ansible_vars_storage.yml @@ -6,7 +6,7 @@ host_node_scaleout_origin_spec: "{{ ansible_hostname | regex_replace('^(.+?)\\d*$', '\\1') }}" when: - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined - - not inventory_hostname in vars[ansible_prompt_iac_platform_choice + '_host_specifications_dictionary'][sap_vm_provision_host_specification_plan].keys() + - not inventory_hostname in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail # For end user ease of use, the host specifications dictionary uses disk_count to indicate how many disks will be provisioned diff --git a/roles/sap_vm_provision/tasks/common/set_etc_hosts_ha.yml b/roles/sap_vm_provision/tasks/common/set_etc_hosts_ha.yml index db414e4..dd9e6f3 100644 --- a/roles/sap_vm_provision/tasks/common/set_etc_hosts_ha.yml +++ b/roles/sap_vm_provision/tasks/common/set_etc_hosts_ha.yml @@ -87,8 +87,8 @@ # - "{{ sap_vm_provision_dynamic_inventory_nw_pas_ip }}\t{{ sap_vm_provision_dynamic_inventory_nw_pas_hostname }}.{{ ansible_domain }}\t{{ sap_vm_provision_dynamic_inventory_nw_pas_hostname }}" # Allows to build ASCS ERS cluster without PAS if PAS details are not provided - "{{ sap_vm_provision_dynamic_inventory_nw_pas_ip | string + '\t' + sap_vm_provision_dynamic_inventory_nw_pas_hostname + '.' + ansible_domain + '\t' + sap_vm_provision_dynamic_inventory_nw_pas_hostname - if (sap_vm_provision_dynamic_inventory_nw_pas_hostname is defined and sap_vm_provision_dynamic_inventory_nw_pas_hostname | length > 0 ) - and (sap_vm_provision_dynamic_inventory_nw_pas_ip is defined and sap_vm_provision_dynamic_inventory_nw_pas_ip | length > 0) else ''}}" + if (sap_vm_provision_dynamic_inventory_nw_pas_hostname is defined and sap_vm_provision_dynamic_inventory_nw_pas_hostname | length > 0 ) + and (sap_vm_provision_dynamic_inventory_nw_pas_ip is defined and sap_vm_provision_dynamic_inventory_nw_pas_ip | length > 0) else ''}}" when: - (groups["nwas_ers"] is defined and (groups["nwas_ers"] | length>0)) - item != '' From 637d236be9c9170f112cf80139c0a772342f8921 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:01:30 -0400 Subject: [PATCH 4/6] sap_vm_provision: initial placement group logic --- roles/sap_vm_provision/PLATFORM_GUIDANCE.md | 15 ++++ roles/sap_vm_provision/defaults/main.yml | 7 ++ .../ibmcloud_powervs/execute_main.yml | 30 +++++++ .../ibmcloud_powervs/execute_provision.yml | 11 +++ .../ibmcloud_vs/execute_main.yml | 18 ++++ .../ibmcloud_vs/execute_provision.yml | 11 +++ .../ibmcloud_vs/execute_setup_ha.yml | 87 +++++++++++++------ 7 files changed, 152 insertions(+), 27 deletions(-) diff --git a/roles/sap_vm_provision/PLATFORM_GUIDANCE.md b/roles/sap_vm_provision/PLATFORM_GUIDANCE.md index d15427e..d99e005 100644 --- a/roles/sap_vm_provision/PLATFORM_GUIDANCE.md +++ b/roles/sap_vm_provision/PLATFORM_GUIDANCE.md @@ -347,3 +347,18 @@ When VMware vCenter and vSphere clusters with VMware NSX virtualized network ove N.B. When VMware vCenter and vSphere clusters with direct network subnet IP allocations to the VMXNet network adapter (no VMware NSX network overlays), the above actions may not be required. + + +## Notice regarding SAP High Availability and hardware placement strategies + +Each Hyperscaler Cloud Service Provider provides a different approach to the placement strategy of a Virtual Machine to the physical/hardware Hypervisor node it runs atop. + +The `sap_vm_provision` Ansible Role enforces scope control for this capability, only providing a "spread" placement strategy for the High Availability scenarios. As such the variable used is `sap_vm_provision_<>_placement_strategy_spread: true/false`. + +The following are the equivalent Placement Strategies, commonly referenced as 'Anti-Affinity', in each Infrastructure Platform: + +- **AWS EC2 VS Placement Group, Spread (Rack level)** - each VS on different hosts, in different racks with distinct network source and power supply +- **GCP CE VM Placement Policy, Spread** - each VM on different hosts, in different racks with distinct power supply (dual redundancy from different sources) +- **IBM Cloud VS Placement Group Strategy, Power Spread** - each VS on different hosts, in different racks with distinct network source and power supplies (dual redundancy from different sources) +- **IBM Cloud, IBM Power VS Placement Group Colocation Policy, Different Server Spread** - each VS on different hosts, in different racks with distinct network source and power supplies (dual redundancy from different sources) +- **MS Azure VM Availability Set, Fault Domain Spread** - each VM on different hosts, in different racks with distinct network source and power supply diff --git a/roles/sap_vm_provision/defaults/main.yml b/roles/sap_vm_provision/defaults/main.yml index f960b73..767d5e4 100644 --- a/roles/sap_vm_provision/defaults/main.yml +++ b/roles/sap_vm_provision/defaults/main.yml @@ -1,5 +1,12 @@ --- +### WIP + +sap_vm_provision_ibmcloud_placement_resource_name: "sap-placement-spread" +sap_vm_provision_ibmcloud_placement_strategy_spread: false + + + #### # VM Provision selection #### diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml index a100ef1..619b451 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml @@ -190,6 +190,36 @@ pi_image_name: "{{ register_ibmcloud_pi_imported_os_image_selected.name }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" + - name: Create IBM Power Infrastructure Server Placement Groups when High Availability + no_log: "{{ __sap_vm_provision_no_log }}" + register: __sap_vm_provision_task_ibmcloud_placement_group + run_once: true + ibm.cloudcollection.ibm_pi_placement_group: + pi_cloud_instance_id: "{{ __sap_vm_provision_task_ibmcloud_pi_workspace_service_instance.resource.guid }}" # must be GUID, not CRN + pi_placement_group_name: "{{ sap_vm_provision_ibmcloud_placement_resource_name }}-{{ item }}" + pi_placement_group_policy: "anti-affinity" + ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" + loop: + - "{{ 'hana' if 'hana_secondary' in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | json_query('*') | map(attribute='sap_host_type') else '' }}" + - "{{ 'anydb' if 'anydb_secondary' in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | json_query('*') | map(attribute='sap_host_type') else '' }}" + - "{{ 'nwas' if 'nwas_ers' in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | json_query('*') | map(attribute='sap_host_type') else '' }}" + when: + - sap_vm_provision_ibmcloud_placement_resource_name is defined + - sap_vm_provision_ibmcloud_placement_strategy_spread + - not item == '' + + - name: Identify created IBM Power Infrastructure Server Placement Groups when High Availability + no_log: "{{ __sap_vm_provision_no_log }}" + register: __sap_vm_provision_task_ibmcloud_placement_groups_list + run_once: true + ibm.cloudcollection.ibm_pi_placement_groups_info: + pi_cloud_instance_id: "{{ __sap_vm_provision_task_ibmcloud_pi_workspace_service_instance.resource.guid }}" # must be GUID, not CRN + ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" + when: + - sap_vm_provision_ibmcloud_placement_resource_name is defined + - sap_vm_provision_ibmcloud_placement_strategy_spread + + - name: Set fact to hold loop variables from include_tasks ansible.builtin.set_fact: register_provisioned_host_all: [] diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml index 1ef2eb9..67100e2 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_provision.yml @@ -43,6 +43,17 @@ pi_pin_policy: none pi_health_status: OK + pi_placement_group_id: "{{ ( + (__sap_vm_provision_task_ibmcloud_placement_groups_list.resource.placement_groups | selectattr('name','search','hana'))[0].id + if ('hana_primary' in target_provision_host_spec.sap_host_type or 'hana_secondary' in target_provision_host_spec.sap_host_type) + else + (__sap_vm_provision_task_ibmcloud_placement_groups_list.resource.placement_groups | selectattr('name','search','anydb'))[0].id + if ('anydb_primary' in target_provision_host_spec.sap_host_type or 'anydb_secondary' in target_provision_host_spec.sap_host_type) + else + (__sap_vm_provision_task_ibmcloud_placement_groups_list.resource.placement_groups | selectattr('name','search','nwas'))[0].id + if ('nwas_ascs' in target_provision_host_spec.sap_host_type or 'nwas_ers' in target_provision_host_spec.sap_host_type) + ) | default(omit) }}" + ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" # Use check to avoid idempotency issues with legacy ibm.cloudcollection Ansible Collection (until ibm.cloud Ansible Collection is out of beta) diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml index 5ffcbb2..7aa7a5b 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_main.yml @@ -80,6 +80,24 @@ status: available ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" + - name: Create Placement Groups when High Availability + no_log: "{{ __sap_vm_provision_no_log }}" + register: __sap_vm_provision_task_ibmcloud_placement_group + run_once: true + ibm.cloudcollection.ibm_is_placement_group: + resource_group: "{{ __sap_vm_provision_task_ibmcloud_resource_group.resource.id }}" + name: "{{ sap_vm_provision_ibmcloud_placement_resource_name }}-{{ item }}" + strategy: power_spread + ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" + loop: + - "{{ 'hana' if 'hana_secondary' in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | json_query('*') | map(attribute='sap_host_type') else '' }}" + - "{{ 'anydb' if 'anydb_secondary' in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | json_query('*') | map(attribute='sap_host_type') else '' }}" + - "{{ 'nwas' if 'nwas_ers' in lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | json_query('*') | map(attribute='sap_host_type') else '' }}" + when: + - sap_vm_provision_ibmcloud_placement_resource_name is defined + - sap_vm_provision_ibmcloud_placement_strategy_spread + - not item == '' + - name: Set fact to hold loop variables from include_tasks ansible.builtin.set_fact: register_provisioned_host_all: [] diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml index 1b14e58..8718f56 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_provision.yml @@ -51,6 +51,17 @@ protocol: https response_hop_limit: 5 + placement_group: "{{ ( + (__sap_vm_provision_task_ibmcloud_placement_group.results | selectattr('item','==','hana'))[0].resource.id + if ('hana_primary' in target_provision_host_spec.sap_host_type or 'hana_secondary' in target_provision_host_spec.sap_host_type) + else + (__sap_vm_provision_task_ibmcloud_placement_group.results | selectattr('item','==','anydb'))[0].resource.id + if ('anydb_primary' in target_provision_host_spec.sap_host_type or 'anydb_secondary' in target_provision_host_spec.sap_host_type) + else + (__sap_vm_provision_task_ibmcloud_placement_group.results | selectattr('item','==','nwas'))[0].resource.id + if ('nwas_ascs' in target_provision_host_spec.sap_host_type or 'nwas_ers' in target_provision_host_spec.sap_host_type) + ) | default(omit) }}" + ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml index adde1c6..7e5ad4a 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml @@ -39,9 +39,9 @@ logging: true # For ALB L7, not NLB L4 #profile: network-fixed / dynamic # For NLB L4, not ALB L7 #route_mode: false # For NLB L4, not ALB L7 - # dns: # Unsupported by legacy Ansible Collection, use IBM Cloud CLI as workaround - # instance_crn: "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.resource_crn }}" - # zone_id: "{{ (__sap_vm_provision_task_ibmcloud_pdns.resource.dns_zones | selectattr('name', '==', sap_vm_provision_dns_root_domain) | first).zone_id }}" + dns: + instance_crn: "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.resource_crn }}" + zone_id: "{{ (__sap_vm_provision_task_ibmcloud_pdns.resource.dns_zones | selectattr('name', '==', sap_vm_provision_dns_root_domain) | first).zone_id }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" loop: - "{{ sap_vm_provision_ha_load_balancer_name_hana if (groups['hana_secondary'] is defined and (groups['hana_secondary'] | length>0)) else '' }}" @@ -65,20 +65,20 @@ # failed_when: not __sap_vm_provision_task_ibmcloud_lb_provision_parallel_async_status.rc == 0 # Workaround to missing Ansible Module functionality in legacy Ansible Collection -- name: IBM Cloud CLI append DNS to Load Balancer - no_log: "{{ __sap_vm_provision_no_log }}" - register: __sap_vm_provision_task_ibmcloud_lb_update_dns - ansible.builtin.shell: | - ibmcloud config --quiet --check-version false && ibmcloud login --apikey="{{ sap_vm_provision_ibmcloud_api_key }}" -g {{ sap_vm_provision_ibmcloud_resource_group_name }} -r {{ sap_vm_provision_ibmcloud_region }} --quiet - ibmcloud plugin install infrastructure-service -f --quiet - ibmcloud is load-balancer-update "{{ item }}" --dns-instance-crn "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.resource_crn }}" --dns-zone-id "{{ (__sap_vm_provision_task_ibmcloud_pdns.resource.dns_zones | selectattr('name', '==', sap_vm_provision_dns_root_domain) | first).zone_id }}" - loop: - - "{{ sap_vm_provision_ha_load_balancer_name_hana if (groups['hana_secondary'] is defined and (groups['hana_secondary'] | length>0)) else '' }}" - - "{{ sap_vm_provision_ha_load_balancer_name_anydb if (groups['anydb_secondary'] is defined and (groups['anydb_secondary'] | length>0)) else '' }}" - - "{{ sap_vm_provision_ha_load_balancer_name_nwas + '-ascs' if (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) else '' }}" - - "{{ sap_vm_provision_ha_load_balancer_name_nwas + '-ers' if (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) else '' }}" - when: not item == '' - failed_when: not __sap_vm_provision_task_ibmcloud_lb_update_dns.rc == 0 and not 'nothing to update the load balancer with' in __sap_vm_provision_task_ibmcloud_lb_update_dns.stderr +# - name: IBM Cloud CLI append DNS to Load Balancer +# no_log: "{{ __sap_vm_provision_no_log }}" +# register: __sap_vm_provision_task_ibmcloud_lb_update_dns +# ansible.builtin.shell: | +# ibmcloud config --quiet --check-version false && ibmcloud login --apikey="{{ sap_vm_provision_ibmcloud_api_key }}" -g {{ sap_vm_provision_ibmcloud_resource_group_name }} -r {{ sap_vm_provision_ibmcloud_region }} --quiet +# ibmcloud plugin install infrastructure-service -f --quiet +# ibmcloud is load-balancer-update "{{ item }}" --dns-instance-crn "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.resource_crn }}" --dns-zone-id "{{ (__sap_vm_provision_task_ibmcloud_pdns.resource.dns_zones | selectattr('name', '==', sap_vm_provision_dns_root_domain) | first).zone_id }}" +# loop: +# - "{{ sap_vm_provision_ha_load_balancer_name_hana if (groups['hana_secondary'] is defined and (groups['hana_secondary'] | length>0)) else '' }}" +# - "{{ sap_vm_provision_ha_load_balancer_name_anydb if (groups['anydb_secondary'] is defined and (groups['anydb_secondary'] | length>0)) else '' }}" +# - "{{ sap_vm_provision_ha_load_balancer_name_nwas + '-ascs' if (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) else '' }}" +# - "{{ sap_vm_provision_ha_load_balancer_name_nwas + '-ers' if (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) else '' }}" +# when: not item == '' +# failed_when: not __sap_vm_provision_task_ibmcloud_lb_update_dns.rc == 0 and not 'nothing to update the load balancer with' in __sap_vm_provision_task_ibmcloud_lb_update_dns.stderr - name: Identify IBM Cloud Virtual Servers info no_log: "{{ __sap_vm_provision_no_log }}" @@ -87,6 +87,11 @@ vpc: "{{ __sap_vm_provision_task_ibmcloud_vpc_subnet.resource.vpc }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" +# - name: Identify IBM Cloud Load Balancers info +# no_log: "{{ __sap_vm_provision_no_log }}" +# register: __sap_vm_provision_task_ibmcloud_lb_all_info +# ibm.cloudcollection.ibm_is_lbs_info: +# ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" # Workaround for bug which populates region and ibmcloud_api_key as TF arguments for ibm_is_lbs_info Ansible Module in legacy Ansible Collection - name: IBM Cloud CLI execution to list Load Balancer/s info @@ -177,7 +182,7 @@ - name: Create IBM Cloud Load Balancer Back-end Pool for SAP AnyDB - IBM Db2 Communication Port no_log: "{{ __sap_vm_provision_no_log }}" ibm.cloudcollection.ibm_is_lb_pool: - name: "{{ sap_vm_provision_ha_load_balancer_name_anydb + '-ibmdb2' }}" + name: "{{ sap_vm_provision_ha_load_balancer_name_anydb + '-pool-ibmdb2' }}" lb: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].id }}" algorithm: weighted_round_robin protocol: tcp @@ -508,8 +513,8 @@ no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_lb_pool_members_anydb1 ibm.cloudcollection.ibm_is_lb_pool_member: - lb: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].id }}" - pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb + '-anydb-pool-ibmdb2'))[0].id }}" + lb: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].id }}" + pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb + '-pool-ibmdb2'))[0].id }}" target_address: "{{ (__sap_vm_provision_task_ibmcloud_vs_all_info.resource.instances | selectattr('name', '==', host_node))[0].primary_network_interface[0].primary_ipv4_address }}" port: 5912 weight: 100 @@ -526,7 +531,7 @@ register: __sap_vm_provision_task_ibmcloud_lb_pool_members_anydb2 ibm.cloudcollection.ibm_is_lb_pool_member: lb: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].id }}" - pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb + '-anydb-pool-ibmdb2'))[0].id }}" + pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb + '-pool-ibmdb2'))[0].id }}" target_address: "{{ (__sap_vm_provision_task_ibmcloud_vs_all_info.resource.instances | selectattr('name', '==', host_node))[0].primary_network_interface[0].primary_ipv4_address }}" port: 5912 weight: 1 @@ -890,6 +895,12 @@ # Create IBM Cloud Load Balancer Front-end Listeners (open port for Virtual IPs) +# When IBM Cloud Load Balancer, Application Load Balancer Type: +# - Important to increase the Front-end Listener Idle Connection Timeout (sec), +# if the received-and-forwarded request becomes idle (no data received/sent sent/received) +# then the idle connection is closed by default/minimum after 50 seconds and maximum 7200 seconds (2 hours). +# - This can impact SAP SWPM waiting for SAP HANA Data Load to complete, and other long-running actions. + - name: Create IBM Cloud Load Balancer Front-end Listener for SAP HANA - System DB SQL no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana1 @@ -898,6 +909,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_hana + '-pool-sysdb-sql'))[0].id }}" protocol: tcp port: "{{ ('3' + sap_system_hana_db_instance_nr + '13') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['hana_secondary'] is defined and (groups['hana_secondary'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana1.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana1.stderr @@ -910,6 +922,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_hana + '-pool-mdc1-sql'))[0].id }}" protocol: tcp port: "{{ ('3' + sap_system_hana_db_instance_nr + '15') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['hana_secondary'] is defined and (groups['hana_secondary'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana2.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana2.stderr @@ -922,6 +935,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_hana + '-pool-startsrv-http'))[0].id }}" protocol: tcp port: "{{ ('5' + sap_system_hana_db_instance_nr + '13') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['hana_secondary'] is defined and (groups['hana_secondary'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana3.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana3.stderr @@ -934,6 +948,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_hana + '-pool-startsrv-https'))[0].id }}" protocol: tcp port: "{{ ('5' + sap_system_hana_db_instance_nr + '14') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['hana_secondary'] is defined and (groups['hana_secondary'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana4.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_hana4.stderr @@ -943,9 +958,10 @@ register: __sap_vm_provision_task_ibmcloud_lb_frontend_listener_anydb1 ibm.cloudcollection.ibm_is_lb_listener: lb: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].id }}" - default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb + '-anydb-pool-ibmdb2'))[0].id }}" + default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb + '-pool-ibmdb2'))[0].id }}" protocol: tcp port: 5912 + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['anydb_secondary'] is defined and (groups['anydb_secondary'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_anydb1.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_anydb1.stderr @@ -958,6 +974,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ascs-pool-dp'))[0].id }}" protocol: tcp port: "{{ ('32' + sap_system_nwas_abap_ascs_instance_nr) | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs1.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs1.stderr @@ -970,6 +987,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ascs-pool-ms'))[0].id }}" protocol: tcp port: "{{ ('36' + sap_system_nwas_abap_ascs_instance_nr) | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs2.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs2.stderr @@ -982,6 +1000,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ascs-pool-enq'))[0].id }}" protocol: tcp port: "{{ ('39' + sap_system_nwas_abap_ascs_instance_nr) | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs3.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs3.stderr @@ -994,6 +1013,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ascs-pool-sapctrl'))[0].id }}" protocol: tcp port: "{{ ('5' + sap_system_nwas_abap_ascs_instance_nr + '13') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs4.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs4.stderr @@ -1006,6 +1026,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ascs-pool-sapctrls'))[0].id }}" protocol: tcp port: "{{ ('5' + sap_system_nwas_abap_ascs_instance_nr + '14') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs5.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ascs5.stderr @@ -1018,6 +1039,7 @@ # default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ers-pool-dp'))[0].id }}" # protocol: tcp # port: "{{ ('32' + sap_system_nwas_abap_ers_instance_nr) | int }}" +# idle_connection_timeout: 600 # 10 minutes # ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" # when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) # failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers1.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers1.stderr @@ -1030,6 +1052,7 @@ # default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ers-pool-ms'))[0].id }}" # protocol: tcp # port: "{{ ('36' + sap_system_nwas_abap_ers_instance_nr) | int }}" +# idle_connection_timeout: 600 # 10 minutes # ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" # when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) # failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers2.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers2.stderr @@ -1042,6 +1065,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ers-pool-enqr'))[0].id }}" protocol: tcp port: "{{ ('39' + sap_system_nwas_abap_ers_instance_nr) | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers3.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers3.stderr @@ -1054,6 +1078,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ers-pool-sapctrl'))[0].id }}" protocol: tcp port: "{{ ('5' + sap_system_nwas_abap_ers_instance_nr + '13') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers4.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers4.stderr @@ -1066,6 +1091,7 @@ default_pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ers-pool-sapctrls'))[0].id }}" protocol: tcp port: "{{ ('5' + sap_system_nwas_abap_ers_instance_nr + '14') | int }}" + idle_connection_timeout: 600 # 10 minutes ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" when: (groups['nwas_ers'] is defined and (groups['nwas_ers'] | length>0)) failed_when: not __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers5.rc == 0 and not 'listener_duplicate_port' in __sap_vm_provision_task_ibmcloud_lb_frontend_listener_ers5.stderr @@ -1146,26 +1172,33 @@ - groups["nwas_ers"] is defined and (groups["nwas_ers"]|length>0) -- name: Set facts for all hosts - use facts from IBM Cloud Load Balancer - SAP HANA +- name: Set facts for all hosts - use facts from localhost - HA/DR - IBM Cloud Load Balancer - SAP HANA ansible.builtin.set_fact: sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_hana))[0].private_ips[0].address }}" when: - sap_ha_pacemaker_cluster_ibmcloud_region is defined - groups["hana_secondary"] is defined and (groups["hana_secondary"]|length>0) + delegate_to: "{{ item }}" + delegate_facts: true + loop: "{{ groups_merged_list }}" - -- name: Set facts for all hosts - use facts from IBM Cloud Load Balancer - SAP AnyDB +- name: Set facts for all hosts - use facts from localhost - HA/DR - IBM Cloud Load Balancer - SAP AnyDB ansible.builtin.set_fact: sap_vm_temp_vip_anydb_primary: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].private_ips[0].address }}" when: - sap_ha_pacemaker_cluster_ibmcloud_region is defined - groups["anydb_secondary"] is defined and (groups["anydb_secondary"]|length>0) + delegate_to: "{{ item }}" + delegate_facts: true + loop: "{{ groups_merged_list }}" - -- name: Set facts for all hosts - use facts from IBM Cloud Load Balancer - SAP NetWeaver +- name: Set facts for all hosts - use facts from localhost - HA/DR - IBM Cloud Load Balancer - SAP NetWeaver ansible.builtin.set_fact: sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ascs'))[0].private_ips[0].address }}" sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_nwas + '-ers'))[0].private_ips[0].address }}" when: - sap_ha_pacemaker_cluster_ibmcloud_region is defined - groups["nwas_ers"] is defined and (groups["nwas_ers"]|length>0) + delegate_to: "{{ item }}" + delegate_facts: true + loop: "{{ groups_merged_list }}" From 41520496122db60c4d4e109a33a0baf69fc57b60 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:13:20 -0400 Subject: [PATCH 5/6] sap_vm_provision: fix lint whitespace --- .../tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml index 7e5ad4a..9c2ee6e 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_vs/execute_setup_ha.yml @@ -513,7 +513,7 @@ no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_lb_pool_members_anydb1 ibm.cloudcollection.ibm_is_lb_pool_member: - lb: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].id }}" + lb: "{{ (ibmcloud_lbs_all_info | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb))[0].id }}" pool: "{{ (__sap_vm_provision_task_ibmcloud_lb_pools.results | json_query('[*].resource.pools') | flatten | selectattr('name', '==', sap_vm_provision_ha_load_balancer_name_anydb + '-pool-ibmdb2'))[0].id }}" target_address: "{{ (__sap_vm_provision_task_ibmcloud_vs_all_info.resource.instances | selectattr('name', '==', host_node))[0].primary_network_interface[0].primary_ipv4_address }}" port: 5912 From 5525ac7d6fa5dce06b3cf2273ca733970602006b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:26:47 +0100 Subject: [PATCH 6/6] sap_vm_provision: amend defaults file with placement vars --- roles/sap_vm_provision/defaults/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/sap_vm_provision/defaults/main.yml b/roles/sap_vm_provision/defaults/main.yml index 767d5e4..2b8e4be 100644 --- a/roles/sap_vm_provision/defaults/main.yml +++ b/roles/sap_vm_provision/defaults/main.yml @@ -1,12 +1,5 @@ --- -### WIP - -sap_vm_provision_ibmcloud_placement_resource_name: "sap-placement-spread" -sap_vm_provision_ibmcloud_placement_strategy_spread: false - - - #### # VM Provision selection #### @@ -146,6 +139,8 @@ sap_vm_provision_aws_vpc_subnet_id: "" # if ansible_to_terraform, use "new" sap_vm_provision_aws_vpc_subnet_create_boolean: "{{ true | default(false) if sap_vm_provision_aws_vpc_subnet_id == 'new' else false }}" sap_vm_provision_aws_vpc_sg_names: "" # comma-separated, if ansible_to_terraform then ignore this variable sap_vm_provision_aws_key_pair_name_ssh_host_public_key: "" +sap_vm_provision_aws_placement_resource_name: "sap-placement-spread" +sap_vm_provision_aws_placement_strategy_spread: false # Google Cloud sap_vm_provision_gcp_credentials_json: "" @@ -154,6 +149,8 @@ sap_vm_provision_gcp_region: "{{ sap_vm_provision_gcp_region_zone[:-2] }}" sap_vm_provision_gcp_region_zone: "" sap_vm_provision_gcp_vpc_name: "" sap_vm_provision_gcp_vpc_subnet_name: "" +sap_vm_provision_gcp_placement_resource_name: "sap-placement-spread" +sap_vm_provision_gcp_placement_strategy_spread: false # IBM Cloud sap_vm_provision_ibmcloud_api_key: "" @@ -166,6 +163,8 @@ sap_vm_provision_ibmcloud_vpc_name: "" sap_vm_provision_ibmcloud_vpc_subnet_name: "" sap_vm_provision_ibmcloud_vpc_sg_names: "" # comma-separated, if ansible_to_terraform then ignore this variable sap_vm_provision_ibmcloud_key_pair_name_ssh_host_public_key: "" +sap_vm_provision_ibmcloud_placement_resource_name: "sap-placement-spread" +sap_vm_provision_ibmcloud_placement_strategy_spread: false # IBM Cloud, addendum for IBM Power VS sap_vm_provision_ibmcloud_powervs_location: "" @@ -185,7 +184,8 @@ sap_vm_provision_msazure_location_availability_zone_no: 1 sap_vm_provision_msazure_vnet_name: "" sap_vm_provision_msazure_vnet_subnet_name: "" sap_vm_provision_msazure_key_pair_name_ssh_host_public_key: "" - +sap_vm_provision_msazure_placement_resource_name: "sap-placement-spread" +sap_vm_provision_msazure_placement_strategy_spread: false #### # Infrastructure Platform - Cloud Hyperscaler - High Availability resources