From e401b3b7a87e920eae14326fc4f9dcb737d1040c Mon Sep 17 00:00:00 2001 From: Xabier Arbulu Insausti Date: Thu, 22 Feb 2024 11:51:53 +0100 Subject: [PATCH] Cluster node status (#2341) * Parse cluster node status in discovery * Update openapi schema * Remove new fields from v1 clusters endpoint * Remove the new status field from required, makes the upcast fail --- .../value_objects/ascs_ers_cluster_node.ex | 1 + .../value_objects/hana_cluster_node.ex | 1 + .../cluster/crmmon_discovery_payload.ex | 17 +- .../discovery/policies/cluster_policy.ex | 20 +- lib/trento_web/openapi/v2/schema/cluster.ex | 5 + lib/trento_web/views/v1/cluster_view.ex | 2 +- ...r_discovery_hana_scale_up_node_status.json | 1134 +++++++++++++++++ test/support/factory.ex | 2 + .../policies/cluster_policy_test.exs | 66 +- .../trento_web/views/v1/cluster_view_test.exs | 4 +- 10 files changed, 1243 insertions(+), 9 deletions(-) create mode 100644 test/fixtures/discovery/ha_cluster_discovery_hana_scale_up_node_status.json diff --git a/lib/trento/clusters/value_objects/ascs_ers_cluster_node.ex b/lib/trento/clusters/value_objects/ascs_ers_cluster_node.ex index 9df69d963d..a2c5888925 100644 --- a/lib/trento/clusters/value_objects/ascs_ers_cluster_node.ex +++ b/lib/trento/clusters/value_objects/ascs_ers_cluster_node.ex @@ -19,6 +19,7 @@ defmodule Trento.Clusters.ValueObjects.AscsErsClusterNode do field :virtual_ips, {:array, :string} field :filesystems, {:array, :string} field :attributes, {:map, :string} + field :status, :string embeds_many :resources, ClusterResource end diff --git a/lib/trento/clusters/value_objects/hana_cluster_node.ex b/lib/trento/clusters/value_objects/hana_cluster_node.ex index 6d8868bf3d..10ecd8e290 100644 --- a/lib/trento/clusters/value_objects/hana_cluster_node.ex +++ b/lib/trento/clusters/value_objects/hana_cluster_node.ex @@ -22,6 +22,7 @@ defmodule Trento.Clusters.ValueObjects.HanaClusterNode do field :virtual_ip, :string field :nameserver_actual_role, :string field :indexserver_actual_role, :string + field :status, :string embeds_many :resources, ClusterResource end diff --git a/lib/trento/discovery/payloads/cluster/crmmon_discovery_payload.ex b/lib/trento/discovery/payloads/cluster/crmmon_discovery_payload.ex index 6a9fb52407..29a2e80234 100644 --- a/lib/trento/discovery/payloads/cluster/crmmon_discovery_payload.ex +++ b/lib/trento/discovery/payloads/cluster/crmmon_discovery_payload.ex @@ -162,6 +162,11 @@ defmodule Trento.Discovery.Payloads.Cluster.CrmmonDiscoveryPayload do field :name, :string field :online, :boolean field :unclean, :boolean + field :standby, :boolean + field :standby_on_fail, :boolean + field :maintenance, :boolean + field :pending, :boolean + field :shutdown, :boolean end embeds_many :resources, CrmmonResource @@ -215,7 +220,17 @@ defmodule Trento.Discovery.Payloads.Cluster.CrmmonDiscoveryPayload do defp nodes_changeset(nodes, attrs) do nodes - |> cast(attrs, [:id, :name, :online, :unclean]) + |> cast(attrs, [ + :id, + :name, + :online, + :unclean, + :standby, + :standby_on_fail, + :maintenance, + :pending, + :shutdown + ]) |> validate_required([:id, :name]) end diff --git a/lib/trento/discovery/policies/cluster_policy.ex b/lib/trento/discovery/policies/cluster_policy.ex index 22e6aae9d7..7e3d17cafa 100644 --- a/lib/trento/discovery/policies/cluster_policy.ex +++ b/lib/trento/discovery/policies/cluster_policy.ex @@ -213,7 +213,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicy do }, sid ) do - Enum.map(nodes, fn %{name: name} -> + Enum.map(nodes, fn %{name: name} = node -> attributes = nodes_with_attributes |> Enum.find_value([], fn @@ -250,7 +250,8 @@ defmodule Trento.Discovery.Policies.ClusterPolicy do hana_status: "Unknown", virtual_ip: virtual_ip, nameserver_actual_role: nameserver_actual_role, - indexserver_actual_role: indexserver_actual_role + indexserver_actual_role: indexserver_actual_role, + status: parse_node_status(node) } hana_status = @@ -290,6 +291,16 @@ defmodule Trento.Discovery.Policies.ClusterPolicy do %{indexserver_actual_role: "", nameserver_actual_role: ""} end + defp parse_node_status(%{online: false}), do: "Offline" + defp parse_node_status(%{unclean: true}), do: "Unclean" + defp parse_node_status(%{standby: true}), do: "Standby" + defp parse_node_status(%{maintenance: true}), do: "Maintenance" + defp parse_node_status(%{shutdown: true}), do: "Shutdown" + defp parse_node_status(%{pending: true}), do: "Pending" + defp parse_node_status(%{standby_on_fail: true}), do: "Standby on fail" + defp parse_node_status(%{online: true}), do: "Online" + defp parse_node_status(_), do: "Unknown" + defp parse_hana_scale_up_system_replication_mode([%{attributes: attributes} | _], sid) do Map.get(attributes, "hana_#{String.downcase(sid)}_srmode", "") end @@ -812,7 +823,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicy do }, cib_resources_by_sid ) do - Enum.map(nodes, fn %{name: node_name} -> + Enum.map(nodes, fn %{name: node_name} = node -> cib_resource_ids = Enum.map(cib_resources_by_sid, fn %{id: id} -> id end) crm_node_resources = @@ -851,7 +862,8 @@ defmodule Trento.Discovery.Policies.ClusterPolicy do virtual_ips: parse_resource_by_type(cib_node_resources, virtual_ip_type, "ip"), filesystems: parse_resource_by_type(cib_node_resources, "Filesystem", "directory"), attributes: attributes, - resources: crm_node_resources + resources: crm_node_resources, + status: parse_node_status(node) } end) end diff --git a/lib/trento_web/openapi/v2/schema/cluster.ex b/lib/trento_web/openapi/v2/schema/cluster.ex index 2e6162602f..3722b904da 100644 --- a/lib/trento_web/openapi/v2/schema/cluster.ex +++ b/lib/trento_web/openapi/v2/schema/cluster.ex @@ -23,6 +23,7 @@ defmodule TrentoWeb.OpenApi.V2.Schema.Cluster do indexserver_actual_role: %Schema{type: :string, nullable: true}, nameserver_actual_role: %Schema{type: :string, nullable: true}, hana_status: %Schema{type: :string, deprecated: true}, + status: %Schema{type: :string}, attributes: %Schema{ type: :object, description: "Node attributes", @@ -121,6 +122,10 @@ defmodule TrentoWeb.OpenApi.V2.Schema.Cluster do type: :string, description: "Node name" }, + status: %Schema{ + type: :string, + description: "Node status" + }, resources: %Schema{ type: :array, items: Cluster.ClusterResource, diff --git a/lib/trento_web/views/v1/cluster_view.ex b/lib/trento_web/views/v1/cluster_view.ex index eff378822d..70b82ae65c 100644 --- a/lib/trento_web/views/v1/cluster_view.ex +++ b/lib/trento_web/views/v1/cluster_view.ex @@ -32,7 +32,7 @@ defmodule TrentoWeb.V1.ClusterView do defp adapt_v1(%{type: type, details: %{nodes: nodes} = details} = cluster) when type in [:hana_scale_up, :hana_scale_out] do adapted_nodes = - Enum.map(nodes, &Map.drop(&1, [:indexserver_actual_role, :nameserver_actual_role])) + Enum.map(nodes, &Map.drop(&1, [:indexserver_actual_role, :nameserver_actual_role, :status])) adapted_details = details diff --git a/test/fixtures/discovery/ha_cluster_discovery_hana_scale_up_node_status.json b/test/fixtures/discovery/ha_cluster_discovery_hana_scale_up_node_status.json new file mode 100644 index 0000000000..2947d68071 --- /dev/null +++ b/test/fixtures/discovery/ha_cluster_discovery_hana_scale_up_node_status.json @@ -0,0 +1,1134 @@ +{ + "agent_id": "779cdd70-e9e2-58ca-b18a-bf3eb3f71244", + "discovery_type": "ha_cluster_discovery", + "payload": { + "Cib": { + "Configuration": { + "CrmConfig": { + "ClusterProperties": [ + { + "Id": "cib-bootstrap-options-have-watchdog", + "Name": "have-watchdog", + "Value": "true" + }, + { + "Id": "cib-bootstrap-options-dc-version", + "Name": "dc-version", + "Value": "1.1.18+20180430.b12c320f5-3.15.1-b12c320f5" + }, + { + "Id": "cib-bootstrap-options-cluster-infrastructure", + "Name": "cluster-infrastructure", + "Value": "corosync" + }, + { + "Id": "cib-bootstrap-options-cluster-name", + "Name": "cluster-name", + "Value": "hana_cluster" + }, + { + "Id": "cib-bootstrap-options-stonith-enabled", + "Name": "stonith-enabled", + "Value": "true" + }, + { + "Id": "cib-bootstrap-options-placement-strategy", + "Name": "placement-strategy", + "Value": "balanced" + }, + { + "Id": "cib-bootstrap-options-maintenance-mode", + "Name": "maintenance-mode", + "Value": "false" + } + ] + }, + "Nodes": [ + { + "Id": "1084783375", + "Uname": "node01", + "InstanceAttributes": [ + { + "Id": "nodes-1084783375-lpa_prd_lpt", + "Name": "lpa_prd_lpt", + "Value": "1574095701" + }, + { + "Id": "nodes-1084783375-hana_prd_vhost", + "Name": "hana_prd_vhost", + "Value": "node01" + }, + { + "Id": "nodes-1084783375-hana_prd_site", + "Name": "hana_prd_site", + "Value": "PRIMARY_SITE_NAME" + }, + { + "Id": "nodes-1084783375-hana_prd_op_mode", + "Name": "hana_prd_op_mode", + "Value": "logreplay" + }, + { + "Id": "nodes-1084783375-hana_prd_srmode", + "Name": "hana_prd_srmode", + "Value": "sync" + }, + { + "Id": "nodes-1084783375-hana_prd_remoteHost", + "Name": "hana_prd_remoteHost", + "Value": "node02" + } + ] + }, + { + "Id": "1084783376", + "Uname": "node02", + "InstanceAttributes": [ + { + "Id": "nodes-1084783376-lpa_prd_lpt", + "Name": "lpa_prd_lpt", + "Value": "30" + }, + { + "Id": "nodes-1084783376-hana_prd_op_mode", + "Name": "hana_prd_op_mode", + "Value": "logreplay" + }, + { + "Id": "nodes-1084783376-hana_prd_vhost", + "Name": "hana_prd_vhost", + "Value": "node02" + }, + { + "Id": "nodes-1084783376-hana_prd_remoteHost", + "Name": "hana_prd_remoteHost", + "Value": "node01" + }, + { + "Id": "nodes-1084783376-hana_prd_site", + "Name": "hana_prd_site", + "Value": "SECONDARY_SITE_NAME" + }, + { + "Id": "nodes-1084783376-hana_prd_srmode", + "Name": "hana_prd_srmode", + "Value": "sync" + } + ] + } + ], + "Resources": { + "Primitives": [ + { + "Id": "stonith-sbd", + "Class": "stonith", + "Type": "external/sbd", + "Provider": "", + "InstanceAttributes": [ + { + "Id": "stonith-sbd-instance_attributes-pcmk_delay_max", + "Name": "pcmk_delay_max", + "Value": "30s" + } + ], + "MetaAttributes": null, + "Operations": null + }, + { + "Id": "rsc_ip_PRD_HDB00", + "Class": "ocf", + "Type": "IPaddr2", + "Provider": "heartbeat", + "InstanceAttributes": [ + { + "Id": "rsc_ip_PRD_HDB00-instance_attributes-ip", + "Name": "ip", + "Value": "192.168.123.200" + }, + { + "Id": "rsc_ip_PRD_HDB00-instance_attributes-cidr_netmask", + "Name": "cidr_netmask", + "Value": "24" + }, + { + "Id": "rsc_ip_PRD_HDB00-instance_attributes-nic", + "Name": "nic", + "Value": "eth1" + } + ], + "MetaAttributes": null, + "Operations": [ + { + "Id": "rsc_ip_PRD_HDB00-start-0", + "Name": "start", + "Role": "", + "Interval": "0", + "Timeout": "20" + }, + { + "Id": "rsc_ip_PRD_HDB00-stop-0", + "Name": "stop", + "Role": "", + "Interval": "0", + "Timeout": "20" + }, + { + "Id": "rsc_ip_PRD_HDB00-monitor-10", + "Name": "monitor", + "Role": "", + "Interval": "10", + "Timeout": "20" + } + ] + }, + { + "Id": "test", + "Class": "ocf", + "Type": "Dummy", + "Provider": "heartbeat", + "InstanceAttributes": null, + "MetaAttributes": null, + "Operations": null + }, + { + "Id": "test-stop", + "Class": "ocf", + "Type": "Dummy", + "Provider": "heartbeat", + "InstanceAttributes": null, + "MetaAttributes": [ + { + "Id": "test-stop-meta_attributes-target-role", + "Name": "target-role", + "Value": "Stopped" + } + ], + "Operations": null + } + ], + "Masters": [ + { + "Id": "msl_SAPHana_PRD_HDB00", + "MetaAttributes": [ + { + "Id": "msl_SAPHana_PRD_HDB00-meta_attributes-clone-max", + "Name": "clone-max", + "Value": "2" + }, + { + "Id": "msl_SAPHana_PRD_HDB00-meta_attributes-clone-node-max", + "Name": "clone-node-max", + "Value": "1" + }, + { + "Id": "msl_SAPHana_PRD_HDB00-meta_attributes-interleave", + "Name": "interleave", + "Value": "true" + } + ], + "Primitive": { + "Id": "rsc_SAPHana_PRD_HDB00", + "Class": "ocf", + "Type": "SAPHana", + "Provider": "suse", + "InstanceAttributes": [ + { + "Id": "rsc_SAPHana_PRD_HDB00-instance_attributes-SID", + "Name": "SID", + "Value": "PRD" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-instance_attributes-InstanceNumber", + "Name": "InstanceNumber", + "Value": "00" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-instance_attributes-PREFER_SITE_TAKEOVER", + "Name": "PREFER_SITE_TAKEOVER", + "Value": "True" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-instance_attributes-AUTOMATED_REGISTER", + "Name": "AUTOMATED_REGISTER", + "Value": "False" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-instance_attributes-DUPLICATE_PRIMARY_TIMEOUT", + "Name": "DUPLICATE_PRIMARY_TIMEOUT", + "Value": "7200" + } + ], + "MetaAttributes": null, + "Operations": [ + { + "Id": "rsc_SAPHana_PRD_HDB00-start-0", + "Name": "start", + "Role": "", + "Interval": "0", + "Timeout": "3600" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-stop-0", + "Name": "stop", + "Role": "", + "Interval": "0", + "Timeout": "3600" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-promote-0", + "Name": "promote", + "Role": "", + "Interval": "0", + "Timeout": "3600" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-monitor-60", + "Name": "monitor", + "Role": "Master", + "Interval": "60", + "Timeout": "700" + }, + { + "Id": "rsc_SAPHana_PRD_HDB00-monitor-61", + "Name": "monitor", + "Role": "Slave", + "Interval": "61", + "Timeout": "700" + } + ] + } + } + ], + "Clones": [ + { + "Id": "cln_SAPHanaTopology_PRD_HDB00", + "MetaAttributes": [ + { + "Id": "cln_SAPHanaTopology_PRD_HDB00-meta_attributes-is-managed", + "Name": "is-managed", + "Value": "true" + }, + { + "Id": "cln_SAPHanaTopology_PRD_HDB00-meta_attributes-clone-node-max", + "Name": "clone-node-max", + "Value": "1" + }, + { + "Id": "cln_SAPHanaTopology_PRD_HDB00-meta_attributes-interleave", + "Name": "interleave", + "Value": "true" + } + ], + "Primitive": { + "Id": "rsc_SAPHanaTopology_PRD_HDB00", + "Class": "ocf", + "Type": "SAPHanaTopology", + "Provider": "suse", + "InstanceAttributes": [ + { + "Id": "rsc_SAPHanaTopology_PRD_HDB00-instance_attributes-SID", + "Name": "SID", + "Value": "PRD" + }, + { + "Id": "rsc_SAPHanaTopology_PRD_HDB00-instance_attributes-InstanceNumber", + "Name": "InstanceNumber", + "Value": "00" + } + ], + "MetaAttributes": null, + "Operations": [ + { + "Id": "rsc_SAPHanaTopology_PRD_HDB00-monitor-10", + "Name": "monitor", + "Role": "", + "Interval": "10", + "Timeout": "600" + }, + { + "Id": "rsc_SAPHanaTopology_PRD_HDB00-start-0", + "Name": "start", + "Role": "", + "Interval": "0", + "Timeout": "600" + }, + { + "Id": "rsc_SAPHanaTopology_PRD_HDB00-stop-0", + "Name": "stop", + "Role": "", + "Interval": "0", + "Timeout": "300" + } + ] + } + } + ], + "Groups": [ + { + "Id": "g_ip_PRD_HDB00", + "Primitives": [ + { + "Id": "rsc_ip_PRD_HDB00", + "Class": "ocf", + "Type": "IPaddr2", + "Provider": "heartbeat", + "InstanceAttributes": [ + { + "Id": "rsc_ip_PRD_HDB00-instance_attributes-ip", + "Name": "ip", + "Value": "10.74.1.12" + } + ], + "MetaAttributes": null, + "Operations": null + } + ] + } + ] + }, + "Constraints": { + "RscLocations": [ + { + "Id": "cli-prefer-msl_SAPHana_PRD_HDB00", + "Node": "node01", + "Resource": "msl_SAPHana_PRD_HDB00", + "Role": "Started", + "Score": "INFINITY" + }, + { + "Id": "cli-prefer-cln_SAPHanaTopology_PRD_HDB00", + "Node": "node01", + "Resource": "cln_SAPHanaTopology_PRD_HDB00", + "Role": "Started", + "Score": "INFINITY" + }, + { + "Id": "cli-ban-msl_SAPHana_PRD_HDB00-on-node01", + "Node": "node01", + "Resource": "msl_SAPHana_PRD_HDB00", + "Role": "Started", + "Score": "-INFINITY" + }, + { + "Id": "test", + "Node": "node02", + "Resource": "test", + "Role": "Started", + "Score": "666" + } + ] + } + } + }, + "Crmmon": { + "Version": "2.0.0", + "Summary": { + "Nodes": { + "Number": 2 + }, + "LastChange": { + "Time": "Fri Oct 18 11:48:22 2019" + }, + "Resources": { + "Number": 8, + "Disabled": 1, + "Blocked": 0 + }, + "ClusterOptions": { + "StonithEnabled": true + } + }, + "Nodes": [ + { + "Name": "node01", + "Id": "1084783375", + "Online": false, + "Standby": false, + "StandbyOnFail": false, + "Maintenance": false, + "Pending": false, + "Unclean": false, + "Shutdown": false, + "ExpectedUp": true, + "DC": true, + "ResourcesRunning": 7, + "Type": "member" + }, + { + "Name": "node02", + "Id": "1084783376", + "Online": true, + "Standby": false, + "StandbyOnFail": false, + "Maintenance": false, + "Pending": false, + "Unclean": true, + "Shutdown": false, + "ExpectedUp": true, + "DC": false, + "ResourcesRunning": 5, + "Type": "member" + }, + { + "Name": "node03", + "Id": "1084783376", + "Online": true, + "Standby": true, + "StandbyOnFail": false, + "Maintenance": false, + "Pending": false, + "Unclean": false, + "Shutdown": false, + "ExpectedUp": true, + "DC": false, + "ResourcesRunning": 5, + "Type": "member" + }, + { + "Name": "node04", + "Id": "1084783376", + "Online": true, + "Standby": false, + "StandbyOnFail": false, + "Maintenance": true, + "Pending": false, + "Unclean": false, + "Shutdown": false, + "ExpectedUp": true, + "DC": false, + "ResourcesRunning": 5, + "Type": "member" + }, + { + "Name": "node05", + "Id": "1084783376", + "Online": true, + "Standby": false, + "StandbyOnFail": false, + "Maintenance": false, + "Pending": false, + "Unclean": false, + "Shutdown": true, + "ExpectedUp": true, + "DC": false, + "ResourcesRunning": 5, + "Type": "member" + }, + { + "Name": "node06", + "Id": "1084783376", + "Online": true, + "Standby": false, + "StandbyOnFail": false, + "Maintenance": false, + "Pending": true, + "Unclean": false, + "Shutdown": false, + "ExpectedUp": true, + "DC": false, + "ResourcesRunning": 5, + "Type": "member" + }, + { + "Name": "node07", + "Id": "1084783376", + "Online": true, + "Standby": false, + "StandbyOnFail": true, + "Maintenance": false, + "Pending": false, + "Unclean": false, + "Shutdown": false, + "ExpectedUp": true, + "DC": false, + "ResourcesRunning": 5, + "Type": "member" + }, + { + "Name": "node08", + "Id": "1084783376", + "Online": true, + "Standby": false, + "StandbyOnFail": false, + "Maintenance": false, + "Pending": false, + "Unclean": false, + "Shutdown": false, + "ExpectedUp": true, + "DC": false, + "ResourcesRunning": 5, + "Type": "member" + } + ], + "NodeAttributes": { + "Nodes": [ + { + "Name": "node01", + "Attributes": [ + { + "Name": "hana_prd_clone_state", + "Value": "PROMOTED" + }, + { + "Name": "hana_prd_op_mode", + "Value": "logreplay" + }, + { + "Name": "hana_prd_remoteHost", + "Value": "node02" + }, + { + "Name": "hana_prd_roles", + "Value": "4:P:master1:master:worker:master" + }, + { + "Name": "hana_prd_site", + "Value": "PRIMARY_SITE_NAME" + }, + { + "Name": "hana_prd_srmode", + "Value": "sync" + }, + { + "Name": "hana_prd_sync_state", + "Value": "PRIM" + }, + { + "Name": "hana_prd_version", + "Value": "2.00.040.00.1553674765" + }, + { + "Name": "hana_prd_vhost", + "Value": "node01" + }, + { + "Name": "lpa_prd_lpt", + "Value": "1571392102" + }, + { + "Name": "master-rsc_SAPHana_PRD_HDB00", + "Value": "150" + } + ] + }, + { + "Name": "node02", + "Attributes": [ + { + "Name": "hana_prd_clone_state", + "Value": "DEMOTED" + }, + { + "Name": "hana_prd_op_mode", + "Value": "logreplay" + }, + { + "Name": "hana_prd_remoteHost", + "Value": "node01" + }, + { + "Name": "hana_prd_roles", + "Value": "4:S:master1:master:worker:master" + }, + { + "Name": "hana_prd_site", + "Value": "SECONDARY_SITE_NAME" + }, + { + "Name": "hana_prd_srmode", + "Value": "sync" + }, + { + "Name": "hana_prd_sync_state", + "Value": "SOK" + }, + { + "Name": "hana_prd_version", + "Value": "2.00.040.00.1553674765" + }, + { + "Name": "hana_prd_vhost", + "Value": "node02" + }, + { + "Name": "lpa_prd_lpt", + "Value": "30" + }, + { + "Name": "master-rsc_SAPHana_PRD_HDB00", + "Value": "100" + } + ] + } + ] + }, + "NodeHistory": { + "Nodes": [ + { + "Name": "node01", + "ResourceHistory": [ + { + "Name": "rsc_SAPHana_PRD_HDB00", + "MigrationThreshold": 5000, + "FailCount": 1000000 + }, + { + "Name": "rsc_ip_PRD_HDB00", + "MigrationThreshold": 5000, + "FailCount": 2 + }, + { + "Name": "stonith-sbd", + "MigrationThreshold": 5000, + "FailCount": 0 + }, + { + "Name": "rsc_SAPHanaTopology_PRD_HDB00", + "MigrationThreshold": 1, + "FailCount": 0 + } + ] + }, + { + "Name": "node02", + "ResourceHistory": [ + { + "Name": "rsc_SAPHana_PRD_HDB00", + "MigrationThreshold": 50, + "FailCount": 300 + }, + { + "Name": "rsc_SAPHanaTopology_PRD_HDB00", + "MigrationThreshold": 3, + "FailCount": 0 + }, + { + "Name": "test", + "MigrationThreshold": 5000, + "FailCount": 0 + }, + { + "Name": "test-stop", + "MigrationThreshold": 5000, + "FailCount": 0 + } + ] + } + ] + }, + "Resources": [ + { + "Id": "test-stop", + "Agent": "ocf::heartbeat:Dummy", + "Role": "Stopped", + "Active": false, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 0, + "Node": null + }, + { + "Id": "test", + "Agent": "ocf::heartbeat:Dummy", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node02", + "Id": "1084783376", + "Cached": false + } + }, + { + "Id": "stonith-sbd", + "Agent": "stonith:external/sbd", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783375", + "Cached": false + } + }, + { + "Id": "rsc_ip_PRD_HDB00", + "Agent": "ocf::heartbeat:IPaddr2", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783375", + "Cached": false + } + } + ], + "Clones": [ + { + "Id": "msl_SAPHana_PRD_HDB00", + "MultiState": true, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "Unique": false, + "Resources": [ + { + "Id": "rsc_SAPHana_PRD_HDB00", + "Agent": "ocf::suse:SAPHana", + "Role": "Master", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783375", + "Cached": false + } + }, + { + "Id": "rsc_SAPHana_PRD_HDB00", + "Agent": "ocf::suse:SAPHana", + "Role": "Slave", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node02", + "Id": "1084783376", + "Cached": false + } + } + ] + }, + { + "Id": "cln_SAPHanaTopology_PRD_HDB00", + "MultiState": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "Unique": false, + "Resources": [ + { + "Id": "rsc_SAPHanaTopology_PRD_HDB00", + "Agent": "ocf::suse:SAPHanaTopology", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783375", + "Cached": false + } + }, + { + "Id": "rsc_SAPHanaTopology_PRD_HDB00", + "Agent": "ocf::suse:SAPHanaTopology", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node02", + "Id": "1084783376", + "Cached": false + } + } + ] + }, + { + "Id": "c-clusterfs", + "MultiState": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "Unique": false, + "Resources": [ + { + "Id": "clusterfs", + "Agent": "ocf::heartbeat:Filesystem", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783225", + "Cached": true + } + }, + { + "Id": "clusterfs", + "Agent": "ocf::heartbeat:Filesystem", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node02", + "Id": "1084783226", + "Cached": true + } + }, + { + "Id": "clusterfs", + "Agent": "ocf::heartbeat:Filesystem", + "Role": "Stopped", + "Active": false, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 0, + "Node": null + }, + { + "Id": "clusterfs", + "Agent": "ocf::heartbeat:Filesystem", + "Role": "Stopped", + "Active": false, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 0, + "Node": null + } + ] + } + ], + "Groups": [ + { + "Id": "grp_HA1_ASCS00", + "Resources": [ + { + "Id": "rsc_ip_HA1_ASCS00", + "Agent": "ocf::heartbeat:IPaddr2", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783375", + "Cached": false + } + }, + { + "Id": "rsc_fs_HA1_ASCS00", + "Agent": "ocf::heartbeat:Filesystem", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783375", + "Cached": false + } + }, + { + "Id": "rsc_sap_HA1_ASCS00", + "Agent": "ocf::heartbeat:SAPInstance", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node01", + "Id": "1084783375", + "Cached": false + } + } + ] + }, + { + "Id": "grp_HA1_ERS10", + "Resources": [ + { + "Id": "rsc_ip_HA1_ERS10", + "Agent": "ocf::heartbeat:IPaddr2", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node02", + "Id": "1084783376", + "Cached": false + } + }, + { + "Id": "rsc_fs_HA1_ERS10", + "Agent": "ocf::heartbeat:Filesystem", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node02", + "Id": "1084783376", + "Cached": false + } + }, + { + "Id": "rsc_sap_HA1_ERS10", + "Agent": "ocf::heartbeat:SAPInstance", + "Role": "Started", + "Active": true, + "Orphaned": false, + "Blocked": false, + "Managed": true, + "Failed": false, + "FailureIgnored": false, + "NodesRunningOn": 1, + "Node": { + "Name": "node02", + "Id": "1084783376", + "Cached": false + } + } + ] + } + ] + }, + "SBD": { + "Devices": [ + { + "Device": "/dev/vdc", + "Status": "healthy", + "Dump": { + "Header": "2.1", + "Uuid": "f9ba490e-0f14-4908-859a-ace97aafaf34", + "Slots": 255, + "SectorSize": 512, + "TimeoutWatchdog": 5, + "TimeoutAllocate": 2, + "TimeoutLoop": 1, + "TimeoutMsgwait": 10 + }, + "List": [ + { + "Id": 0, + "Name": "vmhana01", + "Status": "clear" + }, + { + "Id": 1, + "Name": "vmhana02", + "Status": "clear" + } + ] + }, + { + "Device": "/dev/vdb", + "Status": "healthy", + "Dump": { + "Header": "2.1", + "Uuid": "f9ba490e-0f14-4908-859a-ace97aafaf34", + "Slots": 255, + "SectorSize": 512, + "TimeoutWatchdog": 5, + "TimeoutAllocate": 2, + "TimeoutLoop": 1, + "TimeoutMsgwait": 10 + }, + "List": [ + { + "Id": 0, + "Name": "vmhana01", + "Status": "clear" + }, + { + "Id": 1, + "Name": "vmhana02", + "Status": "clear" + } + ] + } + ], + "Config": { + "SBD_OPTS": "", + "SBD_DELAY_START": "no", + "SBD_DEVICE": "/dev/vdc;/dev/vdb", + "SBD_MOVE_TO_ROOT_CGROUP": "auto", + "SBD_PACEMAKER": "yes", + "SBD_STARTMODE": "always", + "SBD_TIMEOUT_ACTION": "flush,reboot", + "SBD_WATCHDOG_DEV": "/dev/watchdog", + "SBD_WATCHDOG_TIMEOUT": "5", + "TEST": "Value", + "TEST2": "Value2" + } + }, + "Id": "47d1190ffb4f781974c8356d7f863b03", + "Name": "hana_cluster", + "DC": true, + "Provider": "azure" + } +} diff --git a/test/support/factory.ex b/test/support/factory.ex index bb9e468178..36d9dcf466 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -461,6 +461,7 @@ defmodule Trento.Factory do def hana_cluster_node_factory do %HanaClusterNode{ attributes: %{"attribute" => Faker.Beer.name()}, + status: "Online", hana_status: "Secondary", virtual_ip: Faker.Internet.ip_v4_address(), name: Faker.StarWars.character(), @@ -485,6 +486,7 @@ defmodule Trento.Factory do roles: [Enum.random(["ascs", "ers"])], virtual_ips: [Faker.Internet.ip_v4_address()], filesystems: [Faker.File.file_name()], + status: "Online", attributes: %{ Faker.Pokemon.name() => Faker.Pokemon.name() }, diff --git a/test/trento/discovery/policies/cluster_policy_test.exs b/test/trento/discovery/policies/cluster_policy_test.exs index 53bca57bed..d967876d23 100644 --- a/test/trento/discovery/policies/cluster_policy_test.exs +++ b/test/trento/discovery/policies/cluster_policy_test.exs @@ -49,6 +49,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "150" }, hana_status: "Primary", + status: "Online", name: "node01", indexserver_actual_role: "master", nameserver_actual_role: "master", @@ -128,6 +129,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "100" }, hana_status: "Secondary", + status: "Online", name: "node02", indexserver_actual_role: "master", nameserver_actual_role: "master", @@ -278,6 +280,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "150" }, hana_status: "Primary", + status: "Online", name: "node01", nameserver_actual_role: "master", indexserver_actual_role: "master", @@ -357,6 +360,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "100" }, hana_status: "Secondary", + status: "Online", name: "node02", indexserver_actual_role: "master", nameserver_actual_role: "master", @@ -502,6 +506,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ascs], virtual_ips: ["10.80.1.25"], filesystems: ["/usr/sap/NWP/ASCS00"], + status: "Online", attributes: %{}, resources: [ %ClusterResource{ @@ -539,6 +544,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ers], virtual_ips: ["10.80.1.26"], filesystems: ["/usr/sap/NWP/ERS10"], + status: "Online", attributes: %{"runs_ers_NWP" => "1"}, resources: [ %ClusterResource{ @@ -620,6 +626,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ascs], virtual_ips: ["10.80.1.25"], filesystems: ["/usr/sap/NWP/ASCS00"], + status: "Online", attributes: %{}, resources: [ %ClusterResource{ @@ -657,6 +664,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ers], virtual_ips: ["10.80.1.26"], filesystems: ["/usr/sap/NWP/ERS10"], + status: "Online", attributes: %{"runs_ers_NWP" => "1"}, resources: [ %ClusterResource{ @@ -733,13 +741,15 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmnwprd01", roles: [:ascs, :ers], virtual_ips: ["10.80.1.25", "10.80.1.26"], - filesystems: ["/usr/sap/NWP/ASCS00", "/usr/sap/NWP/ERS10"] + filesystems: ["/usr/sap/NWP/ASCS00", "/usr/sap/NWP/ERS10"], + status: "Online" }, %AscsErsClusterNode{ name: "vmnwprd02", roles: [], virtual_ips: [], - filesystems: [] + filesystems: [], + status: "Online" } ] } @@ -811,6 +821,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ascs], virtual_ips: ["10.80.1.25"], filesystems: ["/usr/sap/NWP/ASCS00"], + status: "Online", attributes: %{}, resources: [ %ClusterResource{ @@ -848,6 +859,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ers], virtual_ips: ["10.80.1.26"], filesystems: ["/usr/sap/NWP/ERS10"], + status: "Online", attributes: %{"runs_ers_NWD" => "1", "runs_ers_NWP" => "1"}, resources: [ %ClusterResource{ @@ -892,6 +904,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ascs], virtual_ips: ["10.80.2.25"], filesystems: ["/usr/sap/NWD/ASCS01"], + status: "Online", attributes: %{}, resources: [ %ClusterResource{ @@ -929,6 +942,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do roles: [:ers], virtual_ips: ["10.80.2.26"], filesystems: ["/usr/sap/NWD/ERS11"], + status: "Online", attributes: %{"runs_ers_NWD" => "1", "runs_ers_NWP" => "1"}, resources: [ %ClusterResource{ @@ -1210,6 +1224,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "150" }, hana_status: "Primary", + status: "Online", name: "vmhana01", indexserver_actual_role: "master", nameserver_actual_role: "master", @@ -1268,6 +1283,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "100" }, hana_status: "Secondary", + status: "Online", name: "vmhana02", indexserver_actual_role: "master", nameserver_actual_role: "master", @@ -1344,6 +1360,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "-9000" }, hana_status: "Failed", + status: "Online", name: "vmhana01", indexserver_actual_role: nil, nameserver_actual_role: nil, @@ -1388,6 +1405,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "-INFINITY" }, hana_status: "Primary", + status: "Online", name: "vmhana02", indexserver_actual_role: "master", nameserver_actual_role: "master", @@ -1501,6 +1519,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "150" }, hana_status: "Primary", + status: "Online", indexserver_actual_role: "master", nameserver_actual_role: "master", name: "node01", @@ -1582,6 +1601,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do indexserver_actual_role: "master", nameserver_actual_role: "master", hana_status: "Secondary", + status: "Online", name: "node02", resources: [ %ClusterResource{ @@ -1730,6 +1750,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "150" }, hana_status: "Primary", + status: "Online", indexserver_actual_role: "master", name: "node01", nameserver_actual_role: "master", @@ -1774,6 +1795,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do "master-rsc_SAPHana_PRD_HDB00" => "100" }, hana_status: "Secondary", + status: "Online", indexserver_actual_role: "master", name: "node02", nameserver_actual_role: "master", @@ -1832,6 +1854,29 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do |> ClusterPolicy.handle(nil) end + test "should return the expected commands when a ha_cluster_discovery with different node statuses is received" do + assert {:ok, + [ + %RegisterClusterHost{ + details: %HanaClusterDetails{ + nodes: [ + %{status: "Offline"}, + %{status: "Unclean"}, + %{status: "Standby"}, + %{status: "Maintenance"}, + %{status: "Shutdown"}, + %{status: "Pending"}, + %{status: "Standby on fail"}, + %{status: "Online"} + ] + } + } + ]} = + "ha_cluster_discovery_hana_scale_up_node_status" + |> load_discovery_event_fixture() + |> ClusterPolicy.handle(nil) + end + describe "HANA scale out" do test "should return the expected commands when a ha_cluster_discovery payload with hana scale out is handled" do assert {:ok, @@ -1862,6 +1907,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana01", site: "Site1", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "PROMOTED", "hana_prd_gra" => "2.0", @@ -1914,6 +1960,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana02", site: "Site2", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -1945,6 +1992,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana03", site: "Site1", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -1976,6 +2024,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana04", site: "Site2", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2007,6 +2056,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana05", site: "Site1", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2038,6 +2088,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana06", site: "Site2", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2128,6 +2179,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana11", site: "Site1", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2160,6 +2212,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana12", site: "Site1", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2192,6 +2245,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana21", site: "Site2", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "PROMOTED", "hana_prd_gra" => "2.0", @@ -2238,6 +2292,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana22", site: "Site2", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2270,6 +2325,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhanamm", site: nil, hana_status: "Unknown", + status: "Online", attributes: %{}, virtual_ip: nil, resources: [ @@ -2331,6 +2387,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana01", site: "Site1", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "PROMOTED", "hana_prd_gra" => "2.0", @@ -2383,6 +2440,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana02", site: "Site2", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2414,6 +2472,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana03", site: "Site1", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2445,6 +2504,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana04", site: "Site2", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2476,6 +2536,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana05", site: "Site1", hana_status: "Primary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", @@ -2507,6 +2568,7 @@ defmodule Trento.Discovery.Policies.ClusterPolicyTest do name: "vmhana06", site: "Site2", hana_status: "Secondary", + status: "Online", attributes: %{ "hana_prd_clone_state" => "DEMOTED", "hana_prd_gra" => "2.0", diff --git a/test/trento_web/views/v1/cluster_view_test.exs b/test/trento_web/views/v1/cluster_view_test.exs index 3a13d27330..b225fae60f 100644 --- a/test/trento_web/views/v1/cluster_view_test.exs +++ b/test/trento_web/views/v1/cluster_view_test.exs @@ -19,7 +19,8 @@ defmodule TrentoWeb.V1.ClusterViewTest do Enum.map( build_list(1, :hana_cluster_node, %{ nameserver_actual_role: "master", - indexserver_actual_role: "master" + indexserver_actual_role: "master", + status: "Online" }), &Map.from_struct(&1) ) @@ -38,6 +39,7 @@ defmodule TrentoWeb.V1.ClusterViewTest do refute Access.get(details, :maintenance_mode) refute Access.get(node, :nameserver_actual_role) refute Access.get(node, :indexserver_actual_role) + refute Access.get(node, :status) end end end