LKCLI provides functions that can be performed with the LifeKeeper GUI through the command line interface. LifeKeeper provides export/import of communication paths and resource information which the GUI does not provide. Export/import functionality enables duplicating a created system and easy deployment from a testing environment to a production environment.
Supported Environments
LKCLI is supported in the following environments:
- Number of nodes – Only a two-node cluster environment is supported.
- OS – All operating systems supported by LifeKeeper are supported.
- Communication path – Supported only in environments where nodes are connected via TCP/IP.
- Application Recovery Kits – Only environments configured with the Application Recovery Kits in the “Supported ARK List” are supported. If unsupported ARK resources have been created on a node, the environment is not supported. If you want to perform command line operations in an unsupported environment, please consider using the Command Line Interface.
How to Run as User Other Than Root
To run LKCLI, users must be a member of one of the following three groups: lkadmin, lkoper or lkguest. Please refer to Configuring GUI Users for more information. When running LKCLI as a user other than root, run using a sudo command. The LKCLI command must be specified with an absolute path. When running the command, authentication of the user who runs the sudo command is performed. The following is an example of LifeKeeper startup.
$ sudo /opt/LifeKeeper/bin/lkcli start
LifeKeeper sudo settings can be performed in /etc/sudoers.d/lifekeeper. If LifeKeeper settings are not included in /etc/sudoers, include ”#includedir /etc/sudoers.d” or ”#include /etc/sudoers.d/lifekeeper” in /etc/sudoers. You can also specify paths by configuring the secure_path option in /etc/sudoers and modify the authentication settings. Refer to man sudoers(5) for more information.
Restriction
- When the hostname is not configured properly, the GUI cannot be started and the GUI login fails. At this point, some of the lkcli commands can be used but many of the processes of the lkcli commands will stop. Ensure that the hostname is configured properly.
Commands
lkcli license | Install a license key |
lkcli start | Starts LifeKeeper |
lkcli stop | Stops LifeKeeper |
lkcli import | Creates communication paths, resources |
lkcli export | Exports communication paths, resources information |
lkcli clean | Deletes communication paths, resources |
lkcli commpath | Operates on communication paths |
lkcli dependency | Operates on dependencies |
lkcli resource | Operates resources |
lkcli status | Lists resource status |
lkcli log | Displays a LifeKeeper log |
lkcli server | Configures/operates servers |
lkcli mirror | Operates DataKeeper mirroring |
lkcli esxi | Setting up the ESXi host used by the VMDK Recovery Kit |
Common Options Available for All Commands
Option | Default | Description |
---|---|---|
[--remote <str>] | Hostname of the machine where you want to run a command. If the option is not specified, the command is executed on the local machine. Before you can execute commands remotely, the machine on which you want to execute the command and the communication path must be bidirectionally connected. Note: The start,stop, commpath and clean commands are not supported with this option. |
lkcli license
Registers your LifeKeeper license.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--file <str> | A path to the license file |
lkcli start
Permission | lkadmin |
---|
Starts LifeKeeper
lkcli stop
Stops LifeKeeper
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
[-f] | Stops only the LifeKeeper daemon and does not stop protected services. | |
[-r] | Stops LifeKeeper without changing the settings for automatic startup of the LifeKeeper daemon. | |
[-n] | Performs failover when LifeKeeper stops. This option cannot be used with -f, -i, or -r. | |
[-i] | Stops only the LifeKeeper daemon and does not stop protected services. The user is prompted to confirm (yes/no) that they want to continue. |
lkcli import
Reads the LifeKeeper settings from a file and creates communication paths and resources.
lkcli import commpath
Reads LifeKeeper settings from a file and creates communication paths. In order to connect a communication path bidirectionally, execute this command on both the local machine and the remote machine.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--file <str> | A LifeKeeper configuration file path. Create a communication path from a file (YAML format) where the output was saved with lkcli export. The communication path protocol that can be created is TCP/IP (socket). |
lkcli import resource
Reads LifeKeeper settings from a file and creates resources.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--file <str> | A LifeKeeper configuration file path. Create a resource hierarchy from a file (YAML format) where the output was saved with lkcli export. Refer to the ARKs listed in the ARKs list for resource types that can be imported. |
Notes:
- This command fails if the environment including the hostname, IP address or application is not prepared.
- Rollback is not performed even if it fails. Only some resources may be created.
- Execution of the command where resources already exist is not supported.
lkcli export
Exports LifeKeeper settings.
The current LifeKeeper settings are exported. The node where the command is executed and all nodes to which the communication path is connected are targeted.
Save the output in a file in YAML format.
# lkcli export > lk_export.yml
Notes:
- The communication path protocol that can be export is TCP/IP (socket).
- Refer to the ARKs list for resources that can be exported.
- The resource status (In Service, Out of Service, etc.) is not exported.
- The server property value is not exported.
- Only the configured values on LifeKeeper are exported. The settings of the protected applications are not exported.
- For the exported configuration file, edit only the hostname and IP address manually. Manual changes to other items are not supported.
Permission | lkadmin |
---|
lkcli clean
Deletes LifeKeeper settings.
Delete the communication path and resource settings of the node where the command was executed. If you want to delete LifeKeeper configurations on all nodes, execute this command on all nodes. Please note that if the communication path is deleted at this time, commands cannot be executed remotely.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--mode <str> | Specify “all” or “resource”.
|
lkcli commpath
Operates communication paths.
lkcli commpath create
Creates a communication path for the node where the command is executed. The created communication path is the path from the local machine to the remote machine. Execute this command on both the local machine and the remote machine to connect a communication path in both directions. The communication path protocol that can be created is TCP/IP (socket).
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--laddr <str> | IP address on the local machine to be set for the communication path. | |
--raddr <str> | IP address on the remote machine to be set for the communication path. | |
--dest <str> | Hostname of the remote machine to be set for the communication path. | |
[--priority <str>] | Maximum value of existing paths +1 | Priority of the communication path. Note: Specify the same value on both the local machine and the remote machine. |
lkcli commpath delete
Deletes the communication path of the node where the command was executed.
The communication path to be deleted is the path from the local machine to the remote machine. Execute this command on both the local machine and the remote machine to delete communication paths in both directions,
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--laddr <str> | IP address on the local machine to be set for the communication path. | |
--raddr <str> | IP address on the remote machine to be set for the communication path. | |
--dest <str> | Hostname of the remote machine to be set for the communication path. |
lkcli dependency
Creates/deletes dependencies for LifeKeeper resources.
lkcli dependency create
Creates a new dependency between two resources.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--parent <str> | The tag name of the parent resource. | |
--child <str> | The tag name of the child resource. |
lkcli dependency delete
Deletes the dependency between the two resources.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--parent <str> | The tag name of the resource that is a parent of the dependency you want to delete. | |
--child <str> | The tag name of the resource that is a child of the dependency you want to delete. |
lkcli resource
Operates on the LifeKeeper resources.
lkcli resource create
Creates resources.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--tag <str> | Tag name of the resource to create. Existing tag names cannot be created. See Resource Tag Name Restrictions for more details. |
|
[--switchback <str>] | INTELLIGENT | Switchback settings for the resource. Specify “INTELLIGENT” or “AUTOMATIC”. |
OPTIONS FOR EACH ARK | Options vary by ARK. See Subcommands for Each ARK for options for each ARK. |
lkcli resource extend
Extends resources.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--tag <str> | Tag name of the resource to extend. Tag names that exist on the extension target cannot be extended. See Resource Tag Name Restrictions for more details. |
|
--dest <str> | The hostname of the target server where the resource hierarchy is extended. | |
[--switchback <str>] | INTELLIGENT | Switchback settings for the resource. Specify “INTELLIGENT” or “AUTOMATIC”. |
[--template_priority <num> | 1 | The priority of the resource hierarchy from which to extend. For the priority, unused values from 1 to 999 are valid, with lower numbers having higher priority. |
[--target_priority <num> | 10 | The priority of the extension target resource hierarchy. For the priority, unused values from 1 to 999 are valid, with lower numbers having higher priority. |
OPTIONS FOR EACH ARK | Options vary by ARK See Subcommands for Each ARK for options for each ARK. |
lkcli resource config
Changes resource settings.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--tag <str> | The tag name of the resource to change. | |
OPTIONS FOR EACH ARK | Options vary by ARK See Subcommands for Each ARK for options for each ARK. |
lkcli resource unextend
Unextends the resource.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--tag <str> | Tag name of the resource to unextend. | |
--dest <str> | The hostname of the target server where you want to unextend the resource hierarchy. |
lkcli resource delete
Deletes a resource.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--tag <str> | Tag name of the resource to delete. |
lkcli resource restore
Brings the resource hierarchy on the active node in service.
Permission | lkadmin, lkoper |
---|
Option | Default | Description |
---|---|---|
--tag <str> | The tag name of the resource to bring in service. |
lkcli resource remove
Takes the resource hierarchy on the active node out of service.
Permission | lkadmin, lkoper |
---|
Option | Default | Description |
---|---|---|
--tag <str> | The tag name of the resource to take out of service. |
lkcli resource info
Outputs the resource property information. The output differs for each ARK.
Permission | lkadmin, lkoper, lkguest |
---|
Option | Default | Description |
---|---|---|
--tag <str> | Tag name of the resource for which the property information is output. |
lkcli resource eqv
Outputs the equivalency information of the resource.
Permission | lkadmin, lkoper, lkguest |
---|
Option | Default | Description |
---|---|---|
--tag <str> | Tag name of the resource that for which the equivalency information is output. |
lkcli resource reorder-priority
Changes the priority of a resource on an active node.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--tag <str> | The tag name of the resource where the priority is to be changed. | |
--priority <num> | Priority after the change. For the priority, unused values from 1 to 999 are valid, with lower numbers having higher priority. |
lkcli resource switchback
Change the switchback settings of the resource on the active node.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--tag <str> | The tag name of the resource to change. | |
--switchback <str> | INTELLIGENT | Switchback settings for the resource. Specify “INTELLIGENT” or “AUTOMATIC”. |
lkcli status
Displays LifeKeeper status.
See Detailed Status Display for the output status information.
Permission | lkadmin, lkoper, lkguest |
---|
Option | Default | Description |
---|---|---|
[-q] | Outputs the information of each resource in the local system in a short report. | |
[-e] | Outputs the information of each resource in the local system in a short report and lists the backup system (with the next highest priority). | |
[-u] | Suppresses duplicate resource entries in the output of the command with -q or -e options. | |
[-r <str>] | Specifies the resource root tag. Restrict the report to specific resource root tags. |
lkcli log
Displays LifeKeeper logs.
Permission | lkadmin, lkoper, lkguest |
---|
Option | Default | Description |
---|---|---|
--lines <num> | 10 | Number of log lines to display. |
lkcli server
Performs operations related to the LIfeKeeper server.
lkcli server info
Checks the server shutdown method and failover functionality.
Permission | lkadmin, lkoper, lkguest |
---|
lkcli server shutdown-strategy
Configures the server shutdown method.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--mode <str> | The value of switchover or do_not_switchover.
|
lkcli server confirmso
Configures whether to confirm the user for switching to the backup node when a failover occurs due to a node failure on the LifeKeeper cluster.
See Confirm Failover section in Confirm Failover and Block Resource Failover for details.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--server <str> | Name of the failover target server. | |
--value <str> | enable or disable
|
lkcli server block-failover
Configures settings to block failover caused by a resource failure in the specified system.
See the Block Resource Failover section in Confirm Failover and Block Resource Failover for details.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--server <str> | Name of the failover target server. | |
--value <str> | enable or disable
|
kcli server block-all-failovers
Configures settings to block failover due to either a node failure or a resource failure on all servers. When you deactivate the block setting, review the following settings.
- Failover block setting due to a node failure.
- lkcli server confirmso
- CONFIRMSODEF parameter in the /etc/default/LifeKeeper
- CONFIRMSOTO parameter in the /etc/default/LifeKeeper
- Failover block setting due to a resource failure.
lkcli mirror
Performs mirroring with DataKeeper.
See Mirroring with SIOS DataKeeper for Linux for more information.
Option | Default | Description |
---|---|---|
--tag <str> | Tag name of the DataKeeper resource. |
lkcli mirror status
Displays the status of the mirror.
Permission | lkadmin, lkoper, lkguest |
---|
lkcli mirror resume
Resumes the mirror.
Permission | lkadmin |
---|
lkcli mirror pause
Pauses the mirror.
Permission | lkadmin |
---|
lkcli mirror fullresync
Resyncs the entire mirror with a full disk resynchronization.
Permission | lkadmin |
---|
lkcli mirror force
Forces the mirror to come online, even if LifeKeeper has marked the mirror disk as possibly out of sync.
Permission | lkadmin |
---|
lkcli esxi
Refer to the VMDK Shared Storage Recovery Kit Administration Guide for more information about the VMDK Recovery Kit. Refer to Register ESXi Host and VMDK Maintenance for more information on ESXi host settings.
lkcli esxi add
Adds the ESXi host information. The username and password should be entered interactively if they are not specified as options.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--host <host> | ESXi host name to add. | |
[--user <user>] | Username to log in to the ESXi host. | |
[--password <password>] | Password to log in to the ESXi host. |
lkcli esxi list
Displays the list of ESXi hosts that have been registered.
Permission | lkadmin, lkoper, lkguest |
---|
lkcli esxi update
Updates the ESXi host information that has been registered. The username and password should be entered interactively if they are not specified as options.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--host <host> | ESXi host name to update. | |
[--user <user>] | Username to log in to the ESXi host. | |
[--password <password>] | Password to log in to the ESXi host. |
lkcli esxi delete
Deletes the ESXi host information that has been registered.
Permission | lkadmin |
---|
Option | Default | Description |
---|---|---|
--host <host> | ESXi host name to delete. |
Post your comment on this topic.