Overview
VM Recovery Manager HA is a high availability solution to automatically recovery virtual machines (VMs), that is, logical partitions (LPARs), if any downtime to software stack results in disruption of servers. It recovers VMs (LPARs) based on the VM restart technology. In this article, we explain the various commands to configure VM Recovery Manager HA from CLI using the ksysmgr
command.
About ksysmgr command
The ksysmgr
command provide an interface to configure KSYS (control system) and to perform various VM Recovery Manager HA operations.
Commands to create, verify, sync, query, and delete KSYS cluster
Use the following information to find the syntax for create, verify, query and delete a KSYS cluster.
How to create a KSYS cluster
The basic format for using the cluster creation command is as follows:
ksysmgr add ksyscluster <cluster_name> ksysnodes=<ksys node hostname> type=HA
Example:
ksysmgr add ksyscluster HA_CLUSTER ksysnodes=hostname type=HA
Description: This command creates a cluster based on the type specified.
How to verify a KSYS cluster
ksysmgr verify ksyscluster <cluster_name>
Example:ksysmgr verify ksyscluster HA_CLUSTER
Description: This command verifies whether the cluster is created or not.
How to sync a KSYS cluster
ksysmgr sync ksyscluster <cluster_name> # It will start ksys sub system
Example:ksysmgr sync ksyscluster HA_CLUSTER
Description: This sync command starts the KSYS daemon.
How to create a KSYS cluster with the sync option
ksysmgr add ksyscluster <name> ksysnodes=<ksys node name> sync=yes type=HA
Example:
ksysmgr add ksyscluster HA_CLUSTER type=HA ksysnodes=hostname sync=yes
Description: This single command creates the KSYS cluster, verifies it, and starts it.
Commands to add, modify, and delete HMC from a KSYS cluster
This section provides information on how to add, modify, and delete HMC from a KSYS cluster.
How to add a HMC to a KSYS cluster
ksysmgr add hmc <name> login=<usrname> password=<password> <hostname|ip>=<hostname|ip>
Example:
ksysmgr add hmc hmc123 login=hscroot password=xyz123 hostname|ip=x.x.x.x|x.x.x.x
Description: This command adds a Hardware Management Console (HMC) by using a login username and password, and host name with IP.
How to query for HMC details from a KSYS cluster
ksysmgr query hmc [hmcName1]
Example:
ksysmgr q hmc hmc123
Description: This command queries and gives output for HMC which is configured to the KSYS cluster.
How to modify HMC details in a KSYS cluster
ksysmgr modify hmc <hmcname> [login|password|hostname|ip=username|pwd|hostname|ip]
Example:
ksysmgr modify hmc hmc123 hostname=hmc.aus.stglabs.ibm.com
Description: HMC host name, IP, login, and password can be modified.
How to delete HMC from a KSYS cluster
ksysmgr delete hmc <hmcname>
Example:
ksysmgr delete hmc hmc123
Description: This command deletes the HMC from the KSYS cluster.
Commands to add host to KSYS cluster
Use the following information to find the syntax for adding a host to a KSYS cluster.
How to add a host to a KSYS cluster
Ksysmgr add host <hostname>
Example:
ksysmgr add host host1
Description: This command adds a host to the KSYS cluster.
How to modify the host attributes in a KSYS cluster
ksysmgr modify host <host1> [ha_monitor| skip_power_on|vmfd]
Example:
ksysmgr modify host host1 ha_monitor=enable
Description: This command modifies the host attributes to the respective values.
How to query a host in a KSYS cluster
ksysmgr query host
Example:
ksysmgr q host host1
Description: This command queries and provides the details for host1.
Commands to query VIOS details from a KSYS cluster
Use the following information to find the syntax for querying VIOS from a KSYS cluster.
How to query VIOS details from a KSYS cluster
ksysmgr query vios [viosname]
Example:
ksysmgr q vios viosname1
Description: This command queries and provides the details for viosname1.
Commands to manage/unmanage VIOS/VM
Use the following information to find the syntax for managing or unmanaging VIOS or a VM.
How to unmanage VIOS instances using ksysmgr
ksysmgr unmanage vios <vios_name1,vios_name2..n>
Example:
ksysmgr unmanage vios vios_name1,vios_name2
Description: This command unmanages vios_name1 and vios_name2 instances.
How to manage VIOS using ksysmgr
ksysmgr manage vios <vios_name1,vios_name2..n>
Example:
ksysmgr manage vios vios_name1,vios_name2
Description: This command manages vios_name1 and vios_name2 instances.
How to unmanage a VM using ksysmgr
ksysmgr unmanage VM <VMname1,VMname2..n>
Example:
ksysmgr unmanage VM VMname1,VMname2
Description: This command unmanages the VMs, VMname1 and VMname2.
How to manage a VM using ksysmgr
ksysmgr manage VM <VMname1,VMname2..n >
Example:
ksysmgr manage VM VMname1,VMname2
Description: This command manages the VMs, VMname1 and VMname2.
Commands to query shared storage pool (SSP) disk from a KSYS cluster
Use the following information to find the syntax for querying SSP disks from the VIOS instances.
How to query an SSP disk from a managed VIOS
ksysmgr query viodisk vios=<vios1,vios2..n>
Example:
ksysmgr q viodisk vios=vios1,vios2
Description: This command queries for free shared disks on vios1 and vios2 instances.
Commands to create, query, modify, delete host groups from a KSYS cluster
Use the following information to find the syntax for querying, modifying, and deleting a host group from a KSYS cluster.
How to add a host goup to a KSYS cluster
ksysmgr add hg <hg_name> hosts=host1,host2 repo_disk=<ID> ha_disk=<ID>
Example:
ksysmgr add hg HG1 hosts=host1,host2 repo_disk=abcd ha_disk=def
Description: This command adds a host group with host1 and host2 as hosts, abcd as the repo_disk, and def as the ha_disk to the KSYS cluster.
Note that repo_disk
and ha_disk
are optional while adding a host group.
How to query a host goup using ksysmgr
ksysmgr q host_group [host_group]
Example:
ksysmgr q host_group HG1
Description: This command queries and provides the output for HG1.
How to modify host group attributes using ksysmgr
The host_group attributes can be modified using flags to add, remove, and options flags.
How to add hosts in a host group using ksysmgr
ksysmgr modify host_group <name> add hosts=<host3,host4>
Example:
ksysmgr modify hg HG1 add hosts=host3,host4
Description: This command modifies the host group to add the host3 and host4 hosts to the KSYS cluster.
How to remove hosts from a host group using ksysmgr
ksysmgr modify host_group <name> remove hosts=<host1,host2>
Example:
ksysmgr modify hg HG1 remove hosts=host1,host2
Description: This command modifies the HG1 host group to remove the host1 and host2 hosts from it.
How to modify attributes other than that of a host group using ksysmgr
ksysmgr modify host_group <host_group> options <attribute>
Example:
ksysmgr modify hg HG1 options memory_capacity=minimum && priority=low
ksysmgr modify hg HG1 options cpu_capacity=minimum && priority=low
ksysmgr modify hg HG1 options skip_power_on=yes ksysmgr modify hg HG1 options ha_disk=abcd1
ksysmgr modify hg HG1 options repo_disk=def1
ksysmgr modify hg HG1 options ha_monitor=enable
ksysmgr modify hg HG1 options restart_policy=auto
ksysmgr modify hg HG1 options vm_failure_detection_speed=fast
ksysmgr modify hg HG1 options host_failure_detection_time=90
Description: These commands are used to modify the various attributes in the HG1 host group.
Commands to perform KSYS discovery
Use the following information to find the syntax for performing the discovery.
How to perform discovery
ksysmgr discovery hg <host_group_name>
Example:
ksysmgr discovery hg HG1
Description: This command performs discovery on the HG1 host group.
How to perform discovery and verify it in single command
Ksysmgr discovery hg <host_group_name> verify=yes
Example:
ksysmgr discovery hg HG1 verify=yes
Description: This command performs discovery and verifies the same for the HG1 host group.
Commands to monitor detailed discovery and quick discovery
Use the following information to find the syntax for monitoring quick discovery and detailed discovery.
How to monitor detailed or deep discovery run by KSYS in the ba ckground
ksysmgr q system status monitor=yes
Example:
ksysmgr q system status monitor=yes
Description: This command monitors the status of discovery run by a scheduler.
How to monitor quick discovery run by KSYS in the background
ksysmgr q system status monitor=yes
Example:
ksysmgr q system status monitor=yes
Description: This command monitors the status of quick discovery run by the scheduler.
How to monitor a user-initiated discovery run in the background
ksysmgr q system status monitor=yes
Example:
ksysmgr q system status monitor=yes
Description: This command monitors the status of quick discovery run by the user.
How to check for KSYS errors, if discovery / Live Partition Mobility (LPM) / restart fails
ksysmgr q system status
Example:
ksysmgr q system status
Description: This command displays an error message on the console stating why discovery/LPM/restart has failed.
Commands to collect snapshot
KSYS supports three types of snapshots: CLUSTER snapshot, DETAILED snapshot, and BASIC snapshot.
How to collect a CLUSTER snapshot using ksysmgr
ksysmgr add snapshot filepath=<path> type=CLUSTER
Example:
ksysmgr add snapshot filepath=/var/ksys/snapshots/a type=CLUSTER
Description: This command takes a snapshot of type CLUSTER and stores it at the default path.
How to collect a BASIC snapshot using ksysmgr
ksysmgr add snapshot filepath=<path> type=BASIC
Example:
ksysmgr add snapshot filepath=/var/ksys/snapshots/a type=BASIC
Description: This command takes a snapshot of type BASIC and stores it at the default path.
How to collect DETAILED snapshot using ksysmgr
ksysmgr add snapshot filepath=<path> type=DETAILED
Example:
ksysmgr add snapshot filepath=/var/ksys/snapshots/a type=DETAILED
Description: This command takes a snapshot of type DETAILED and stores it at the default path.
Where will the snapshots be collected if the path is not specified
Default path for snapshots is /var/ksys/snapshots.
Commands to restore a snapshot
Use the following information to find the syntax for restoring snapshots.
How to restore snapshot for CLUSTER, BASIC, and DETAILD snapshots
ksysmgr restore snapshot filepath=/var/ksys/snapshots/snap
Commands to delete a KSYS cluster
Use the following information to delete a KSYS cluster.
How to delete a KSYS cluster
Ksysmgr delete ksyscluster <cluster_name>
Example:
ksysmgr delete ksyscluster HA_CLUSTER
Description: This command deletes the KSYS cluster from the ksysnode. If the operation fails, an error message is displayed.
How to delete a KSYS cluster with force option
ksysmgr -f delete ksyscluster <cluster_name>
Example:
ksysmgr -f delete ksyscluster HA_CLUSTER
Description: The -f option in this command deletes the KSYS cluster from ksysnode forcefully.
KSYS logs path/location for troubleshooting
This section provides information about the path of the KSYS logs for troubleshooting.
Where can you find ksysmgr logs
ksysmgr logs are available at the following path:/var/ksys/log/ksysmgr.log
Where ksysmgr execution commands will be logged
ksysmgr execution commands will be logged at the following path:/var/ksys/log/ksysmgr.oplog
Where KSYS traces will be logged
KSYS traces will be logged at the following path:/var/ct/<cluster_name>/log/mc/IBM.VMR
Example:
/var/ct/HA_CLUSTER/log/mc/IBM.VMR
Which tool is used to extract KSYS traces
The rpttr tool is used to extract the traces.
How to view live traces using rpttr
You can view live traces using the rpttr tool.
Example:
rpttr -fodict trace.ksys.*
How to extract traces using rpttr
Example:
rpttr -fodict trace.ksys.* > ksys.txt
Conclusion
The article can help users to create and configure KSYS clusters and a provide a suitable environment by using the ksysmgr CLI.