Attaches a new Lightbits storage cluster to the CF system.
Synopsis
cfcli attach cluster [flags]Once the CF service is running and a CF client is configured to work with it, you can attach the Lightbits clusters to the CF service.
The CF service can manage multiple Lightbits clusters. A cluster attach operation will update the CF service with the Lightbits cluster's information.
Attaching a Lightbits cluster is a three-step procedure:
- Retrieve the CF service credentials.
- Update these credentials on the Lightbits cluster.
- Invoke the attach cluster operation on the CF service.
Step 1: Retrieve the CF service credentials.
The information from this step will be needed in the next step. Run the following command on the CF host:
cfcli get credential -o jsonOutput Example:
A file containing the public-key will be generated and stored at: ~_.local_cluster-federation_<pubKeyId>.pem{ "pubKeyId": "cluster-federation-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 CF service to interact with the Lightbits cluster you want to use, you will need to upload the publicKey/credentials to the Lightbits cluster.
Upload the CF-decoded public key to the Lightbits server. Using the pubkey file path from the previous step (~/.local/cluster-federation/<pubKeyId>.pem), upload this file to the Lightbits server:
scp ~_.local_cluster-federation_<pubKeyId>.pem <user>@<LightbitsServer>:_tmp_Run the 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 and execute the following (requires system-admin privileges):
lbcli create credential --project-name=system --type=rsa256pubkey --id=<pubKeyId> _tmp_<pubKeyId>.pemOnce the credentials have been added, the CF service that generated the credentials is authorized to operate with this Lightbits cluster.
Step 3: Invoke the attach cluster operation.
You can attach a Lightbits cluster using any of the Cluster's API endpoints.
It is mandatory to have a healthy connection between the CF host and the specified Lightbits API endpoint. Otherwise the attach operation will fail.
To attach a Lightbits cluster, run the following command on the CF service:
cfcli attach cluster --api-endpoint=<LightbitsServer>:443The 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 CF service side would be adding a cluster entry to the /etc/cf/clusters.yaml file.
Example:
clustersuuid4cb2e0bf-20fa-5720-8cc2-1a11fe3e9850 mgmtEpsrack01-server01:443rack01-server02:443rack01-server03:443| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --help | -h | bool | Help for cluster. | |
| --api-endpoint | bool | API endpoint to connect to in the form of <ip/host>:<port>. |