dropdown menu

Showing posts with label HACMP. Show all posts
Showing posts with label HACMP. Show all posts

HA - SMUI


SMUI (System Mirror User Interface)

PowerHA V7.2 includes a browser-based GUI to monitor cluster environments, which is called PowerHA SMUI.

SMUI provides following functions:
- Monitors the status for all clusters, sites, nodes, and RGs in your environment.
- Scans event summaries and reads a detailed description for each event.
- Searches and compares log files. We can search in hacmp.out, cluster.log, clstrmgr.debug, syslog,caa....T
- View properties for a cluster (version, node names, repository disk information)
- We can create zones to split clusters by geographical location, by business areas etc..
- With the Health Summary, the health of our cluster is visualized

====================================

Installation:

SMUI clients: A node that is part of an AIX or Linux PowerHA cluster.
SMUI server: A server running Linux or AIX that provides SMUI.

Although the SMUI server can be a cluster node, it a best practice to place it on a separate stand-alone AIX or Linux system. Also, ideally the SMUI server must have internet access to download more open source packages as required.

Packages installed on SMUI server:
  cluster.es.smui.common 7.2.3.0
  cluster.es.smui.server 7.2.3.0


Packages installedon SMUI client (PowerHA nodes):
  cluster.es.smui.agent 7.2.3.0
  cluster.es.smui.common 7.2.3.0

Then folllowed this:

#######################################################################
#######################################################################
##
##  The IBM PowerHA SystemMirror for AIX graphical user interface
##  (GUI) server installation is starting. To complete the process,
##  you must install additional files when the installation completes.
##  These additional files were not included in the server fileset
##  because they are licensed under the General Public License (GPL).
##  However, they are necessary in order for the GUI server to run.
##  You can automatically download the required files by running the
##  following script:
##
##      /usr/es/sbin/cluster/ui/server/bin/smuiinst.ksh
##
##  If smuiinst.ksh is behind a firewall, but you have a proxy, the
##  "-p" flag can be used to specify an HTTP proxy (the "http_proxy"
##  environment variable is also honored). Run "smuiinst.ksh -h -v"
##  to get more information.
##
##  If no proxy is available, the smuiinst.ksh script can be copied
##  to a system outside of the firewall and used from there to
##  download the needed files (using the "-d" flag). Those files can
##  then be transferred to the GUI server system and installed using
##  "smuiinst.ksh -i". Note that the external system does not have to
##  be AIX-based, but must have basic UNIX tools support, along with
##  PERL 5.
##
##  This is a one-time only setup procedure. Once it is done, it will
##  not need to be repeated.
##
#######################################################################
#######################################################################

I installed these manually with yum (not these versions but higher versions)
        "info-4.13-3.aix5.3.ppc.rpm" is partially downloaded.
        "cpio-2.11-2.aix6.1.ppc.rpm" appears to be downloaded already.
        "readline-6.2-2.aix5.3.ppc.rpm" is partially downloaded.
        "libiconv-1.13.1-2.aix5.3.ppc.rpm" is partially downloaded.
        "bash-4.2-5.aix5.3.ppc.rpm" is partially downloaded.
        "gettext-0.17-6.aix5.3.ppc.rpm" is partially downloaded.
        "libgcc-4.9.2-1.aix6.1.ppc.rpm" is partially downloaded.
        "libgcc-4.9.2-1.aix7.1.ppc.rpm" is partially downloaded.
        "libstdc++-4.9.2-1.aix6.1.ppc.rpm" is partially downloaded.
        "libstdc++-4.9.2-1.aix7.1.ppc.rpm" needs to be retrieved.


libgcc, libstdc can be downloaded from http://www.bullfreeware.com/pkg?id=2289

Tried this as well: /usr/es/sbin/cluster/ui/server/bin/smuiinst.ksh -i /home/labuser
After the installation completed successfully, opened a web browser and used this URL (IP is the address where SMUI is installed): https://10.10.42.47:8080/#/login

After login first I had to create zone then add cluster to that zone using hostname.....

====================================

HA - RESOURCES


Resource, Resource Group 

Resources: File systems, service IPs, applications... which are highly available (These can be moved from one node to another.)
Resource Group (RG): Those resources which are grouped together, and moved together during a failover
Default node priority: The order in which the nodes are defined in the RG. A RG with default attributes will move from node to node in this order as each node fails.
Home node: The highest priority node in the default node list. RG will initially be activated there. (It is not the node where the RG is currently active on.)
Fallover: The process of moving a RG that is online on one node to another node in the cluster in response to an event.
Fallback: The process of moving a RG that is currently online on a node that is not its home node, to a re-integrating node.
Node failure: If a node fails, the RGs that were active on that node are distributed among the other nodes in the cluster, depending on their fallover policies.
Node recovery: When a node recovers and is reintegrated into the cluster, RGs can be reacquired depending on their fallback policies.

------------------------------------

Resource group (RG)

Resource groups allow PowerHA to manage resources as a single entity. For example, an application can consist of start and stop scripts, a database, and an IP address. These resources are then included in a resource group for PowerHA to control as a single entity. PowerHA ensures that resource groups remain highly available by moving them from node to node.

Resource group states:
- Online: The RG is currently operating properly on one or more nodes in the cluster.
- Offline: The RG is not operating and currently not in error condition (the user may requested this state or dependencies were not met)
- Acquiring: A RG is currently coming up on a node. In normal conditions status changes to Online.
- Releasing: The RG is in the process of being released (going down). In normal conditions after released, the status changes to offline.
- Error: The resource group has reported an error condition. User interaction is required.
- Unknown: The RG’s current status cannot be obtained, possibly because of loss of communication, or a resource group dependency is not met...

Each node that joins the cluster automatically attempts to bring online any of the resource groups that are in the ERROR state.

Start up options:
- Online on home node only: The RG is brought online when its home node joins the cluster. If home node isn't available, it stays offline
- Online on first available node: The RG is brought online when the first node in its node list joins the cluster.
- Online on all available nodes: The RG is brought online on all nodes in its node list as they join the cluster.
- Online using distribution policy: The RG is brought online only if the node has no other resource group of this type already online.

Fallover options:
- Fall over to next priority node in list: The RG falls over to the next node in the resource group node list.
- Fallover using dynamic node priority: The RG will be aquired by that node which has for example most free memory, most free cpu...user script is also possible
- Bring offline, on error node only: The RG is brought offline in the event of an error. This option is designed for RGs that are online on all available nodes.

Fallback options: (when a node joins back the cluster)
- Fall back to higher priority node in list: The RG falls back to a higher priority node when it joins the cluster.
- Never fall back: The RG does not move if a high priority node joins the cluster. RGs with online on all available nodes must be configured with this option.

------------------------------------

Resource Group attributes during Startup,Fallover,Fallback


Settling time
If a RG has the setting of "online on first available node", settling time ensures that a RG does not start on an early integrated node that is low in its priority list, then keep falling over to higher priority nodes as they integrate.  If the settling time is set for a resource group and the node that integrates into the cluster is its highest priority node then it goes online immediately, otherwise it waits the settling time to see if another higher priority node joins.

Delayed fallback timers
Configures the frequency for a fallback operation, which can be daily, weekly, monthly, yearly. Fallback will happen at the configured time.

Distribution policy
This node-based distribution policy ensures that on cluster startup, each node will acquire only one resource group with this policy set.

Resource group processing order
If a node is attempting to bring more than one resource group online, the default behavior is to merge all the resources into one large resource group and then process them as one “resource group.” This is called parallel processing, although it is not true parallel processing because it is single thread. This default behavior can be altered and serial processing can be specified for particular resource groups by specifying a serial acquisition list. This order defines only the order of processing on a particular node, not across nodes. If serial processing is set, the specified RGs are processed in order, RGs containing only NFS mounts are processed in parallel. The reverse order is used on release.

------------------------------------

Resource group dependencies

An example for RG dependencies, when a database must be online before the application server is started. If the database goes down and falls over to a different node, the RG that contains the application server will also be brought down and back up on any of the available cluster nodes. If the fallover of the database RG is not successful, then both RGs (database and application) will be put offline.

Resource group dependencies (combination of two out of three types of RG dependency can be set):
- Parent/child dependency: a RG cannot be started until a particular RG is already active
- Location dependency: certain RGs will be always online on the same node or on different nodes
- Start/stop after dependency: similar to parent/child dependency, but based on the setting during start or stop RGs can be processed together


Parent/Child dependency:
A parent/child dependency allows binding resource groups in a hierarchical manner.  A child resource group depends on a parent resource group. The parent resource group must be online before any of its children can be brought online. If the parent resource group is to be taken offline, the children must be taken offline first. There can be only three levels of dependency for resource groups. A resource group can act both as a parent and a child. You cannot specify circular dependencies among resource groups. It is important to have startup application monitors for the parents. After the startup application monitor confirmed that the application has successfully started, the processing of the child resource groups can then continue.

Location dependency
It ensure that RGs will always be online on the same node or on different nodes (or sites).
- Online on same node: A RG can be brought online on the node where other RGs in the same set are already online
- Online on different nodes: The specified RGs will be distributed on different nodes.
- Online on same site: A RG can only be brought online on a site where other RGs with this dependency are currently in an online state

Start/Stop after dependency
- Start after dependency: The target RG must be online before a source (dependent) RG can be activated. There is no dependency when releasing RGs, they are released in parallel.
- Stop after dependency: Te target RG must be offline before a source (dependent) RG can be brought offline. There is no dependency when acquiring RGs and they are acquired in parallel.

Set or display the RG dependencies (clrgdependency):
# clrgdependency -t [PARENT_CHILD | NODECOLLOCATION | ANTICOLLOCATION |SITECOLLOCATION ] -sl
# clrgdependency -t PARENT_CHILD -sl
#Parent Child
rg1 rg2
rg1 rg3

Another way to check is by using the odmget HACMPrg_loc_dependency command.

------------------------------------

HA - NFS

NFS

PowerHA provides highly available NFS services, which allows the backup NFS server to recover the current NFS activity if the primary NFS server fails. This feature is available only for two-node clusters when using NFSv2/NFSv3, and more than two nodes when using NFSv4. If NFS exports are defined through PowerHA, all NFS exports must be controlled by PowerHA. AIX and PowerHA NFS exports cannot be mixed. NFS information is kept in /usr/es/sbin/cluster/etc/exports, which has the same format as the AIX exports file (/etc/exports).

When configuring NFS through PowerHA, you can control these items:
- The network that PowerHA will use for NFS mounting.
- NFS exports and mounts at the directory level.
- the field “file systems mounted before IP configured” must be set to true (this prevents client access before needed)
- default is to export filesystems rw to the world, in /usr/es/sbin/cluster/etc/exports you can control that


-------------------------------------------
  
NFS cross-mounts

By default, NFS exported file systems, will automatically be cross-mounted (so each node will be an NFS client). This means, that the node that is hosting the resource group mounts the file systems locally, NFS exports them, and NFS mounts them (This node becomes NFS server and NFS client at the same time.) All other nodes of the resource group simply NFS-mount the file systems, thus becoming NFS clients. If the resource group is acquired by another node, that node mounts the file system locally and NFS exports them, thus becoming the new NFS server.

Syntax for configuration: /a; /fsa (/a: local mount point; /fsa: exported dir)

For example:
Node1 with service IP label svc1 will locally mount /fsa and NFS exports it.
Node1 will also NFS-mount svc1:/fsa on /a
Node2 will NFS-mount svc1:/fsa on /a

-------------------------------------------

NFS tiebreaker

When we use a linked cluster (where the cluster nodes are located at different geographical sites), there is an option to use a tiebreaker disk or NFS tiebreaker.

A cluster split event splits the cluster into two (or more) partitions, each of them containing one or more cluster nodes. The resulting situation is commonly referred to as a split-brain situation. In a split-brain situation, the two partitions have no knowledge of each other’s status, each of them considering the other as being offline. As a consequence, each partition tries to bring online the other partition’s resource groups (RGs), thus generating a high risk of data corruption.

When a split-brain situation occurs, each partition attempts to acquire the tiebreaker by placing a lock on the tiebreaker disk or on the NFS file. The partition that first locks the SCSI disk or reserves the NFS file wins, and the other loses. All nodes in the winning partition continue to process cluster events, and all nodes in the losing partition attempt to recover according to the defined split and merge policies. (most probably restarting the cluster services)

-------------------------------------------



HA - RSCT

RSCT (Reliable Scalable Cluster Technology)

RSCT  (as its name says) is a sort of Cluster Technology. It comes with AIX by default (no additional installation is needed) and it consists of several low-level components (daemons, subsystems). These components create a basic cluster environment (with nodes and heartbeat between these nodes etc.) which is monitored by RSCT. If a node crashes an event is generated and RSCT informs the RSCT-aware client. (PowerHA, or more precisely the cluster manager (clstrmgrES) is itself an RSCT-aware client). Historically RSCT was a separate product, but starting with AIX 5.1 it is shipped with the operating system. On AIX 7.2 the actual RSCT fileset version is 3.2. It is possible to check/remove the RSCT filesets, which name is like rsct... (lslpp -l | grep rsct), and as a comparison to CAA, CAA is built into AIX so inherently, that is is part of the Base Operating System (CAA is contained in bos.cluster... filesets).

The key point here is that RSCT provides services, such as cluster monitoring, which is used by PowerHA and PowerHA provides "high availability services" to applications. For example, responding to an unexpected event, it is necessary to know when it occurs. This is the job of the RSCT to monitor for certain failure. Beside PowerHA, RSCT-aware clients are GPFS, SSP or the HMC too.

RSCT’s role in a PowerHA cluster is to provide:
- Failure detection and diagnosis for topology components (nodes, networks, and network adapters)
- Notification to the cluster manager of events
- Coordination of the recovery actions (fallovers, fallbacks and dealing with individual NIC failures by moving or swapping IP addresses)

We can use the ctversion command to finnd out which version of RSCT is running on a particular AIX (or lslpp):
# /opt/rsct/install/bin/ctversion


==================================

RSCT components



The main RSCT components are:
Resource:  A resource is the fundamental concept of the RSCT architecture; it is an instance of a physical or logical entity. Examples of resources include lv01 on node A, Ethernet device en0 on node B, and IP address 9.117.7.21. A set of resources that have similar characteristics is called a resource class.

Resource Monitoring and Control (RMC): This is the main component in RSCT. RMC can be configured to monitor resources (disk space, CPU usage, processes etc.) and perform an action in response to a defined condition. For example, using the RMC API or CLI it is possible to create conditions or events which will automatically expand a file system if its usage exceeds 95 percent. These events are created based on the messages received from the Resource Managers. RMC also coordinates between the various RSCT components.

Resource Managers (RMs): Resource Managers are software layers between a resource (for example a filesystem) and RMC. RMs are managed by RMC. They are making the actual commands for each resource and then sending data to the RMC. For example there are File System Resource Manager, Host Resource Manager, Audit Log Resource Manager, Event Response Resource Manger ...

Security Services: This provides the security infrastructure that enables RSCT components to authenticate. (These days only RMC and the Resource Managers are using the RSCT security services)

Group Services:  Group Services is responsible for coordinating and monitoring changes across all cluster nodes and ensures all of them finished properly. Group Services is a client of RMC and CAA (or Topology Services). In a PowerHA setup, CAA (in earlier PowerHA versions the Topology Services) sends information to the Group Services, which reports the failures to the PowerHA Cluster Manager(clstrmgrES). From Group Services point of view the "application running on multiple nodes" is the Cluster Manager. Then the Cluster Manager makes cluster-wide coordinated responses to the failure. (The PowerHA cluster manager is an RSCT client and it registers itself with both the RMC and the Group Services. After an event has been reported to the PowerHA Cluster Manager, it responds to this event with recovery commands and event scripts. These scripts are coordinated via the Group Services.)

Topology Services: This provides node and network monitoring and failure detection (heartbeats). It is responsible for building heartbeat rings for the purpose of detecting and reporting important informations to the Group Services, which then reports them to the Cluster Manager.  In the heartbeat ring, each Topology Services daemon sends a heartbeat message to one of its neighbors and expects to receive a heartbeat from another. In this system of heartbeat messages, each member monitors one of its neighbors. If the neighbor stops responding, the member that is monitoring it will send a message to the "group leader". Topology Services is also responsible for the transmission of any RSCT-related messages between cluster nodes. After PowerHA 7.1.0, the RSCT topology service is deactivated and all its functions are performed by CAA topology services.

==================================

RSCT domains

RSCT can provide 2 types of "clusters", which are called in RSCT terminology: domains. Depending on the status of the nodes (if all of them are on equal level or if there is a special control node between them) these 2 RSCT domains exist: management domain and peer domain.

Management Domain: (set of nodes that is configured for manageability or monitoring)
An RSCT management domain is a set of nodes that can be managed and monitored from one of the nodes, which is designated as the management control point (MCP). Except the MCP all other nodes are considered to be managed nodes. Topology Services and Group Services are not used in a management domain.

Peer Domain: (set of nodes that is configured for high availability)
An RSCT peer domain is a set of nodes that have a knowledge of each other, and they share resources between each other. On each node within the peer domain, RMC depends on Topology Services, Group Services, and cluster security services.  If PowerHA V7 is installed, Topology Services are not used, and CAA is used instead. 

The general difference between them is the relationship between the nodes. In a peer domain, all nodes are considered equal and any node can monitor and control (or be monitored and controlled) by any other node. In a management domain, a management node is aware of all nodes it is managing but the nodes themselves know nothing of each other.

Combination of management and peer domains
We can have a combination of management domains and peer domains. This example shows one Hardware Management Console (HMC) that is managing three LPARS. The HMC and Node A, Node B and NodeC are creating a Management Domain. Additionally on Node B and on Node C PowerHA is installed, so these 2 nodes are making a peer domain too. In a Power Systems environment, the HMC is always the management server (MCP) in the RSCT management domain. LPARs are automatically configured as managed nodes.



==================================

RSCT and CAA


Cluster Aware AIX (CAA) introduces clustering capabilities to AIX (setup of a cluster, detecting the state of nodes and interfaces). When RSCT operates on nodes in a CAA cluster, a peer domain is created that is equivalent to the CAA cluster, and can be used to manage the cluster by using peer domain commands. 

Only one CAA cluster can be defined on a set of nodes. Therefore, if a CAA cluster is defined then the peer domain that represents it is the only peer domain which can exist there. If no CAA cluster is configured, then existing and new peer domains can also be used. 

A CAA cluster and the equivalent RSCT peer domain operate hand in hand such that a change made to the CAA cluster by using CAA commands, is reflected automatically in the corresponding peer domain; similarly the existing peer domain commands result in equivalent changes to the CAA cluster. So, for example, when you create a CAA cluster by using mkcluster command, the equivalent peer domain also gets created, the same way if we used the mkrpdomain RSCT command. Similarly node add and delete operations that use either peer domain or cluster commands are applied to both the CAA cluster and the peer domain.

Starting with RSCT version 3.1.0.0, the Group Services subsystem can operate in a Cluster Aware AIX (CAA) environment. In this environment, Group Services rely on the CAA to provide node and adapter liveness information and node-to-node communication, thus removing its dependency on RSCT Topology Services. Instead of connecting to the Topology Services daemon, it gets information directly from the low-level cluster services in the CAA environment.

RSCT version 3.1.2.0, or later, can be installed on the nodes and can coexist with prior RSCT releases. Because CAA delivers fundamental node and interface liveness information, the Topology Services subsystem is not active in a peer domain based on CAA. 

===========================

Commands:

lssrc -ls cthags                         shows info of RSCT cthags services
lssrc -ls IBM.StorageRM                  shows info of StorageRM (Resource Monitor) objects
lssrc -ls IBM.ConfigRM                   shows info of ConfigRM (Resource Monitor) objects

/opt/rsct/install/bin/ctversion          checking RSCT version

===========================

HA - CAA

CAA (Cluster Aware AIX)

CAA is an AIX feature that was introduced in AIX 6.1 TL6 and AIX 7.1. It helps to easily create a cluster. CAA is not used as a stand-alone package, it is used with PowerHA or with Shared Storage Pool. It can be seen as a set of commands and services that other applications (like PowerHA, SSP) can exploit to provide high availability and disaster recovery support. CAA does not provide application monitoring and resource failover capabilities, those are provided by PowerHA for example. IBM PowerHA, SSP and even RSCT (Reliable Scalable Cluster Technology) use these built-in AIX clustering capabilities, and the reason for these built-in functions was to simplify the configuration and management of high availability clusters.

CAA can provide specific events, so that applications can monitor these from any node in the cluster:
Node UP and node DOWN
Network adapter UP and DOWN
Network address change
Disk UP and DOWN
Predefined and user-defined events

CAA needs the following ports on all nodes for network communication:
4098 (for multicast)
6181
16191
42112

Checking CAA related daemons (services):
# lssrc -g caa
Subsystem Group PID Status
 clcomd caa 6553806 active
 clconfd caa 6619352 active

clcomd: It is the cluster communications daemon. Since PowerHA 7.1 it is a CAA service, before PowerHA 7.1 it was part of PowerHA (clcomdES). The rhosts file that is used by the clcomd is in the /etc/cluster/rhosts file. The old clcomdES rhosts file in the /usr/es/sbin/cluster/etc directory is not used.
clconfd: The clconfd subsystem runs on each node of the cluster. The clconfd daemon wakes up every 10 minutes to synchronize any necessary cluster changes.

Starting with AIX 7.1 TL2, no longer require a total cluster outage to upgrade the cluster nodes:
A rolling upgrade of a cluster is done by taking a node offline and upgrading it to a new AIX technology level, while the other nodes remain active. After a node is upgraded, the node is rebooted and brought online by issuing the clctrl command. This process is repeated until all the nodes are upgraded. In a mixed cluster environment, CAA maintains compatibility with nodes that are still running prior AIX levels. New features are not enabled until all the cluster nodes are upgraded to the new technology level.

=============================

CAA Repository disk

The cluster repository disk stores the cluster configuration data. It provides a central repository, so this disk must be accessible from all nodes in the cluster. A minimal disk size of 10 GB is preferred (1GB may be also enough). This disk cannot be used for application storage or any other purposes, the use of LVM commands (mkvg, mklv...) are not supported whith the cluster repository disk. The AIX LVM commands are single node administrative commands, and are not applicable in a clustered configuration. (The cluster repository disk must be compliant with the 512 byte block size.)

CAA stores the repository disk related information in the ODM CuAt, as part of the cluster information.

# odmget CuAt | grep -p cluster
CuAt:
        name = "cluster0"
        attribute = "node_uuid"
        value = "52a6b8be-fff8-11e5-8e37-56a1a7627864"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 3

CuAt:
        name = "cluster0"
        attribute = "clvdisk"
        value = "d7063c81-3f64-b5f7-d82b-fa8ed99bfe61"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 2

In case this ODM entry is missing (which can cause that a node will fail to join the cluster) it can be repopulated (and the node forced to join the cluster) using clusterconf command: clusterconf -r hdisk#  (hdisk# is the repository disk)

=============================

/aha (AHAFS)

Nodes that belong to a CAA cluster use the common AIX HA File System (AHAFS) for event notification. AHAFS is a pseudo file system used for synchronized information exchange and it is implemented in the AIX kernel extension. AHAFS is mounted on /aha. It can monitor predefined and user-defined system events and automatically notifies registered users or processes about the occurrences of the following types of events:
- Modification of content of a file
- Usage of a file system that exceeds a user-defined threshold
- Death of a process
- Change in the value of a kernel tunable parameter

=============================

Creating a cluster

The command mkcluster is used for creating a CAA cluster:
# mkcluster -n mycluster -m nodeA,nodeB -r hdisk1 -d hdisk2,hdisk3

The name of the cluster is mycluster, the nodes are nodeA and nodeB, the repository disk is hdisk1 and the shared disks are hdisk2 and hdisk3. When the cluster is ready a special volume group (caavg_private), new logical volumes and filesystems are created.

The following happens after issuing the mkcluster command:
- The cluster configuration is written to the cluster repository disk.
- Special volume groups, logical volumes, filesystems are created on the cluster repository disk. (caavg_private)
- Cluster services are made available to other applications like RSCT or PowerHA.
- Additional storage related taks...
- A clusterwide multicast address is established.
- The node discovers and monitors the available communication interfaces.
- The cluster interacts with Autonomic Health Advisory File System (AHAFS) for clusterwide event distribution and makes messages available to PowerHA, RSCT...

CAA uses IP based network communications and storage interface communication through Fibre Channel. When using both type of communication, all nodes in the cluster can always communicate with any other nodes in the cluster and thus eliminating "split brain" incidents. If some node cannot communicate with others DMS (Dead Man Switch) timers are triggered.

A deadman switch is an action when Cluster Aware AIX (CAA) detects that a node become isolated. This occurs when nodes are not capable of communicating via network and repository disk anymore. Based on the deadman switch setting (or the deadman_mode tunable) the AIX operating system can react differently. DMS monitors for some specific time (node_timout) IO traffic, process health etc. and after the timeout it can force a system shutdown or generate an Autonomic Health Advisor File System (AHAFS) event.

=============================

Deadman switch (DMS)

A deadman switch is an action when CAA detects that a node become isolated. This occurs when nodes are not capable of communicating via network and repository disk anymore. The purpose of the DMS is to protect the data on the external disks. The AIX operating system reacts differently depending on the DMS (deadman_mode) tunable. The deadman switch tunable can be set to force a system crash or generate an AHAFS event. 

# clctrl -tune -L deadman_mode           <--check the current setting (clctrl -tune -h deadman_mode gives more details
NAME DEF MIN MAX UNIT SCOPE
 ENTITY_NAME(UUID) CUR
--------------------------------------------------------------------------------
deadman_mode a c n
 caa_cl(25ebea90-784a-11e1-a79d-b6fcc11f846f) a
--------------------------------------------------------------------------------

When the value is set to "a" (assert), the node will crash upon the deadman timer popping.
When the value is set to "e" (event), an AHAFS event is generated.

By default, the CAA deadman_mode option is “a”. If the deadman timeout is reached, the node crashes immediately to prevent a partitioned cluster and data corruption. 

=============================

Commands:

/var/adm/ras/syslog.caa                  caa log (in syslog: caa.info /var/adm/ras/syslog.caa rotate size 1m files 10)

lscluster -i                             lists interface configuration of the cluster
lscluster -i | egrep 'Node|Interface'    overview of cluser, all interfaces (network and disk heartbeat)
lscluster -m                             lists info about nodes in the cluster
lscluster -d                             lists disks in the cluster and their status
lscluster -s                             lists statistis of network of a cluster
lscluster -c                             shows info about cluster configuration

mkcluster                                create a cluster
chcluster                                change a cluster configuration
rmcluster                                remove a cluster configuration
clcmd                                    run a command on all nodes of a cluster (clcmd date: it shows the date on all nodes)

lsattr -El cluster0                      lists IDs of cluster, disks

clctrl -stop -n mycluster -a             stop cluster on all nodes (stop cluster on 1 node: clctrl -stop -n mycluster -m myserver1)
clctrl -start -n mycluster -a            start cluster on all nodes (after completing maintenance)
clctrl -tune -L                          lists CAA related tunables (values stored in repository disk)
clctrl -tune -o <tunable>=<value>        modifies a tunable across cluster (new value will be active at the next start)

=============================

If you want to use force option with CAA commands (not -f flag), the environment variable CAA_FORCE_ENABLE has to be set to 1:
# export CAA_FORCE_ENABLED=1
# rmcluster -r hdisk2

(Using force with rmcluster will remove the repository disk and ignore all errors.

=============================


HA - NETWORK

Network - Topolgy

Topology: It's a general term, which describes the network structure. It refers to nodes, networks, communication interfaces, adapters...
Logical network interface: A port of a physical adapter represented in AIX (as a L3 device, for example, en0)
IP label: The label that is associated with an IP address as defined by the name resolution method (DNS or /etc/hosts).
IP alias: An AIX feature, when an IP address is added to an interface, rather than replacing its base IP address.
Boot IP (Base IP): The default IP that is configured on an interface by AIX on startup; the base address of the interface.
Service IP: PowerHA keeps this IP highly available (over which a service is provided). It's a resource, not part of the network topology.
Persistent IP: It is an IP alias that is assigned permanently to a node. It always stays on the same node.
Boot interface (Base interface): Any interface that can host a service IP. (in PowerHA7.1 only boot interface exists, in earlier versions: boot and standby interfaces)


A physical network connects two or more physical network interfaces. These interfaces (which are usually on one non-routed physical network or VLAN) can be grouped together to form a logical network. Logical networks are known by a unique name in PowerHA (for example net_ether_01). A logical network can be viewed as the group of interfaces used by PowerHA to host service IP labels.

During cluster configuration, the discovery process uses /etc/hosts file and interfaces on the node to create files in /usr/es/sbin/cluster/etc/config:
clip_config: contains details of the discovered interfaces; used in F4 SMIT lists.
clvg_config: contains details of each physical volume (PVID, VG name,status, major number etc.) and a list of free major numbers.

Important:
All the communication interfaces that are configured in the same PowerHA network must have the same subnet mask. Interfaces that belong to a different network can have either the same or different network mask.

--------------------------

Persistent Node IP:

A persistent node IP is an IP alias that can be assigned permanently to a node. It always stays on the same node (is node-bound) and it can coexist with other IPs. It Is not part of any resource group and this address can be used for administrative purposes because it always points to a specific node regardless of whether PowerHA is running.

The persistent IP labels are defined in the PowerHA configuration, and they become available when the cluster definition is synchronized. When PowerHA starts, it checks whether the alias is available. If it is not, PowerHA configures it on an available adapter and it remains available even if PowerHA is stopped. If the interface with the persistent IP fails while PowerHA is running, the persistent IP is moved to another interface on the same node. If the node fails the persistent IP label will no longer be available.

In a multiple interface per network configuration, using a persistent alias in the same subnet as your default route is common. This typically means that the persistent address is included in the same subnet as the service addresses. 

Default gateway (route) considerations
If you link your default route to one of the base address subnets and that adapter fails, your default route will be lost. To prevent this situation, be sure to use a persistent address and link the default route to this subnet. The persistent address will be active while the node is active and therefore so will the default route. If you choose not to do this, then you must create a post-event script to reestablish the default route if this becomes an issue.

Not all adapters must contain addresses that are routable outside the VLAN. Only the service and persistent addresses must be routable. The base adapter addresses and any aliases used for heartbeating do not need to be routed outside the VLAN because they are not known to the client side.

--------------------------

Service IP

Service IP is used for accessing applications or nodes. Service IP is monitored by PowerHA and is part of a resource group. There are 2 types of it:
Shared service IP: It can be configured on multiple nodes and is part of a resource group (this one is used most of the time).
Node-bound service IP: It can be configured on only one node (is not shared by multiple nodes), it used with concurrent resource groups.

Firstalias
PowerHA 7.1 automatically configures the service IP with the firstalias option. Firstalias means, that service IP will be the first one among the aliases on an interface. For example when PowerHA is down, we have only a boot IP on an interface. When PowerHA starts up it adds the service IP as an alias, but not as the 2nd IP, it will be the first one on the list. (netstat output will show service IP first and boot IP as the next one, below that.) The reason behind this is routing. When we ping an IP, which resides on an adapter with multiple aliases on the same network, the first one will respond. It does not matter that we wanted to ping the 2nd alias, by default the first one will send reply (this can cause problems in firewalls because the reply comes from the 1st one on the list, not the 2nd). To avoid this issue, service addres is by default the first one, however firstalias can be disabled if needed.

When multiple service IP addresses are used, PowerHA analyzes the total number of aliases, and assigns each service address to the least loaded interface. PowerHA allows you to define a distribution preference, but PowerHA will always keep service IP active, even if the preference cannot be satisfied:
- Collocation, Anti-collocation: With collocation setting, if we have more service IPs, they will be allocated on the same boot interface. With Anti-collocation setting they will be distributed across all boot interfaces on the network.
- With source: If we have more service IPs, with this preference, we can choose one service label as a source for outgoing communication. 

--------------------------

IP address takeover (IPAT) mechanisms

1. IP replacement (PowerHA versions 5.x, 6.x)
2. IP aliasing (PowerHA versions 5.x, 6.x, 7.x)

PowerHA v7.1 (and later versions) supports IP address takeover (IPAT) only through aliasing.


IPAT via IP replacement (old not available anymore!):

The service IP replaces the existing address on the interface, thus only one service IP can be configured on one interface at one time. The service IP should be on the same subnet as one of the boot IP addresses. Other interfaces on this node cannot be in the same subnet, and they are called as standby interfaces. These standby interfaces are used if the boot interface fails. IPAT via IP replacement can save subnets, but requires extra hardware.





IPAT via aliasing (since PowerHA 7.1 this exist only)

The service IP is aliased (using the ifconfig command) onto the interface without removing the underlying boot IP address. This means that more than one service IP label can coexist on one interface. Each boot interface on a node must be on a different subnet. By removing the need for one interface per service IP, IPAT through aliasing is more flexible, it also reduces fallover time, as it is much faster to add an alias to an interface, than removing the base IP address and then apply the service IP address.


--------------------------

Rules regarding IP configurations:

General rules:
– When multiple boot IPs are used (multiple adapters), each must be on a separate subnet to allow heartbeating
- Boot IPs don't not have to be routable outside of the cluster (they can be, just not necessary, persistent and service IPs should be routed)
- All interfaces in the same network must have same subnet mask. (Interfaces on other networks can have another subnet mask.)
- The subnet mask of the boot IP will be used for all IP aliases configured on the same network interface.

Service IP rules (with IPAT through aliases:
- When single adapter is used, service IP can be on the same subnet as the boot adapter
- When multiple adapters are used, service IP must be on separate subnet from the boot IP
- When multiple service IPs are used, these can be on the same subnet (or in different subnets)


Persistent IP rules:
- Persistent IP must be an alias, not the base address of an adapter
- Persistent IP can be in the same or different subnet as the service IP
- In multiple adapter networks the persistent IP must be on a different subnet from each of the boot interface subnets
(In single adapter network configuration there are no restrictions in this case a persistent IP might not needed at all.)


Not all addresses must be routable outside the VLAN. Only the service and persistent addresses must be routable. The base adapter addresses and any aliases used for heartbeating do not need to be routed outside the VLAN because they are not known to the client side.

During failover to another interface (on the same node) it can happen, that the service IP address is active on both the failed Interface and on the takeover interface. This is needed to preserve routing (routes will not disappear from routing table), but this might cause a DUPLICATE IP ADDRESS error log entry, which you can ignore.

IPAT through aliasing is supported only on networks that support the gratuitous ARP function of AIX. Gratuitous ARP is when a host sends out an ARP packet before using an IP address and the ARP packet contains a request for this IP. In addition to confirming that no other host is configured with this address, it ensures that the ARP cache on each machine (on the subnet) is updated with this new address.

To ensure that cluster events complete successfully and quickly, PowerHA disables NIS or DNS host name resolution during service IP label swapping by setting the NSORDER AIX environment variable to local. Therefore, the /etc/hosts file should be complete and must contain all PowerHA defined IP labels for all cluster nodes. After the swap completes, DNS access is restored.

If the interface holding the service IP address fails, PowerHA moves the service IP address on another available interface on the same node and on the same network; in this case, the resource group is not affected. If there is no available interface on the same node, the resource group is moved to another node with an available interface on the same logical network.

-------------------------------

PowerHA in virtualized environments

http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/TD105185


Most new configurations today are virtualized using VIOS. It is also common practice to provide adapter redundancy through the VIOS (Etherchannel, SEA...), which leads to a "single adapter configuration" in PowerHA. Single adapter configuration allows the boot IP and service IP to be on the same subnet. And the boot IP can serve the administrative functions, so it is not really necessary to configure a persistent IP address. (However it is possible to configure a persistent IP on the same subnet.)

In a VIOS configuration, it is still recommended to configure the netmon.cf file utilizing the new format specifically for VIOS environments.

-------------------------------

Multicast vs Unicast

Starting with version 7.1 PowerHA uses a new redesigned cluster health management called Cluster Aware AIX (CAA). CAA uses kernel-level code to exchange heartbeats over network, SAN fabric and also using the repository disk. By default, PowerHA SystemMirror uses unicast communications for heartbeat. As an alternative, multicast communications may be configured instead of unicast. For multicast, you can optionally select a multicast address, or let Cluster Aware AIX (CAA) automatically assign one.


If multicast is selected during the initial cluster configuration, an important factor is that the multicast traffic be able to flow between the cluster hosts in the data center. Multicasting is a form of addressing, where a group of hosts forms a group and exchanges messages. A multicast message sent by one in the group is received by all in the group. This allows for efficient cluster communication where many times messages need to be sent to all nodes in the cluster. For example, a cluster member need to notify the remaining nodes about a critical event and can accomplish the same by sending a single multicast packet.  To achieve this, multicast must be enabled on the switches and with any forwarding, if applicable.

CAA creates a default multicast address if one is not specified during cluster creation. This default multicast address is formed by combining (using OR) 228.0.0.0 with the lower 24 bits of the IP address of the host. As an example, in our case the host IP address is 192.168.100.51, so the default multicast address is 228.168.100.51.

Multicast communication can be tested with mping:
1. mping -v -r -c 5        <--start mping on one node in receiver mode (-r) (-v: verbose, -c:number of pings)
2. mping -v -s -c 5        <--start mping on other node in sender mode (it will choose default ip, with -a you can specify ip)
(If mping fails, network admin needs to review switches)


PowerHA v7.1.0 through v7.1.2 required the use of multicast, but since PowerHA v7.1.3 by default (if no multicast IP address is provided while deploying the cluster) unicast is used (normal TCP/IP socket communication). Unicast requires no extra configuration.

Using multicast may have a benefit in a multi node (3,4,5...) cluster, but there is no benefit in a 2 node cluster setup and it needs additional configuration at PowerHA and at switch side. (My personal recommendation is using unicast in a 2 node cluster.)

Changing cluster config from Multicast to Unicast:
1. lscluster -c <--check Communication mode
2. smitty cm_define_repos_ip_addr <--change heartbeat mechanism from mulitcast to unicast
3. verify and sync <--verify and synchronize cluster
4. lscluster -c <--check again Communication mode

-------------------------------

netmon.cf

In PowerHA heartbeats are used to monitor an adapter’s state over a long period of time. When heartbeating is not working, a decision must be made about whether the local adapter has gone bad or there are other network problems. This decision is made based on whether any network traffic can be seen on the local adapter (using the inbound byte count of the interface). Where VIO is involved, this test becomes unreliable because there is no way to distinguish whether inbound traffic came in from the outside world through VIOS, or from a virtual I/O client (LPAR) in the same box.

A new netmon.cf function was added to support PowerHA in a virtual I/O environment, where PowerHA could not detect a local adapter-down event. The new format helps to decide, that adapter is up only, if it can ping a specified target.

The netmon.cf file must be placed in the /usr/es/sbin/cluster directory on all cluster nodes. Up to 32 targets can be provided for each interface. If any specific target is pingable, the adapter will be considered “up.” (The traditional format of the netmon.cf file is not valid in PowerHA v7, and later, and is ignored. Only the !REQD lines are used.)

example content of /usr/es/sbin/clister/netmon.cf:
!REQD en2 100.12.7.9
!REQD en2 100.12.7.10

Interface en2 is considered “up” only if it can ping either 100.12.7.9 or 100.12.7.10.

There is a general consensus against PowerHA nodes using the same VIOS, because this can mean that heartbeats can be passed between the nodes without packets leaving the box. The netmon.cf will be effective only, if targets are outside the VIO environment. Cluster verification cannot verify this. The order from one line to the other is unimportant. If more than 32 !REQD lines are specified for the same owner, any extra lines are ignored. This format does not change heartbeating behavior in any way. It changes only how the decision is made regarding whether a local adapter is up or down.

In PowerHA V7.2, the netmon.cf file is now used by CAA. Before PowerHA V7.2, it was used by Reliable Scalable Cluster Technology (RSCT). There are now (starting with PowerHA V7.2) different rules for the netmon.cf:


Independent from the PowerHA version that is used, if possible, you must have more than one address defined (by interface). It is not recommended to use the gateway address as modern gateways start dropping ICMP packages if there is high workload.

------------------------------------------------------

poll_uplink

Another solution to detect link status in VIO environments without using netmon.cf file, is the poll_uplink parameter. Using SEA poll_uplink method (since VIOS 2.2.3.3), SEA can pass up the link status, so no netmon.cf file with "!REQD" style ping is required any more.

In PowerHA V7, the network down detection is performed by CAA. CAA by default checks for IP traffic and for the link status of an interface. Therefore, using poll_uplink is advised for PowerHA LPARs. The network down failure detection is much faster if poll_uplink is used.

No special configuration required on the VIOS/SEA side, and on the PowerHA nodes (VIO clients) these steps are needed:

1. smitty clstop                                     <--stop cluster
2. chdev -l <entX> -a poll_uplink=yes -P             <--enable on all virt. interface on all nodes (with -P reboot is needed)
3. entstat -d <entX> | grep -i bridge                <--after enabling, can be checked with entstat, it should show: Bridge Status: Up
4. verif. and synch                                  <--run verif. and synch.
5. smitty clstart                                    <--start cluster

There are no additional changes to PowerHA and CAA needed. The information about the virtual link status is automatically detected by CAA. There is no need to change the MONITOR_INTERFACE setting.
(In PowerHA V7.1.3, MONITOR_INTERFACE setting has to be changed, but in PowerHA V7.2.0 and later it is not needed anymore.)

checking the status of MONITOR_INTERFACE:
# clmgr -a MONITOR_INTERFACE query cluster
The default is MONITOR_INTERFACE=enable

------------------------------------------------------

cldump, clstat

Cldump and clstat can be used to have a good overview  of the cluster status. Both of these utilities are using the clinfoES daemon and clinfo uses SNMP to gather information from the cluster manager.


When clinfo starts, it reads the /usr/sbin/cluster/etc/clhosts file. This file lists IPs of all available nodes. Clinfo searches through this file for an active SNMP process on a node, starting at the first IP address in the clhosts file. Once it locates a SNMP process, Clinfo starts to receive information about the state of the cluster from that SNMP process.

clhosts file
This file contains IP address information which helps to enable communication between monitoring daemons on clients and the PowerHA cluster nodes. The file resides on all PowerHA cluster servers and clients in the /usr/es/sbin/cluster/etc/ directory.
When a monitor daemon starts up (for example clinfoES on a client), it reads this file to know which nodes are available for communication.
(when running clstat utility from a client, the clinfoES obtains info from this file.)

PowerHA automatically generates the clhosts file needed by clients when you perform a verification with the automatic corrective action feature enabled. The verification creates a /usr/es/sbin/cluster/etc/clhosts.client file on all cluster nodes, which is similar to this
# Date Created: 05/19/2014 at 14:39:07
#
10.10.10.52 #ftwserv
10.10.10.51 #dallasserv
192.168.150.51 #jessica_xd
192.168.150.52 #cassidy_xd
...

This file contains all addresses, including the boot, service, and persistent IPs. Before using any of the monitor utilities from a client node, the clhosts.client file must be copied over to all clients as /usr/es/sbin/cluster/etc/clhosts. (without the client extension)


Link to solve clstat issues:
https://www.ibm.com/support/pages/troubleshooting-clstat-command-issues
https://www.ibm.com/support/pages/common-issues-causing-clstat-malfunction

------------------------------------------------------

ERROR: Comm error found on node: aix1.
ERROR: Comm error found on node: aix2.
ERROR: No more alive nodes leftCluster services will not start on node(s): aix1 aix2
Please see the above verification errors for more detail.A trace of the verification warning/error messages above
is available in the file:/var/hacmp/clverify/clverify.log

The solution was, that default gateway was missing so nodes could not communicate at all. After creating default gateway, and ping worked between nodes, this error disappeared.

------------------------------------------------------


HA - SSP

Shared Storage Pools (SSP):

Shared Storage Pool is a storage virtualization technique. The concept is that VIO servers create a cluster, and they own the same disks assigned from SAN (for example a 1TB LUN). Then with special commands we can create smaller disks (logical units) which we can assign to AIX LPARs as usual vscsi disks. With this technique we have more control over the storage of each AIX LPAR, and we have less depenedency on the storage team.(As the VIO servers sharig the same storge resources LPM is possible by default.)

Only Virtual I/O Server can be part of a the SSP cluster, which is based on Cluster Aware AIX (CAA) and RSCT technology. The Virtual I/O Servers in the cluster communicate with each other using Ethernet connections. They share the repository disk and the disks for the storage pool through the SAN. (The repository is contained in a cluster filesystem that has been developed specifically for the purpose of storage virtualization, which is located at /var/vio/SSP/bb_cluster/D_E_F_A_U_L_T_061310)



Cluster can consist:
VIOS version 2.2.0.11, Fix Pack 24, Service Pack 1         <--1 node
VIOS version 2.2.1.3                                       <--4 node
VIOS Version 2.2.2.0                                       <--16 node
VIOS Version 2.2.5.0                                       <--24 node

On the Virtual I/O Server, the poold daemon handles group services and is running in the user space. The vio_daemon daemon is responsible for monitoring the health of the cluster nodes and the pool, plus the pool capacity:
poold      - handles group services
vio_daemon - monitors the health of the cluster nodes and the pool

# lssrc -ls vio_daemon
Node ID:                      2aab290eb80911e9801c98be9402197c
Log File:                     /home/ios/logs/viod.log
VKE Kernel Socket:            4
VKE Daemon Socket:            5
Bound to :                    /home/ios/socks/vioke_unix
API Socket:                   8
Bound to :                    /home/ios/socks/api_eve_unix
Cluster Name:                 SSP_Cluster_1
Cluster ID:                   e9ebb214090711e8800298be946fc362
PNN NODE ID:                  00000000000000000000000000000000
DBN NODE ID:                  dabfd57c1f1d11e9801698be9402197c
Pool Label:                   SSP_1
Pool VIO Name:                D_E_F_A_U_L_T_061310
Pool ID:                      FFFFFFFFAC17583D000000005A75F1BF
Pool State:                   UP
Pool Sync Status:             COMPLETED
Repository Cluster Mode:      EVENT
Repository Disk State:        UP
DBN Role:                     Other
PNN Role:                     Other


------------------------------------------------------------------------------

Logical Units

When using shared storage pools, the Virtual I/O Server provides storage to AIX LPARs through logical units. A logical unit is a file backed storage device that resides in the cluster filesystem (/var/vio/SSP/bb_cluster/D_E_F_A_U_L_T_061310) in the shared storage pool. It appears as a virtual SCSI disk in the client partition.

The physical volumes in the shared storage pool are managed as an aggregation of physical blocks, and user data is stored in these blocks.  After the physical blocks are allocated to a logical unit to write actual data, the physical blocks are not released from the logical unit until the logical unit is removed from the shared storage pool. Deleting files, file systems or logical volumes, which reside on the virtual disk on a client partition does not increase free space of the shared storage pool.

The system reserves a small amount of each physical volume in the shared storage pool to record meta-data.


------------------------------------------------------------------------------

Thin provisioning

A thin-provisioned device represents a larger disk space than the actual physical disk space. It is not fully backed by physical storage as long as the blocks are not in use. A thin-provisioned logical unit is defined with a user-specified size when it is created. It appears in the client partition as a virtual SCSI disk with that user-specified size. However blocks on the physical disks in the shared storage pool are only allocated when they are used. 

Consider a shared storage pool that has a size of 20 GB. If you create a logical unit with a size of 15 GB, the client partition will see a virtual disk with a size of 15 GB. But as long as the client partition does not write to the disk, only a small portion of that space will initially be used from the shared storage pool. If you create a second logical unit also with a size of 15 GB, the client partition will see two virtual SCSI disks, each with a size of 15 GB. So although the shared storage pool has only 20 GB of physical disk space, the client partition sees 30 GB of disk space in total. 

After the client partition starts writing to the disks, physical blocks will be allocated in the shared storage pool and the amount of free space in the shared storage pool will decrease. Deleting files or logical volumes from the shared storage pool, on a client partition does not increase free space of the shared storage pool.

When the shared storage pool is full, client partitions will see an I/O error on the virtual SCSI disk. Therefore even though the client partition will report free space to be available on a disk, that information might not be accurate if the shared storage pool is full. 

To prevent such a situation, the shared storage pool provides a threshold that, if reached, writes an event in the errorlog of the Virtual I/O Server.

(If you use -thick flag with mkdbsp command, not a thin provisioned disk, but a usual disk (thick) will be created and client will have all the disk space.)

------------------------------------------------------------------------------

Creating SSP

When a cluster is created, we must specify one physical volume for the repository disk and one for the usual storage pool data, which provides storage to the client partitions. The repository disk is used to perform cluster communication and store the cluster configuration.

If you need to increase the free space in the shared storage pool, you can either add an additional physical volume or you can replace an existing volume with a bigger one. Removing a physical volum will fail if there is not enough free space in the shared storage pool to accommodate the data from the physical volume that is removed.  


Requirements:
-each VIO Server must resolve correctly other VIO servers in cluster (DNS or /etc/hosts must be filled up with all VIO Servers)
-hostname command should show FQDN (with domain.com)
-VLAN tagging interfaces are not supported in earlier VIO versions for cluster communications
-fibre channel adapter should be set to dyntrk=yes, fc_err_recov=fast_fail
-disks reserve policy should be set to no_reserve and all VIO Server must have these disk in available state.
-1 disk is needed for repository (min 10GB) and 1 or more for data (min 10GB) (these should be SAN FC LUNs)
-Active Memory Sharing paging space cannot be on SSP disk


# cluster -create -clustername bb_cluster -spname bb_pool -repopvs hdiskpower1 -sppvs hdiskpower2 -hostname bb_vio1
        clustername    bb_cluster                                                <--name of the cluster
        -spname bb_pool                                                          <--storage pool name
        -repopvs hdiskpower1                                                     <--disk of repository
        -sppvs hdiskpower2                                                       <--storage pool disk
        -hostname bb_vio1                                                        <--VIO Server hostname (where to create cluster)

(This command will create cluster, start CAA daemons and create shared storage pool)
(On HMC v9 it is possible to create SSP in GUI, which makes it very easy.)


------------------------------------------------------------------------------

General commands:

cluster ...        <--for cluster create, add/remove node, list, status
lssp ...           <--for the pool free space
lu ...             <--for virtual disk create and control
pv ...             <--for controlling the LUNs in the LUN pool
failgrp ...        <--for creating the pool mirror
lscluster ...      <--for high level view of the hdisk / LUN names
(mkbdsp, rmbdsp commands are available but they have complicated syntax, so IBM created later new commands for easier usafe like: lu, pv)

/var/vio/SSP                                                       cluster related directory (and files) will be created in this path

cluster -list                                                      display cluster name and ID
cluster -status -clustername bb_cluster                            display cluster state and pool state on each node
cluster -addnode -clustername bb_cluster -hostname bb_vio2         adding node to the cluster
cluster -rmnode -clustername bb_cluster -hostname bb_vios1         remove node from cluster
cluster -delete -clustername bb_cluster                            remove cluster completely

lssp -clustername bb_cluster                                       list storage pool details (pool size, free space...)
lssp -clustername bb_cluster -sp bb_pool -bd                       list created LUNs in the storage pool (backing devices in lsmap -all)

lspv -clustername bb_cluster -sp bb_pool                           list physical volumes of shared storage pool (disk size, id)
lspv -clustername bb_cluster -capable                              list which disk can be added to the cluster
lsmap -clustername SSP_Cluster_1 -all                              list disk mappings to vscsi devices

                                                                                 
storage commands:
pv -list
pv -add hdisk3 hdisk4                                              add 2 disks to ssp
pv -remove -pv hdisk4                                              remove a pv from ssp 
                                                                   (fails if not enough free space in ssp to accomodate data of the pv)
pv –replace –clustername bb –sp mysp –oldpv hdisk1 -newpv hdisk2   replace hdisk1 with hdisk2 in ssp

lu -list                                                           list lu name, size, ID (lu commands are since VIOS 2.2.3.1)
lu -list -verbose                                                  lists all details in stanza (thin, tier, snapshot…)
lu -list -fmt : -field LU_SIZE LU_USED_PERCENT LU_USED_SPACE LU_UNUSED_SPACE   lists spec. fields (good for scripting)
lu -list -attr provisioned=true                                    list lus that are mapped to an LPAR
lu -list -attr provisioned=false                                   list lus that are not mapped to an LPAR
lu -resize -lu <disk> -size 128G                                   change the size of the logical unit
lu -create -lu vdisk1 -size 10G                                    create a lun with 10GB
lu -remove -lu vdisk1                                              remove a lun (this is newer command than rmdsp)
lu –map –lu vdisk1 –vadapter vhost1                                maps a lun to a vscsi adapter
lu -unmap ...                                                      unmaps a lun from a vhost adapter


failgrp commands: (A failure group (a mirror) is a set of physical volumes that are treated as a single point of failure by the system.)
failgrp -create ...                                                create failure group
failgrp -remove ...                                                remove failure group
failgrp -list (-verbose) ...                                       list failure group
failgrp -modify ...                                                modify failure group


CAA commands:
lscluster -c                                                       list cluster configuration
lscluster -d                                                       list disk details of the cluster
lscluster -m                                                       list info about nodes (interfaces) of the cluster
lscluster -s                                                       list network statistics of the local node (packets sent...)
lscluster -i -n bb_cluster                                         list interface information of the cluster

odmget -q "name=hdiskpower2 and attribute=unique_id" CuAt          checking LUN ID (as root)

cleandisk -r hdiskX                                                clean cluster repository disk signature from hdisk
cleandisk -s hdiskX                                                clean storage pool signature (after this disk can be added to SSP)
chrepos -n globular -r +hdisk16                                    move/rebuild repo. disk on hdisk16 (repo. issues won't bring down SSP)
chrepos -n -r +hdisk5 -hdisk1                                      replace repository disk (hdisk1 is replaced with new hdisk5)

-----------------------
storage commands (old):
mkbdsp -clustername bb_cluster -sp bb_pool 10G -bd bb_disk2                      creating a 10G LUN
mkbdsp -clustername bb_cluster -sp bb_pool -bd bb_disk2 -vadapter vhost0         assigning LUN to a vhost adapter (lsmap will show)
mkbdsp -clustername bb_cluster -sp bb_pool -luudid c7ef7a2 -vadapter vhost0      same as above just with LUN ID
rmbdsp -clustername bb_cluster -sp bb_pool -bd bb_disk1                          remove LUN (backing device will be deleted from vhost)
chsp -add -clustername bb_cluster -sp bb_pool hdiskpower2                        adding disk to a shared storage pool
-----------------------

------------------------------------------------------------------------------

Create cluster and Shared Storage Pool:

1. create a cluster and pool: cluster -create ...
2. adding additional nodes to the cluster: cluster -addnode
3. checking which physical volume can be added: lspv -cluatername clusterX -capable
4. adding physical volume: chsp -add
5. create and map LUNS to clients: mkdsp -clustername...

------------------------------------------------------------------------------

Add new LUN to SSP and PowerVC (via HMC)

1. request new LUN from Storage team to all VIO servers
2. cfgmgr on VIO servers (you should see new disks)
3. on HMC: Shared Storage Pool --> click on our SSP --> on the new page click on the check button --> Action --> Add capacity

------------------------------------------------------------------------------

Replacing disks


Replacing a pv
chsp command will replace the original disk (oldpv) with the new disk (newpv).  The command can be run from any node in the cluster.(Before replacing a disk, make sure disk is available on all nodes, if lspv output is the same on all nodes disk replacement happens automatically on all nodes.)

replacing oldpv/hdisk6 with newpv/hdisk5:
$ chsp -replace -clustername mycluster -sp mysp -oldpv hdisk6 -newpv hdisk5
Current request action progress: % 5
Current request action progress: % 11
Current request action progress: % 99
Current request action progress: % 100
Current request action progress: % 100

same as above just using newer pv command:
$ pv –replace –clustername mycluster –sp mysp –oldpv hdisk6 -newpv hdisk5

If lspv output is the same on all nodes, the SSP disk replacement is automatically propagated to all nodes in the cluster. At this point, the oldpv is released and can be removed. This procedure can be done while SSP storage is provisioned to an AIX client. In the above example and AIC LPAR used the disk for user volume group with a file system where file system I/O was happening. AIX client errlog showed no new entries during and after the SSP disk was replaced.


Replacing repository disk
The replace operation works on a functional or failed repository disk. When the repository disk fails, the cluster remains operational. While the repository disk is in a failed state, all requests for cluster configuration fail. After you replace the failed disk, the cluster will be fully functional

the hdisk1 repository disk is replaced with the hdisk5 repository disk:
$ chrepos -n -r +hdisk5 -hdisk1

------------------------------------------------------------------------------

Removing LUN:

$ lu -list -attr provisioned=false
POOL_NAME: SSP_1
TIER_NAME: System
LU_NAME                 SIZE(MB)    UNUSED(MB)  UDID
bb-aix-110-NovaLink-d1  51200       0           7d2750b08a772e1dbeb9adbcdc98f76c
volume-bb-aix-pci61m-1~ 153600      0           505efe7dd1b204bf112563d820a44df2
volume-my-openstack--2~ 153600      0           590de5e7109ce9087e2c521904466241

$ lu -remove -clustername SSP_Cluster_1 -lu ld-aix-h10-NovaLink-d1
Logical unit bb-aix-110-NovaLink-d1 with udid "7d2750b08a772e1dbeb9adbcdc98f76c" is removed.

$ lu -remove -clustername SSP_Cluster_1 -luudid 590de5e7109ce9087e2c521904466241
Logical unit  with udid "590de5e7109ce9087e2c521904466241" is removed.

------------------------------------------------------------------------------

Managing snapshots:

Snapshots from a LUN can be created which later can be restored in case of any problems

# snapshot -create bb_disk1_snap -clustername bb_cluster -spname bb_pool -lu bb_disk1    <--create a snapshot

# snapshot -list -clustername bb_cluster -spname bb_pool                                 <--list snapshots of a storage pool
Lu Name          Size(mb)    ProvisionType    Lu Udid
bb_disk1         10240       THIN             4aafb883c949d36a7ac148debc6d4ee7
Snapshot
bb_disk1_snap

# snapshot -rollback bb_disk1_snap -clustername bb_cluster -spname bb_pool -lu bb_disk1  <--rollback a snapshot to a LUN
$ snapshot -delete bb_disk1_snap -clustername bb_cluster -spname bb_pool -lu bb_disk1    <--delete a snapshot

------------------------------------------------------------------------------

Checking if an LU is a clone from other LU (or not)

The LU_UDID_DERIVED_FROM field tells you (if it has a value) this LU is a clone of the other LU with that particular LU_UDID or "N/A" means it is not a clone.

$ lu -list -verbose | grep -p 775f0715fe27ef06914cccb9194607a0
...
LU_PROVISION_TYPE:THIN
LU_UDID_DERIVED_FROM:775f0715fe27ef06914cccb9194607a0         <-- clone of the below
LU_MOVE_STATUS:N/A
LU_SNAPSHOTS:N/A

...
LU_PROVISION_TYPE:THIN
LU_UDID_DERIVED_FROM:N/A                                      <-- master copy
LU_MOVE_STATUS:N/A
LU_SNAPSHOTS:0d932572c08ca5523a43c64a209d7832IMSnap

----------------------------------------------------------------------------

Migrating an LPAR to PowerVC on SSP (with "dd")

We had to move an old Linux LPAR from an old Power Server with vSCSI to a new Power Server with SSP. This new Power server was managed by PowerVC. The old LPAR was using a vSCSI LUN (as a VIO client), and we copied this LUN with "dd" into the SSP.

1. # shutdown -h now                                              <--stop the Linux server we want to migrate (to avoid any io errors)

2. # dd if=/dev/rh5.d1 of=/home/rh5.d1.dd bs=1M                   <--save with dd the disk of Linux server on VIO
                                                                  (as root on the VIO, check ulimit and free space)

3. create a new VM (rh5_new) in PowerVC with an empty boot disk   <--boot disk should have exactly the same size as the original LPAR

4. # mount nim01:/migrate /mnt                                    <--copy or nfs mount the dd file to the VIO server which has the SSP

5. # ls -ltr /var/vio/SSP/SSP_Cluster_1/D_E_F_A_U_L_T_061310/VOL1 <--find the LUN on VIOS with SSP where we need to do the dd again
                                                                  (all SSP data is under this directory)                   
--w-------    1 root     system          253 Apr 24 12:46 .volume-rh5_new.d1-936e9092-fb3c.7e6745bce57e4b5c01452e91f0322feb
-rwx------    1 root     system   75161927680 Apr 24 12:56 volume-rh5_new.d1-936e9092-fb3c.7e6745bce57e4b5c01452e91f0322feb
-rwx------    1 root     system   75161927680 Apr 24 12:56 volume-rh5_new-692aa120-0000007a-boot-0-565121dd-87d3.8fa2e2c8b1c6ca63f059a86f32389544
--w-------    1 root     system          327 Apr 24 12:57 .volume-rh5_new-692aa120-0000007a-boot-0-565121dd-87d3.8fa2e2c8b1c6ca63f059a86f32389544
(the files with . are not important, from the big size files, we need only which contains "boot", this belong to the RedHat VM, the other is just the volume used in the general image)

6. dd to this file:
# dd if=/mnt/rh5.d1.dd of=/var/vio/SSP/SSP_Cluster_1/D_E_F_A_U_L_T_061310/VOL1/volume-rh5-new-692aa120-0000007a-boot-0-565121dd-87d3.8fa2e2c8b1c6ca63f059a86f32389544 bs=1M
71680+0 records in.
71680+0 records out.

After that VM can be started. We need to go to the SMS menu to manually choose disk device:
5.   Select Boot Options
2.   Configure Boot Device Order
1.   Select 1st Boot Device
6.   List All Devices
2.        -      SCSI 69 GB Harddisk, part=1 ()
2.   Set Boot Sequence: Configure as 1st Boot Device

After that during boot, the boot device was found, but we had an error:  can't allocate kernel memory

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
/
Elapsed time since release of system processors: 121069 mins 33 secs

Config file read, 1024 bytes
Welcome
Welcome to yaboot version 1.3.13 (Red Hat 1.3.13-14.el5)
Enter "help" to get some basic usage information
boot: linux
Please wait, loading kernel...
Claim error, can't allocate 900000 at 0xc00000
Claim error, can't allocate kernel memory
boot:

The solution was to change below address from c00000 to 2000000.
To do this do another reboot and go to Firmware Prompt, and do following steps:
 8 = Open Firmware Prompt           

     Memory      Keyboard     Network     Speaker  ok
0 > printenv real-base
-------------- Partition: common -------- Signature: 0x70 ---------------
real-base                c00000              c00000
 ok
0 > setenv real-base 2000000  ok
0 > printenv real-base
-------------- Partition: common -------- Signature: 0x70 ---------------
real-base                2000000             c00000
 ok
0 > reset-all

After that reboot was successful and old Linux server was running nicely on the new hardware with SSP.

----------------------------------------------------------------------------

Setting alerts for Shared Storage Pools:

As thin provisioning is in place, real storage free space cannot be seen exactly. If storage pool gets 100% full, IO error will occur on client LPAR. To avoid this alerts can be configured:

$ alert -list -clustername bb_cluster -spname bb_pool
PoolName                 PoolID                             Threshold%
bb_pool                  000000000A8C1517000000005150C18D   35                        <--it shows the free percentage

# alert -set -clustername bb_cluster -spname bb_pool -type threshold -value 25        <--if free space goes below 25% it will alert

# alert -list -clustername bb_cluster -spname bb_pool
PoolName                 PoolID                             Threshold%
bb_pool                  000000000A8C1517000000005150C18D   25                        <--new value can be seen here

$ alert -unset -clustername bb_cluster -spname bb_pool                                <--unset an alert

in errlog you can see the warning:
0FD4CF1A   0424082818 I O VIOD_POOL      Informational Message

----------------------------------------

VIO + SSP Backups
https://www.ibm.com/developerworks/community/blogs/cgaix/entry/Automatically_backup_VIOS_configuration_changes?lang=en

on VIO, under the crontab of root:
0 * * * * /usr/ios/sbin/autoviosbr -start 1>/dev/null 2>/dev/null

Every hour takes a node backup (VIOS config) + on the database node of SSP cluster a cluster backup (SSP config)
The location is in home dir under cfgbackups (/home/padmin/cfgbackups)

Checking the status:
$ viosbr -autobackup status -type node
Node configuration changes:Complete.                    <--complete means: we have a backup already
                                                           pending means: we have changes which will be saved the next hourly backup
viosbr -autobackup status -type cluster                 <--same for the cluster backup

Checking the SSP database node:
$ cluster -list
CLUSTER_NAME:    SSP_Cluster_1
CLUSTER_ID:      e9ebb214090711e8800298be946fc362

$  cluster -status -clustername SSP_Cluster_1 -verbose | grep -p DBN
    Node Name:            ls-aix-h01.mgmt.lab.dynatrace.org
    Node Id:              e9f36c52090711e8800298be946fc362
    Node MTM:             8284-22A02783844X
    Node Partition Num:   1
    Node State:           OK
    Node Repos State:     OK
    Node Upgrade Status:  2.2.6.21 ON_LEVEL
    Node Roles:           DBN
        Pool Name:        SSP_1
        Pool Id:          FFFFFFFFAC17583D000000005A75F1BF
        Pool State:       OK

----------------------------------------