Working With ICM

AI Tools

Logging Into the ICM Service

Running commands using the icmcli tool requires login. Use the following command to log in (connect) to the ICM service running on baseUrl:

icmcli login --username=admin --password=light --base-url=https://<ICM-Server>:443
Note

The username and password must be configured correctly in: /etc/icm/.htpasswd These are typically configured at the time of installation. This will return a JWT that authorizes subsequent calls to the ICM API.

The result of this command will sign you into the ICM service and update the ~/.local/intelligent-cluster-management/icm-cli.yaml file with a valid idToken to be consumed by the ICM API.

Example file:

baseUrl: https://<ICM-Server>:443 auth: tokenType: Bearer expiresIn: 2592000 idToken: <returned-jwt-token>

Attaching/Detaching Lightbits Clusters

Once the ICM service is running and an ICM client is configured to consume it, you can attach the Lightbits clusters to the ICM service.

The ICM service can manage multiple Lightbits clusters. A cluster attach operation will update the ICM service with a Lightbits cluster's information.

Attaching a Lightbits Cluster

Attaching a Lightbits cluster involves the following:

  1. Retrieve the ICM service credentials.

  2. Update these credentials on the Lightbits cluster.

  3. Invoke the attach cluster operation.

Step 1: Retrieving the ICM Service Credentials

The information from this step will be needed in the next step for updating the credentials on the Lightbits cluster.

Run the following command on the ICM host:

icmcli get credential -o json

Output example:

{ "pubKeyId": "intelligent-cluster-management-4c26b680-7bf8-11ef-98e2-e338f5c94dea", "pubKey": "<base64-encoded public key>" } A file containing the public-key is stored at: ~/.local/intelligent-cluster-management/<pubKeyId>.pem
Note

Use the exact pubKeyId that the command prints as the credential --id in the next step.

The generated .pem file is used in the next step.

Step 2: Updating the Credentials on a Lightbits Cluster

To authorize the ICM service to interact with the Lightbits cluster you want to use, upload the publicKey/credentials to the Lightbits cluster.

  1. Upload the ICM-decoded public key to the Lightbits server. In the previous step, there was an indication for the pubkey file path to upload ~/.local/intelligent-cluster-management/<pubKeyId>.pem. Here, you will upload this file to the Lightbits server:

    scp ~/.local/intelligent-cluster-management/<pubKeyId>.pem <user>@<LightbitsServer>:/tmp/
  2. Run lbcli create credential command on the Lightbits server:

    The pubKeyId, specified in the file name from the previous step, will be used here as the id of the credential. SSH to the Lightbits server that the credentials were uploaded to, and execute the following (requires system-admin privileges):

    lbcli create credential --project-name=system --type=rsa256pubkey --id=<pubKeyId> /tmp/<pubKeyId>.pem

Once the credentials have been added, the ICM service that generated the credentials is authorized to operate with this Lightbits cluster.

Invoking the Attach Cluster Operation

It is possible to attach a Lightbits cluster using any of the Cluster's API endpoints.

Note

You must have a ping between the ICM host and the NVME IP in the Lightbits cluster; otherwise, the attach will fail.

To attach a Lightbits cluster, run the following command:

icmcli attach cluster --api-endpoint=<LightbitsServer>:443

The output for this action is a workflowId, describing the attach-cluster workflow state and enabling you to monitor the attach operation.

On the ICM service side, the attached cluster is recorded in the ICM etcd registry (under /icm/clusters/<uuid>), so the attachment survives service restarts. The registry has no host port; inspect it with the etcd tooling on the ICM host if needed.

Listing Lightbits Clusters

Run the following command to list the attached Lightbits clusters:

icmcli list clusters

Example of list cluster response:

icmcli list clusters | ID | NAME | SYSTEMNQN | | 8363daca-de96-56f1-a8c1-e9af2ffd5461 | 8363daca-de96-56f1-a8c1-e9af2ffd5461 | nqn.2016-01.com.lightbitslabs:uuid:647229a... | | API ENDPOINTS | ACCESS CONNECTION | PROVISIONED TO EFFECTIVE|STORAGE RATIO| 10.23.29.3:443,192.168.20.117:443 | Connected | 0.0000
Note

The "List Clusters" feature provides an indication of the connectivity status between the ICM and the Lightbits cluster for both DataConnection and AccessConnection.

If a network disruption occurs, this status will change to "Disconnected," helping you quickly identify and diagnose connectivity problems.

Detaching a Cluster

Detaching a cluster can be done by specifying its id. Run the following command to detach a Lightbits cluster:

icmcli detach cluster --cluster-id 4cb2e0bf-20fa-5720-8cc2-1a11fe3e9850

Preparing the Project

ICM manages a single Lightbits project (set at install time via ICM_PROJECT_NAME, default default). Before creating volumes or snapshots, that project must exist on every attached cluster. Create it on each cluster with lbcli:

lbcli create project --name=<project>
Note

If the configured project is missing on the clusters, volume creation fails with "all clusters are unavailable for volume placement".

Volume Commands

Note

Cluster ID can be retrieved by running the icmcli list clusters command.

Create a volume (ICM places it across the attached clusters):

icmcli create volume \ --project-name=<project> \ --name=<volume-name> \ --size=<size, e.g. 10GiB> \ --replica-count=<1|2|3> \ --acl=<host-nqn> # repeatable; use "allow_none" for a closed volume

Common optional flags: --compression=<true|false>, --sector-size=<512|4096>, --source-snapshot-name/--source-snapshot-uuid (create from a snapshot), --placement-affinity=<key:value|key:value>.

List, get, update, and delete volumes:

icmcli list volumes --project-name=<project> [--show-all] [--limit=N] icmcli get volume --project-name=<project> --name=<volume-name> # or --uuid=<uuid> icmcli update volume --project-name=<project> --name=<volume-name> --size=<new-size> [--acl=...] icmcli delete volume --project-name=<project> --name=<volume-name> # or --uuid=<uuid>

Snapshots Commands

Note

Cluster ID can be retrieved by running the icmcli list clusters command.

Create a snapshot from a volume, and then list/get/delete:

icmcli create snapshot --project-name=<project> --name=<snapshot-name> \ --source-volume-name=<volume-name> [--description="..."] [--retention-time=7200s] icmcli list snapshots --project-name=<project> [--show-all] [--limit=N] icmcli get snapshot --project-name=<project> --name=<snapshot-name> # or --uuid=<uuid> icmcli delete snapshot --project-name=<project> --name=<snapshot-name> # or --uuid=<uuid>

Thick Clone Commands (Data Mobility)

A thick clone block-copies a source snapshot into a new, independent volume or snapshot on any attached cluster - including a different cluster from the source. The command returns a workflowId immediately; the copy runs as a workflow that you can monitor.

Prerequisite: storage-network reachability:

Thick clone copies data by attaching the source and destination volumes to the ICM host over NVMe/TCP (handled by the bundled discovery-client). The ICM host must therefore have a route to every attached cluster's data (NVMe) network; each cluster's nvmeEndpoint addresses both the discovery service (port 8009) and the I/O controllers (port 4420). Management-network connectivity alone is not sufficient. If you add or configure the ICM host's data-network interface after deploying ICM, restart the discovery-client so that it re-establishes its cluster connections.

docker restart discovery-client # then confirm every cluster connects (no "failed with all ... connections" lines): docker logs --since 60s discovery-client | grep -E 'connected successfully|failed with all'

A clone that fails at the detectVolumeAttached stage with no local block device for volume ... means that the volume's block device did not appear on the ICM host within the retry window. Possible causes include the device taking longer than the retry window to attach and an unavailable primary node on the source cluster; on a standalone deploy the most common cause is that the ICM host cannot reach a cluster's NVMe network, or that discovery-client started before the data interface existed.

Clone a snapshot into a new volume on a destination cluster:

icmcli thick-clone volume \ --src-cluster-id=<source-cluster-id> \ --src-proj-name=<source-project> \ --src-snap-id=<source-snapshot-id> \ --dst-cluster-id=<destination-cluster-id> \ --dst-name=<new-volume-name>

Clone a snapshot into a new snapshot (add --description):

icmcli thick-clone snapshot \ --src-cluster-id=<source-cluster-id> \ --src-proj-name=<source-project> \ --src-snap-id=<source-snapshot-id> \ --dst-cluster-id=<destination-cluster-id> \ --dst-name=<new-snapshot-name>

Any of --dst-proj-name, --size, --replica-count, --sector-size, --compression, --unencrypted, --dst-qos-policy-name, and --placement-affinity may be set on the destination; unset optional flags inherit from the source snapshot.

Note

Thick clone is project-agnostic. A volume cloned into a project other than ICM's configured project will not appear in icmcli list volumes.

Inspecting the Workflow State

ICM attach and detach operations are called a workflow. To track the state, status, and progress of both running and completed workflows, Lightbits' ICM exposes list and get workflow APIs.

Listing All Workflows

icmcli list workflows

By default the page-size is set to 100, a list workflows command will hence fetch the latest 100 workflows. To fetch a more limited list or a larger number of items in a list (the max is limited to 250), you should add the page-size flag.

icmcli list workflows --page-size=10 icmcli list workflows --page-size=100

Getting a Workflow by ID

icmcli get workflow --id <wid>

Cancelling a Workflow by ID

A running thick-clone workflow can be cancelled by its workflow ID. Cancellation runs the workflow's compensation/cleanup; it applies to thick-clone workflows only.

icmcli cancel workflow --wid <wid>
Note

You can also inspect the full event history of any workflow in the Temporal UI at http://<ICM-Server>:8080.