This is the multi-page printable view of this section. Click here to print.
Managing Storage Backends
- 1: Querying a Storage Backend
- 2: Updating a Storage Backend
- 2.1: Updating the Password of a Storage Backend Using oceanctl
- 2.2: Updating the Login Authentication Mode of a Storage Backend
- 2.3: Updating a Storage Backend
- 3: Deleting a Storage Backend
- 4: Adding a Storage Backend Certificate
- 5: Deleting a Storage Backend Certificate
1 - Querying a Storage Backend
Run the following command to obtain the help information about querying a backend.
oceanctl get backend -hRun the following command to query a single storage backend in the default namespace.
oceanctl get backend <backend-name>Run the following command to query all storage backends in the specified namespace.
oceanctl get backend -n <namespace>Run the following command to format the output. Currently, json, yaml, and wide are supported.
oceanctl get backend <backend-name> -o json
2 - Updating a Storage Backend
- When you use oceanctl to update the storage backend information, only the storage backend password and authentication mode for logging in to the storage backend can be updated.
- If the backend account password is updated on the storage device, the CSI plug-in will retry due to login failures. As a result, the account may be locked. If the account is locked, change the password by referring to An Account Is Locked After the Password Is Updated on the Storage Device .
2.1 - Updating the Password of a Storage Backend Using oceanctl
Obtaining the Help Information About Updating a Backend
Run the following command to obtain the help information about updating a storage backend.
oceanctl update backend -hThe following is an example of the command output.
Update a backend for Ocean Storage in Kubernetes Usage: oceanctl update backend <name> [flags] Examples: # Update backend account information in default(huawei-csi) namespace oceanctl update backend <name> --password # Update backend account information in specified namespace oceanctl update backend <name> -n namespace --password # Update backend account information with ldap authentication mode in default(huawei-csi) namespace oceanctl update backend <name> --password --authenticationMode=ldap # Update backend account information with local authentication mode in default(huawei-csi) namespace oceanctl update backend <name> --password --authenticationMode=local # Update backend account information with ldap authentication mode in specified namespace oceanctl update backend <name> -n namespace --password --authenticationMode=ldap Flags: --authenticationMode string Specify authentication mode -h, --help help for backend -n, --namespace string namespace of resources --password Update account password Global Flags: --log-dir string Specify the directory for printing log files. (default "/var/log/huawei")
Example of Updating the Password of a Backend
Run the following command to update a storage backend. In the command, backend-name indicates the name of the storage backend to be updated.
oceanctl update backend backend-name --passwordEnter the user name and new password as prompted:
Please enter this backend user name:admin Please enter this backend password: backend/backend-name updated
2.2 - Updating the Login Authentication Mode of a Storage Backend
Example of Updating the Backend Login Authentication Type to LDAP
Run the following command to update a storage backend. In the command, backend-name indicates the name of the storage backend to be updated.
oceanctl update backend backend-name --password --authenticationMode=ldapEnter the user name and new password as prompted:
Please enter this backend user name:admin Please enter this backend password: backend/backend-name updated
2.3 - Updating a Storage Backend
- PVC provisioning must be based on a configured storage backend. Therefore, if a PVC has been provisioned on a storage backend, do not change the storage backend.
- The name uniquely identifies a storage backend. The name of a storage backend with a PVC provisioned cannot be changed.
- After a storage backend is modified, the new configuration applies only to volumes to be provisioned.
- Do not perform volume management operations during the modification of a storage backend.
Procedure
- Delete the storage backend to be modified. For details, see Deleting a Storage Backend .
- Create a storage backend with the same name. For details, see Configuring the Storage Backend . The storage backend name cannot be changed.
3 - Deleting a Storage Backend
Do not delete a storage backend when a volume management operation is being performed on it.
Example of Deleting a Backend
Run the following command to obtain information about a storage backend.
oceanctl get backendThe following is an example of the command output.
NAMESPACE NAME PROTOCOL STORAGETYPE SN STATUS ONLINE URL huawei-csi backend-1 roce oceanstor-san xxxxxxxxxxxxxxxxxxxx Bound true https://192.168.129.157:8088 huawei-csi backend-2 roce oceanstor-san xxxxxxxxxxxxxxxxxxxx Bound true https://192.168.129.158:8088Run the following command to delete the specified storage backend.
oceanctl delete backend backend-1Run the following command to check the deletion result.
oceanctl get backend backend-1The following is an example of the command output. If not found is displayed, the deletion is successful.
Error from server (NotFound): backend "backend-1" not found
4 - Adding a Storage Backend Certificate
Prerequisites
A certificate has been created. Take OceanStor Dorado as an example. For details about how to create a certificate, click here .
Example of Creating a Certificate
Prepare a certificate file in advance, for example, cert.crt.
Run the following command to obtain information about a storage backend.
oceanctl get backendThe following is an example of the command output.
NAMESPACE NAME PROTOCOL STORAGETYPE SN STATUS ONLINE URL huawei-csi backend-1 roce oceanstor-san xxxxxxxxxxxxxxxxxxxx Bound true https://192.168.129.157:8088 huawei-csi backend-2 roce oceanstor-san xxxxxxxxxxxxxxxxxxxx Bound true https://192.168.129.158:8088Run the following command to create a certificate for the specified storage backend.
oceanctl create cert cert-1 -b backend-1 -f /path/to/cert.crtCheck the certificate creation result.
oceanctl get cert -b backend-1The following is an example of the command output.
NAMESPACE NAME BOUNDBACKEND huawei-csi cert-1 backend-1
5 - Deleting a Storage Backend Certificate
Procedure
Run the following command to obtain information about a storage backend.
oceanctl get backendThe following is an example of the command output.
NAMESPACE NAME PROTOCOL STORAGETYPE SN STATUS ONLINE URL huawei-csi backend-1 roce oceanstor-san xxxxxxxxxxxxxxxxxxxx Bound true https://192.168.129.157:8088 huawei-csi backend-2 roce oceanstor-san xxxxxxxxxxxxxxxxxxxx Bound true https://192.168.129.158:8088Run the following command to obtain information about the certificate of the specified storage backend.
oceanctl get cert -b backend-1The following is an example of the command output.
NAMESPACE NAME BOUNDBACKEND huawei-csi cert-1 backend-1Run the following command to delete the certificate of the specified storage backend.
oceanctl delete cert -b backend-1Check the deletion result.
oceanctl get cert -b backend-1The following is an example of the command output. If no cert found is displayed, the deletion is successful.
Error from server (NotFound): no cert found on backend backend-1 in huawei-csi namespace