Working With DMS
The DMS solution does not include any Quality of Service (QoS) mechanisms by default. Running DMS - whether as a single instance or across multiple instances - can impact the overall performance of the Lightbits cluster. This potential impact should be carefully evaluated and taken into consideration when deciding to apply the DMS solution.
Logging Into the DMS Service
The following command will connect to the DMS service running on base-url
:
dmscli login --username=admin --password=light --base-url=https://<DMS-Server>:443
The
username
andpassword
must be configured correctly in:/etc/dms/.htpasswd.
These are typically configured at the time of installation.
This will return you a JWT that you can use to access /api/v1/
on DMS service.
The result of this command will sign you into the DMS service and will update the ~/.local/dms/dms-cli.yaml
file with a valid idToken
to be consumed by the DMS API. example file:
base-url: https://<LightbitsServer>:443
auth:
tokenType: Bearer
expiresIn: 2592000
idToken: <your-jwt-token>
Attaching/Detaching Lightbits Clusters
Once the DMS service is running and a DMS client is configured to consume it, you can attach the Lightbits clusters to the DMS service.
The DMS service can manage multiple Lightbits clusters. A cluster attach operation will update the DMS service with a Lightbits cluster's information.
Attaching a Lightbits Cluster
Attaching a Lightbits cluster is a three-step procedure.
Step 1: Retrieve the DMS service credentials.
dmscli get credential -o json
Output Example:
{
"pubKeyId": "dms-4c26b680-7bf8-11ef-98e2-e338f5c94dea",
"pubKey": "<base64 encoded Public Key>"
}
The information in this file will be needed in the next step.
Step 2: Update the credentials on a Lightbits cluster.
To authorize the DMS service to interact with the cluster you want to use, we now want to upload the publicKey/credentials to the Lightbits cluster:
pubKey
and pubKeyId
are taken from Retrieve DMS service credentials response.
- Save the decoded DMS pubKey to a file, and upload them to the Lightbits server:
echo "<base64 encoded Public Key>" | base64 -d > /tmp/pub-key.pem
scp /tmp/pub-key.pem <user>@<LightbitsServer>:/tmp/
rm -rf /tmp/pub-key.pem
- Run the
lbcli create credential
command on the Lightbits server. ThepubKeyId
, specified in the filename from the previous step, will be used here as theid
of the credential. SSH to the Lightbits server that the credentials were uploaded to, and execute the following (note that this requires system-admin privileges):
lbcli create credential --project-name=system --type=rsa256pubkey --id=<pubKeyId> /tmp/pub-key.pem
Once the credentials have been added, the DMS service that generated the credentials is authorized to operate with this Lightbits cluster.
Step 3: Invoke the attach cluster operation.
dmscli attach cluster --api-endpoint=<LightbitsServer>:443
The output for this action will be a workflowId
, describing the attach-cluster workflow state enabling monitoring of the attach operation. The result of this action, on the DMS service side, would be adding a cluster entry to the /etc/dms/clusters.yaml
file.
A cluster entry would only be added on a successful execution of complete workflow.
clusters:
- uuid: 4cb2e0bf-20fa-5720-8cc2-1a11fe3e9850
mgmtEps:
- rack01-server01:443
- rack01-server02:443
- rack01-server03:443
Listing a Lightbits Cluster
Run the following command to list the attached clusters:
dmscli list clusters
Detaching a Lightbits Cluster
Detaching a cluster can be done by specifying its ID.
Run the following command to detach a cluster:
dmscli detach cluster --cluster-id 4cb2e0bf-20fa-5720-8cc2-1a11fe3e9850
Thick-Clone Commands
- Cluster ID can be retrieved by running the
dmsci list clusters
command. - The
size
andreplica-count
variables are optional. If they are not provided, the src snapshot values will be used.
Thick-Clone Volume
Use this to generate a thick-cloned volume in a different project.
This operation will copy all of the data from a snapshot to a newly created volume. src parameters identify the source snapshot to copy from, and dst parameters specify attributes of the new volume. dst name/project/cluster parameters are mandatory to uniquely identify parameters. All other parameters' size/replica-count can either be optionally specified or inherited from the source snapshot.
dmscli thick-clone volume \
--src-cluster-id 6d7f14cf-64ac-4a63-9696-0a88a94b22888 \
--src-proj-name default \
--src-snap-id 6d7f14cf-64ac-4a63-9696-0a88a94b22c3 \
--dst-cluster-id 6d7f14cf-64ac-4a63-9696-0a88a94b22888 \
--dst-proj-name default \
--dst-name volume-001 \
--replica-count 2 \
--size 10gib
Thick-Clone Snapshot
Use this to generate a thick-cloned snapshot in a different project.
This operation will copy all the data from a snapshot to a newly created snapshot. src parameters identify the source snapshot to copy from, and dst parameters specify attributes of the new snapshot. dst name/project/cluster parameters are mandatory to uniquely identify parameters. All other parameters' size/replica-count can either be optionally specified or inherited from the source snapshot.
dmscli thick-clone snapshot \
--src-cluster-id 6d7f14cf-64ac-4a63-9696-0a88a94b22888 \
--src-proj-name default \
--src-snap-id 6d7f14cf-64ac-4a63-9696-0a88a94b22c3 \
--dst-cluster-id 6d7f14cf-64ac-4a63-9696-0a88a94b22888 \
--dst-proj-name default \
--dst-name snap-001 \
--replica-count 2 \
--size 10gib
Inspecting a Workflow State
A DMS operation is called a workflow
. DMS operations can be long-running, so to best track the state, status, and progress of both running and completed workflows, Lightbits' DMS exposes list
and get
workflow APIs.
List All Workflows
dmscli list workflows
By default, the page-size
is set to 100, so a list workflows command will fetch the latest 100 workflows. To fetch a more limited list or a larger number of items in the list (the max is limited to 250), you should add the page-size
flag. To fetch the next items in the list, you should add the next-page
flag.
Get a Workflow By ID
dmscli get workflow --id <wid>
Cancel a Workflow By ID
Some workflows could have an extended execution time. The DMS service provides support for a canceling a specified workflow.
The cancel operation executes compensation (rollback) steps as needed, cleaning up any resource that was created by this operation.
dmscli cancel workflow --wid <wid>