community.sap_install
community.sap_install copied to clipboard
SAP HA Prepare Pacemaker - (HANA primary) Verify that the VIP is defined
getting error , not sure where to input the VIP address.
TASK [community.sap_install.sap_ha_pacemaker_cluster : SAP HA Prepare Pacemaker - (HANA primary) Verify that the VIP is defined] *******************************************
fatal: [10.180.1.30]: FAILED! => {
"assertion": "__sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | length > 0",
"changed": false,
"evaluated_to": false,
"msg": "Host type = ['hana_scaleup_perf']\nRequired input 'sap_ha_pacemaker_cluster_vip_hana_primary_ip_address' is not defined or empty.\n"
}
fatal: [10.180.0.212]: FAILED! => {
"assertion": "__sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | length > 0",
"changed": false,
"evaluated_to": false,
"msg": "Host type = ['hana_scaleup_perf']\nRequired input 'sap_ha_pacemaker_cluster_vip_hana_primary_ip_address' is not defined or empty.\n"
}
As the error message says. The variable sap_ha_pacemaker_cluster_vip_hana_primary_ip_address is not defined.
The VIP is used for the IP address resource that is moved/controlled by the cluster.
Hence the IP address needs to be defined on both hosts (/etc/hosts and/or DNS) and you have to set the above variable to this IP address.
i set the parameter and also have entry in /etc/hosts , however the error is same.
i see one of the file inside /etc/ansible/roles/sap_ha_pacemaker_cluster/defaults/main.yml , has a parameter with VIP
# Mandatory: primary VIP address definition in HANA scale-up clusters
sap_ha_pacemaker_cluster_vip_hana_primary_ip_address
Do i have to set the IP in this configuration file step ?
it is failing at this step TASK [community.sap_install.sap_ha_pacemaker_cluster : SAP HA Prepare Pacemaker - (HANA primary) Verify that the VIP is defined]
@rushins Ansible Collecton version number please?
You do not need to pre-set the /etc/hosts file.
Your Ansible Playbook should have an Ansible Extravars file with this variable declared, or an in-line variable declared when your Ansible Task executes the Ansible Role. See example below
# AWS: the VIP must be **outside** of any VPC Subnet ranges (e.g. 192.168.100.102/32)
# GCP: the VIP must be within the VPC Subnetwork range attached to GCP Backend Service for the Internal passthrough Network Load Balancer (e.g. 10.10.10.10/32)
# IBM Cloud: the VIP is within the VPC Subnet range and is statically defined by the IBM Cloud Load Balancer [NLB L4 or ALB L7], variable should be commented out
# IBM Cloud, Power VS: the VIP must be within the IBM Power Infrastructure VLAN Subnet range (e.g. 192.168.4.4/26)
# MS Azure: the VIP must be within the VNet Subnet range attached to the Azure Load Balancer [NLB L4] (e.g. 10.10.10.10/22)
# IBM PowerVM: the VIP must be within the VLAN Subnet range
# OVirt KVM: the VIP must be within the VLAN Subnet range
# KubeVirt: the VIP must be within the VLAN Subnet range
sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: "ENTER_STRING_VALUE_HERE"
@rushins There are 2 places where this is defined:
- defaults file you found, where it is only defined so rest of code can pass through.
- your variable, which is then validated by assert task you mentioned: It is already defined in step 1 so we validate if it is non-empty (character length more than zero).
Example from my HANA HA variable file:
sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: "192.168.1.90/32"
@sean-freeman i found the following parameter in main.yml under directory /etc/ansible/roles/sap_ha_pacemaker_cluster/vars
---
# By default use the construction of IPaddr2 VIP resources.
# Platforms define different methods as applicable.
sap_ha_pacemaker_cluster_vip_method: ipaddr
is this the place i need to add the IP address ? i have checked all folders below
-rw-r--r--. 1 root root 6421 Feb 8 01:22 DEPRECATED_VARIABLES.md
drwxr-xr-x. 2 root root 4096 Feb 8 01:22 meta
drwxr-xr-x. 2 root root 4096 Feb 8 01:22 handlers
drwxr-xr-x. 2 root root 4096 Feb 8 01:22 defaults
-rw-r--r--. 1 root root 46401 Feb 8 01:22 README.md
drwxr-xr-x. 2 root root 4096 Feb 8 01:22 templates
drwxr-xr-x. 5 root root 4096 Feb 8 01:22 tasks
drwxr-xr-x. 2 root root 4096 Feb 8 01:22 vars
@rushins VIP methods do not come into play because even initial checks failed, because you did not define sap_ha_pacemaker_cluster_vip_hana_primary_ip_address.
Assert is one of first things that is executed after initial load of variables (user defined and predefined), so VIP definition and its methods did not even trigger for you.
Assert in question will trigger for every run for HANA, regardless of method.
sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0
You have multiple places where you can define this variable following https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#understanding-variable-precedence .
- Defining it as extravar will always take precedence, but since we have defined it as
''in defaults, it will be overwritten by any other input you define.
@rushins Please confirm if this issue was resolved so we can close it.
Closing this issue as it was explained how variable is handled.