This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Basic Services

1 - Storage Backend Management

Backend is an abstract concept of Huawei storage resources. Each Huawei storage device can abstract multiple backend resources using features such as tenants, storage pools, and protocols. Each backend exists independently and defines Huawei storage information required for providing persistent volumes for Kubernetes clusters.

This section describes how to use the oceanctl tool to configure and manage storage backends.

Description of the oceanctl Tool

  • You have obtained the oceanctl tool, copied the oceanctl tool to the environment directory, for example, /usr/local/bin, and obtained the execute permission. The oceanctl tool is stored in /bin/oceanctl of the software package.
  • The oceanctl tool depends on kubectl (for the Kubernetes platform) or oc (for the OpenShift platform) commands. Therefore, you need to run the tool on a node where kubectl or oc commands can be executed.
  • By default, the user who runs oceanctl commands must have the read and write permissions on the /var/log directory. If you do not have the permissions on the directory, run the –log-dir=/path/to/custom command to specify a directory on which you have the permissions as the log file directory.
  • huawei-csi is the default namespace used by oceanctl to create a backend.
  • For details about oceanctl commands, see Description of oceanctl Commands .

1.1 - Configuring the Storage Backend

  1. When oceanctl is used to create a storage backend, the entered account and key information is stored in the Secret object. It is recommended that the customer container platform encrypt the Secret object based on the suggestions of the supplier or K8s community. For details about how to encrypt the Secret object in the K8s community, see Encrypting Confidential Data at Rest .
  2. When a backend is created using a .json file, the backend name of an earlier version may contain uppercase letters or underscores (_). In this case, the old name is remapped to a new name. The mapping process automatically occurs and does not affect the original functions. For example, ABC_123 is mapped to abc-123-fd68e. The mapping rules are as follows:
  • Uppercase letters are converted to lowercase letters.
  • An underscore (_) is converted to a hyphen (-).
  • A 5-digit hash code is added to the end.
  1. If a storage backend is connected to a vStore, the vStore name cannot be changed after the storage backend is created.

1.1.1 - Flash Storage (OceanStor Dorado/OceanStor V5/OceanStor V6 and Later)

1.1.1.1 - File System

1.1.1.1.1 - NFS

This section describes how to create a storage backend of the NFS protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-nas.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

vstoreName

vStore name on the storage side. This parameter needs to be specified when the connected backend is OceanStor V5 and resources need to be provisioned under a specified vStore.

No

-

This parameter needs to be specified only when the backend is OceanStor V5 and vStores need to be supported.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If resources need to be provisioned to a specified vStore, set this parameter to the logical management port URL of the specified vStore.
  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

The value is fixed to nfs.

  • Ensure that an NFS client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • If a vStore is used to connect to a backend, portals must be set to the logical port information of the vStore.
  • You can enter a domain name address.
  • IPv6 is supported.
  • Only one port can be configured.

metrovStorePairID

HyperMetro vStore pair ID.

This parameter is mandatory when a PV to be created on the storage side needs to support the NAS HyperMetro feature. In this case, you need to enter the ID of the HyperMetro vStore pair to which the PV to be created belongs.

No

-

You can query the HyperMetro vStore pair ID on DeviceManager.

metroBackend

Backend name of the HyperMetro peer. The value is a character string.

This parameter is mandatory when a PV to be created on the storage side needs to support the NAS HyperMetro feature. In this case, you need to enter the name of the other backend to form a HyperMetro pair with the current backend.

No

-

The names of the two backends in the pair must be entered. After the two backends form a HyperMetro relationship, they cannot form a HyperMetro relationship with other backends.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

When Huawei enterprise storage is OceanStor V5, the ID of the LDAP domain authentication server must be 0.

Creating Storage Backends of the Local Type

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-nas"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "nfs"
      portals:
        - "10.10.30.20"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs         oceanstor-nas    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

Creating Storage Backends of the HyperMetro Type

  • Before configuring NAS HyperMetro, you need to configure the HyperMetro relationship between two storage devices, including the remote device and HyperMetro domain. The HyperMetro domain of the file system can only work in HyperMetro active-active (AA) mode. For details about the configuration operation, see the product documentation of the corresponding storage model.
  • The accounts for connecting to NAS HyperMetro backends must be the administrator accounts of the storage vStores.
  • Except NAS HyperMetro backends, the management URLs of other backends cannot be the URL of a logical management port of a vStore that has established the HyperMetro relationship.
  • When a HyperMetro storage backend is used, do not provision common file systems. Otherwise, services may be interrupted in logical port failover scenarios.
  1. Prepare a storage backend configuration file, for example, backend.yaml.

    storage: "oceanstor-nas"
    name: "backend-active"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.155:8088"
    pools:
      - "StoragePool001"
    metrovStorePairID: "2100xxxxxxxxxx0000000000600000000"
    metroBackend: "backend-standby"
    parameters:
      protocol: "nfs"
      portals:
        - "192.168.129.156"
    maxClientThreads: "30"
    ---
    storage: "oceanstor-nas"
    name: "backend-standby"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    metrovStorePairID: "2100xxxxxxxxxx0000000000600000000"
    metroBackend: "backend-active"
    parameters:
      protocol: "nfs"
      portals:
        - "192.168.129.158"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME              STORAGE              URLS                
    1       false         backend-active    oceanstor-nas        https://192.168.129.155:8088 
    2       false         backend-standby   oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: user1
    Please enter this backend password:
    
    Backend backend-standby is configured
    NUMBER  CONFIGURED    NAME              STORAGE              URLS               
    1       true          backend-active    oceanstor-nas        https://192.168.129.155:8088 
    2       true          backend-standby   oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME              PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-active    nfs         oceanstor-nas    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.155:8088   
    huawei-csi    backend-standby   nfs         oceanstor-nas    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088 
    

1.1.1.1.2 - NFS+

This section describes how to create a storage backend of the NFS+ protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-nas.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If resources need to be provisioned to a specified vStore, set this parameter to the logical management port URL of the specified vStore.
  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to nfs.
  • Ensure that an NFS+ client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • If a vStore is used to connect to a backend, portals must be set to the logical port information of the vStore.
  • You can enter a domain name address.
  • IPv6 is supported.
  • Multiple ports can be configured.

metrovStorePairID

HyperMetro vStore pair ID.

This parameter is mandatory when a PV to be created on the storage side needs to support the NAS HyperMetro feature. In this case, you need to enter the ID of the HyperMetro vStore pair to which the PV to be created belongs.

No

-

You can query the HyperMetro vStore pair ID on DeviceManager.

metroBackend

Backend name of the HyperMetro peer. The value is a character string.

This parameter is mandatory when a PV to be created on the storage side needs to support the NAS HyperMetro feature. In this case, you need to enter the name of the other backend to form a HyperMetro pair with the current backend.

No

-

The names of the two backends in the pair must be entered. After the two backends form a HyperMetro relationship, they cannot form a HyperMetro relationship with other backends.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

-

Creating Storage Backends of the Local Type

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-nas"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "nfs+"
      portals:
        - "10.10.30.20"
        - "10.10.30.30"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL     STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs+         oceanstor-nas    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

Creating Storage Backends of the HyperMetro Type

  • Before configuring NAS HyperMetro, you need to configure the HyperMetro relationship between two storage devices, including the remote device and HyperMetro domain. The HyperMetro domain of the file system can only work in HyperMetro active-active (AA) mode. For details about the configuration operation, see the product documentation of the corresponding storage model.
  • The accounts for connecting to NAS HyperMetro backends must be the administrator accounts of the storage vStores.
  • Except NAS HyperMetro backends, the management URLs of other backends cannot be the URL of a logical management port of a vStore that has established the HyperMetro relationship.
  • When a HyperMetro storage backend is used, do not provision common file systems. Otherwise, services may be interrupted in logical port failover scenarios.

Procedure

  1. Prepare a storage backend configuration file, for example, backend.yaml.

    storage: "oceanstor-nas"
    name: "backend-active"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.155:8088"
    pools:
      - "StoragePool001"
    metrovStorePairID: "2100xxxxxxxxxx0000000000600000000"
    metroBackend: "backend-standby"
    parameters:
      protocol: "nfs+"
      portals:
        - "192.168.129.156"
        - "192.168.129.157"
    maxClientThreads: "30"
    ---
    storage: "oceanstor-nas"
    name: "backend-standby"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.158:8088"
    pools:
      - "StoragePool001"
    metrovStorePairID: "2100xxxxxxxxxx0000000000600000000"
    metroBackend: "backend-active"
    parameters:
      protocol: "nfs+"
      portals:
        - "192.168.129.159"
        - "192.168.129.160"   
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME              STORAGE              URLS                
    1       false         backend-active    oceanstor-nas        https://192.168.129.155:8088 
    2       false         backend-standby   oceanstor-nas        https://192.168.129.158:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: user1
    Please enter this backend password:
    
    Backend backend-standby is configured
    NUMBER  CONFIGURED    NAME              STORAGE              URLS               
    1       true          backend-active    oceanstor-nas        https://192.168.129.155:8088 
    2       true          backend-standby   oceanstor-nas        https://192.168.129.158:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME              PROTOCOL     STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-active    nfs+         oceanstor-nas    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.155:8088   
    huawei-csi    backend-standby   nfs+         oceanstor-nas    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.158:8088 
    

1.1.1.2 - Dtree

1.1.1.2.1 - NFS

This section describes how to create a storage backend of the NFS protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-dtree.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If resources need to be provisioned to a specified vStore, set this parameter to the logical management port URL of the specified vStore.
  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to nfs.
  • Ensure that an NFS client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • If a vStore is used to connect to a backend, portals must be set to the logical port information of the vStore.
  • You can enter a domain name address.
  • IPv6 is supported.
  • Only one port can be configured.

parameters.parentname

Name of a file system on the current storage device. A dtree is created in the file system.

No

-

  • Query the name on the File Systems page of DeviceManager.
  • You can configure the parameter in StorageClass.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

-

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-dtree"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    parameters:
      protocol: "nfs"
      parentname: "parent-filesystem"
      portals:
        - "10.10.30.20"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-dtree      https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-dtree      https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs         oceanstor-dtree  xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.1.2.2 - NFS+

This section describes how to create a storage backend of the NFS+ protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-dtree.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If resources need to be provisioned to a specified vStore, set this parameter to the logical management port URL of the specified vStore.
  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to nfs.
  • Ensure that an NFS+ client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • If a vStore is used to connect to a backend, portals must be set to the logical port information of the vStore.
  • You can enter a domain name address.
  • IPv6 is supported.
  • Multiple ports can be configured.

parameters.parentname

Name of a file system on the current storage device. A dtree is created in the file system.

No

-

  • Query the name on the File Systems page of DeviceManager.
  • You can configure the parameter in StorageClass.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

-

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-dtree"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    parameters:
      protocol: "nfs+"
      parentname: "parent-filesystem"
      portals:
        - "10.10.30.20"
        - "10.10.30.30"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-dtree      https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-dtree      https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL     STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs+         oceanstor-dtree  xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.1.3 - Block Service

1.1.1.3.1 - iSCSI

This section describes how to create a storage backend of the iSCSI protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to iscsi.
  • Ensure that an iSCSI client has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • IPv6 is supported.
  • Multiple ports can be configured.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

When Huawei enterprise storage is OceanStor V5, the ID of the LDAP domain authentication server must be 0.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "iscsi"
      portals:
        - "10.10.30.20"
        - "10.10.30.21"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    iscsi       oceanstor-san    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.1.3.2 - FC

This section describes how to create a storage backend of the FC protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to fc.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

When Huawei enterprise storage is OceanStor V5, the ID of the LDAP domain authentication server must be 0.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "fc"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    fc          oceanstor-san    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.1.3.3 - NVMe over RoCE

This section describes how to create a storage backend of the NVMe over RoCE protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to roce.
  • Ensure that the nvme-cli tool has been installed on the compute node to be connected. The supported nvme-cli tool version is 1.9 and later.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • IPv6 is supported.
  • Multiple ports can be configured.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

When Huawei enterprise storage is OceanStor V5, the ID of the LDAP domain authentication server must be 0.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "roce"
      portals:
        - "10.10.30.20"
        - "10.10.30.21"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    roce        oceanstor-san    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.1.3.4 - FC-NVMe

This section describes how to create a storage backend of the FC-NVMe protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

  • If the management URL is of the IPv6 type, the URL format is https://[IPv6 address]:Port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to fc-nvme.
  • Ensure that the nvme-cli tool has been installed on the compute node to be connected. The supported nvme-cli tool version is 1.9 and later.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

When Huawei enterprise storage is OceanStor V5, the ID of the LDAP domain authentication server must be 0.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "fc-nvme"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    fc-nvme     oceanstor-san    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.2 - Flash Storage (OceanStor A600/A800)

1.1.2.1 - Local File System

1.1.2.1.1 - NFS

This section describes how to create a storage backend of the NFS protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-a-series-nas.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to nfs.
  • Ensure that an NFS client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

Only one port can be configured.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

-

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-a-series-nas"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "nfs"
      portals:
        - "10.10.30.20"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE                   URLS                
    1       false         backend-demo   oceanstor-a-series-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE                   URLS               
    1       true          backend-demo    oceanstor-a-series-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE             SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs         oceanstor-a-series-nas  xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.2.1.2 - DataTurbo

This section describes how to create a storage backend of the DataTurbo protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-a-series-nas.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to dtfs.
  • Ensure that a DataTurbo client has been installed on the connected compute node and the connectivity of the storage logical port has been configured.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

authenticationMode

Authentication mode for logging in to a storage backend.

The following modes are supported:

  • local: local authentication
  • ldap: LDAP authentication

No

local

-

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-a-series-nas"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "dtfs"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-a-series-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-a-series-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL   STORAGETYPE             SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    dtfs       oceanstor-a-series-nas  xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.3 - Mass Storage (OceanStor Pacific Series)

1.1.3.1 - Namespace

1.1.3.1.1 - NFS

This section describes how to create a storage backend of the NFS protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to fusionstorage-nas.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

accountName

Account name on the storage side.

No

-

This parameter is mandatory when NAS resources need to be provisioned under a specified account.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to nfs.
  • Ensure that an NFS client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • If an account is used to connect to a backend, portals must be set to the logical port information of the account.
  • You can enter a domain name address.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "fusionstorage-nas"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "nfs"
      portals:
        - "10.10.30.20"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   fusionstorage-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    fusionstorage-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE        SN             STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs         fusionstorage-nas                 Bound   true    https://192.168.129.157:8088   
    

1.1.3.1.2 - DPC

This section describes how to create a storage backend of the DPC protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to fusionstorage-nas.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

accountName

Account name on the storage side.

No

-

This parameter is mandatory when NAS resources need to be provisioned under a specified account.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to dpc.
  • Ensure that DPC has been installed on the connected compute node and the node has been added as a DPC compute node on the storage device to be connected.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "fusionstorage-nas"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "dpc"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   fusionstorage-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    fusionstorage-nas    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE        SN               STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    dpc         fusionstorage-nas                   Bound   true    https://192.168.129.157:8088   
    

1.1.3.2 - Dtree

1.1.3.2.1 - NFS

This section describes how to create a storage backend of the NFS protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to fusionstorage-dtree.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

accountName

Account name on the storage side.

No

-

This parameter is mandatory when NAS resources need to be provisioned under a specified account.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to nfs.
  • Ensure that an NFS client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • If an account is used to connect to a backend, portals must be set to the logical port information of the account.
  • You can enter a domain name address.

parameters.parentname

Name of a file system on the current storage device. A dtree is created in the file system.

No

-

  • Query the name on the File Systems page of DeviceManager.
  • You can configure the parameter in StorageClass.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "fusionstorage-dtree"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    parameters:
      protocol: "nfs"
      parentname: "parent-filesystem"
      portals:
        - "10.10.30.20"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   fusionstorage-dtree  https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    fusionstorage-dtree  https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE           SN            STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs         fusionstorage-dtree                 Bound   true    https://192.168.129.157:8088   
    

1.1.3.2.2 - DPC

This section describes how to create a storage backend of the DPC protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to fusionstorage-dtree.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

accountName

Account name on the storage side.

No

-

This parameter is mandatory when NAS resources need to be provisioned under a specified account.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

parameters.protocol

Storage protocol. The value is a character string.

  • dpc

Yes

-

  • The value is fixed to dpc.
  • Ensure that DPC has been installed on the connected compute node and the node has been added as a DPC compute node on the storage device to be connected.

parameters.parentname

Name of a file system on the current storage device. A dtree is created in the file system.

No

-

  • Query the name on the File Systems page of DeviceManager.
  • You can configure the parameter in StorageClass.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "fusionstorage-dtree"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    parameters:
      protocol: "dpc"
      parentname: "parent-filesystem"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE                URLS                
    1       false         backend-demo   fusionstorage-dtree    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE                URLS               
    1       true          backend-demo    fusionstorage-dtree    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE          SN          STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    dpc         fusionstorage-dtree              Bound   true    https://192.168.129.157:8088   
    

1.1.3.3 - Block Service

1.1.3.3.1 - iSCSI

This section describes how to create a storage backend of the iSCSI protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to fusionstorage-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to iscsi.
  • Ensure that an iSCSI client has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Conditionally mandatory

-

  • Multiple ports can be configured.
  • Either iscsiLinks or portals must be set.

parameters.iscsiLinks

Number of dynamic access links. This parameter is supported only in OceanStor Pacific 8.1.5 and later versions.

Conditionally mandatory

  

Either iscsiLinks or portals must be set.

NOTE:
  1. The iscsiLinks parameter takes effect only when the portals parameter is left empty.
  2. The number of valid links is the maximum value among the following three values:
    • Value of iscsiLinks
    • Minimum number of links dynamically allocated by the storage
    • Number of established links on the host

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "fusionstorage-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "iscsi"
      portals:
        - "10.10.30.20"
        - "10.10.30.21"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   fusionstorage-san    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    fusionstorage-san    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE        SN       STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    iscsi       fusionstorage-san           Bound   true    https://192.168.129.157:8088   
    

1.1.3.3.2 - SCSI

This section describes how to create a storage backend of the SCSI protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to fusionstorage-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to scsi.
  • Ensure that a distributed storage VBS client has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

If the protocol is scsi, the port is in dictionary format where the key indicates the name of the host where the VBS client is deployed and the value indicates the IP address of the host where the VBS client is deployed.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "fusionstorage-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "scsi"
      portals:
        - {"hostname01": "192.168.125.21","hostname02": "192.168.125.22"}
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   fusionstorage-san    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    fusionstorage-san    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE        SN      STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    scsi        fusionstorage-san          Bound   true    https://192.168.129.157:8088   
    

1.1.4 - Mass Storage (OceanDisk Series)

1.1.4.1 - File System

1.1.4.1.1 - NFS

This section describes how to create a storage backend of the NFS protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceanstor-nas.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list. The value can be a domain name or an IP address + port number.

Yes

-

If resources need to be provisioned to a specified vStore, set this parameter to the logical management port URL of the specified vStore.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

The value is fixed to nfs. Ensure that an NFS client tool has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

  • If a vStore is used to connect to a backend, portals must be set to the logical port information of the vStore.
  • You can enter a domain name address.
  • Only one port can be configured.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating Storage Backends of the Local Type

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceanstor-nas"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "nfs"
      portals:
        - "10.10.30.20"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceanstor-nas        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE      SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    nfs         oceanstor-nas    xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.4.2 - Block Service

1.1.4.2.1 - iSCSI

This section describes how to create a storage backend of the iSCSI protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceandisk-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to iscsi.
  • Ensure that an iSCSI client has been installed on the connected compute node.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

Multiple ports can be configured.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceandisk-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "iscsi"
      portals:
        - "10.10.30.20"
        - "10.10.30.21"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE          URLS                
    1       false         backend-demo   oceandisk-san    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE          URLS               
    1       true          backend-demo    oceandisk-san    https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE     SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    iscsi       oceandisk-san   xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.4.2.2 - FC

This section describes how to create a storage backend of the FC protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceandisk-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to fc.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceandisk-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "fc"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceandisk-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceandisk-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE        SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    fc          oceandisk-san      xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.1.4.2.3 - NVMe over RoCE

This section describes how to create a storage backend of the NVMe over RoCE protocol type.

Configuration Item Description

Table 1 backend parameters

Parameter

Description

Mandatory

Default Value

Remarks

storage

Storage service type.

Yes

-

The value is fixed to oceandisk-san.

name

Storage backend name. The value can contain a maximum of 63 characters, including lowercase letters, digits, and hyphens (-). It must start with a letter or digit.

Yes

-

Ensure that the storage backend name is unique.

namespace

Namespace.

No

huawei-csi

The storage backend must be in the same namespace as Huawei CSI.

urls

Management URLs of storage device. The value format is a list.

Yes

-

The value can be a domain name or an IP address + port number.

pools

Storage pools of storage devices. The value format is a list.

Yes

-

Enter the storage pool names.

parameters.protocol

Storage protocol. The value is a character string.

Yes

-

  • The value is fixed to roce.
  • Ensure that the nvme-cli tool has been installed on the compute node to be connected. The supported nvme-cli tool version is 1.9 and later.

parameters.portals

Service access port. Nodes will use this port to read and write storage resources. The value format is a list.

Yes

-

Multiple ports can be configured.

supportedTopologies

Storage topology awareness configuration. The parameter format is JSON of the list type.

No

-

This parameter is mandatory if storage topology awareness is enabled. For details, see Configuring Storage Topology Awareness.

maxClientThreads

Maximum number of concurrent connections to a storage backend.

No

30

The value ranges from 1 to 30. If this parameter is not set or the value is not in the specified range, the default value 30 is used.

Creating a Storage Backend

  1. Prepare a backend configuration file, for example, backend.yaml.

    storage: "oceandisk-san"
    name: "backend-demo"
    namespace: "huawei-csi"
    urls:
      - "https://192.168.129.157:8088"
    pools:
      - "StoragePool001"
    parameters:
      protocol: "roce"
      portals:
        - "10.10.30.20"
        - "10.10.30.21"
    maxClientThreads: "30"
    
  2. Run the following command to create a storage backend.

    oceanctl create backend -f /path/to/backend.yaml -i yaml
    

    The following is an example of the command output.

    NUMBER  CONFIGURED    NAME           STORAGE              URLS                
    1       false         backend-demo   oceandisk-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  3. Enter the serial number of the backend to be created and enter the account and password.

    Please enter the backend number to configure (Enter 'exit' to exit):1
    Please enter this backend user name: admin
    Please enter this backend password:
    
    Backend backend-demo is configured
    NUMBER  CONFIGURED    NAME            STORAGE              URLS               
    1       true          backend-demo    oceandisk-san        https://192.168.129.157:8088 
    Please enter the backend number to configure (Enter 'exit' to exit):
    
  4. Check the storage backend creation result.

    oceanctl get backend
    

    The following is an example of the command output. If the backend status is Bound, the creation is successful.

    NAMESPACE     NAME            PROTOCOL    STORAGETYPE        SN                    STATUS  ONLINE  URL                 
    huawei-csi    backend-demo    roce        oceandisk-san      xxxxxxxxxxxxxxxxxxxx  Bound   true    https://192.168.129.157:8088   
    

1.2 - Managing Storage Backends

1.2.1 - Querying a Storage Backend

  • Run the following command to obtain the help information about querying a backend.

    oceanctl get backend -h
    
  • Run 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
    

1.2.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 .

1.2.2.1 - Updating the Password of a Storage Backend Using oceanctl

Obtaining the Help Information About Updating a Backend

  1. Run the following command to obtain the help information about updating a storage backend.

    oceanctl update backend -h
    

    The 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

  1. 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
    

    Enter the user name and new password as prompted:

    Please enter this backend user name:admin
    Please enter this backend password:
    
    backend/backend-name updated
    

1.2.2.2 - Updating the Login Authentication Mode of a Storage Backend

Example of Updating the Backend Login Authentication Type to LDAP

  1. 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=ldap
    

    Enter the user name and new password as prompted:

    Please enter this backend user name:admin
    Please enter this backend password:
    
    backend/backend-name updated
    

1.2.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

  1. Delete the storage backend to be modified. For details, see Deleting a Storage Backend .
  2. Create a storage backend with the same name. For details, see Configuring the Storage Backend . The storage backend name cannot be changed.

1.2.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

  1. Run the following command to obtain information about a storage backend.

    oceanctl get backend 
    

    The 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:8088  
    
  2. Run the following command to delete the specified storage backend.

    oceanctl delete backend backend-1
    
  3. Run the following command to check the deletion result.

    oceanctl get backend backend-1
    

    The 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
    

1.2.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

  1. Prepare a certificate file in advance, for example, cert.crt.

  2. Run the following command to obtain information about a storage backend.

    oceanctl get backend  
    

    The 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:8088  
    
  3. Run the following command to create a certificate for the specified storage backend.

    oceanctl create cert cert-1 -b backend-1 -f /path/to/cert.crt
    
  4. Check the certificate creation result.

    oceanctl get cert -b backend-1
    

    The following is an example of the command output.

    NAMESPACE    NAME    BOUNDBACKEND   
    huawei-csi   cert-1  backend-1 
    

1.2.5 - Deleting a Storage Backend Certificate

Procedure

  1. Run the following command to obtain information about a storage backend.

    oceanctl get backend  
    

    The 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:8088  
    
  2. Run the following command to obtain information about the certificate of the specified storage backend.

    oceanctl get cert -b backend-1
    

    The following is an example of the command output.

    NAMESPACE   NAME    BOUNDBACKEND    
    huawei-csi  cert-1  backend-1  
    
  3. Run the following command to delete the certificate of the specified storage backend.

    oceanctl delete cert -b backend-1
    
  4. Check the deletion result.

    oceanctl get cert -b backend-1
    

    The 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
    

2 - StorageClass Management

A StorageClass provides administrators with methods to describe a storage “class”. Different types may map to a different group of capability definitions. Kubernetes cluster users can dynamically provision volumes based on a StorageClass.

2.1 - Configuring a StorageClass

Cluster administrators can define multiple StorageClass objects as required. When configuring a PV, the cluster administrators need to specify a StorageClass that meets service requirements. When applying for resources from Huawei storage devices, Huawei CSI creates storage resources that meet service requirements based on the preset StorageClass.

2.1.1 - Flash Storage (OceanStor Dorado/OceanStor V5/OceanStor V6 and Later)

2.1.1.1 - File System

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

NFS Protocol Configuration Example

When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-nas-181
  pool: StoragePool001
  volumeType: fs
  allocType: thin
  authClient: "*"
mountOptions:
  - nfsvers=4.1 # Specify the version 4.1 for NFS mounting.

NFS+ Protocol Configuration Example

When a container uses the NFS+ protocol to connect to file system resources, refer to the following StorageClass configuration example.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-nas-181
  pool: StoragePool001
  volumeType: fs
  allocType: thin
  authClient: "*"

HyperMetro File System Configuration Example

When a container uses an NFS HyperMetro file system as a storage resource, refer to the following configuration example. In this example, the used backend supports HyperMetro, and hyperMetro is set to true.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-hypermetro-dorado-181
  pool: pool001
  volumeType: fs
  hyperMetro: "true" # Provision HyperMetro volumes.
  allocType: thin
  authClient: "*"

  • Before provisioning a NAS HyperMetro volume, you need to configure the HyperMetro relationship between two storage devices, including the remote device and HyperMetro domain. The HyperMetro domain of the file system can only work in HyperMetro AA mode. For details about the configuration operation, see the product documentation of the corresponding storage model.
  • If a storage device is faulty, the logical management port may fail over. In this case, you need to manually clear the corresponding storage resources after deleting the NAS HyperMetro volume.

StorageClass Parameters Supported by File Systems

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Whether the Volume Management Takes Effect

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Yes

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Yes

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

Yes

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

Yes

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

Yes

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set.

Conditionally mandatory

-

No

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

parameters.pool

Name of the storage resource pool where the resource to be created is located.

No

-

No

If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool.

parameters.volumeName

Name of the storage resource created by dynamic volume provisioning.

You can configure a placeholder to customize the storage resource name. The following placeholders are supported:

  • PVC namespace: {{ .PVCNamespace }}
  • PVC name: {{ .PVCName }}

No

-

No

  • The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). It cannot be left empty. The length of the expanded placeholder ranges from 1 to 255 characters.
  • Both the PVC namespace and PVC name must be configured.
  • To avoid duplicate resource names, the PVC UID is added to the end of the name as a unique identifier by default.

Configuration example:

PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434.

volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}.

The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the Dtree type is provisioned on the storage side.

Yes

-

Yes

The value is fixed to fs.

parameters.allocType

Allocation type of the volume to be created. The following types are supported:

  • thin: Not all required space is allocated during creation. Instead, the space is dynamically allocated based on the usage.
  • thick: All required space is allocated during creation.

No

thin

No

If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage.

OceanStor Dorado does not support thick.

parameters.authClient

IP address of the NFS client that can access the volume.

You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment.

Yes

-

No

The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system.

If the client host name is used, you are advised to use the full domain name.

The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses.

You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test

parameters.cloneSpeed

Cloning speed. The value ranges from 1 to 4.

No

3

No

4 indicates the highest speed. This parameter takes effect when a persistent volume is cloned or a persistent volume is created from a snapshot.

parameters.applicationType

Application type name when a file system is created.

No

-

Yes

Log in to DeviceManager and choose Services > File Service > File Systems > Create to obtain the application type name.

parameters.qos

QoS settings of the file system on the storage side for the PV.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}'

No

-

No

For details about the supported QoS configurations, see Table 3.

parameters.hyperMetro

Whether a HyperMetro volume is to be created. This parameter needs to be configured when the backend is of the HyperMetro type.

  • "true": The created volume is a HyperMetro volume. If the storage backend is a HyperMetro backend, the value must be true.
  • "false": The created volume is a common volume.

Conditionally mandatory

false

No

When the used backend is a HyperMetro backend and a HyperMetro volume needs to be provisioned, set this parameter to true. If this parameter is set to false, services may be interrupted if the logical management port connected to the backend fails over.

parameters.metroPairSyncSpeed

Data synchronization speed of a HyperMetro pair. The value ranges from 1 to 4.

The value can be:

  • 1: low
  • 2: medium
  • 3: high
  • 4: highest

No

-

No

The configuration takes effect when a HyperMetro volume is created.

Note:

  • If this parameter is not configured, the storage speed of the HyperMetro pair is determined by the storage device.
  • The highest synchronization speed may increase the host latency.

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

No

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.rootSquash

Controls the root permission of the client.

The value can be:

  • root_squash: The client cannot access the storage system as user root. If a client accesses the storage system as user root, the client will be mapped as an anonymous user.
  • no_root_squash: A client can access the storage system as user root and has the permission of user root.

No

-

No

  

parameters.allSquash

Whether to retain the user ID (UID) and group ID (GID) of a shared directory.

The value can be:

  • all_squash: The UID and GID of the shared directory are mapped to anonymous users.
  • no_all_squash: The UID and GID of the shared directory are retained.

No

-

No

  

parameters.accesskrb5

Configures the krb5 security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

No

During mounting, you can specify the sec parameter in mountOptions.

parameters.accesskrb5i

Configures the krb5i security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

No

During mounting, you can specify the sec parameter in mountOptions.

parameters.accesskrb5p

Configures the krb5p security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

No

During mounting, you can specify the sec parameter in mountOptions.

parameters.snapshotDirectoryVisibility

Whether the snapshot directory is visible.

The value can be:

  • visible: The snapshot directory is visible.
  • invisible: The snapshot directory is invisible.

No

-

No

Only NAS storage is supported.

parameters.reservedSnapshotSpaceRatio

Configures reserved snapshot space.

Value type: character string

Value range: 0 to 50

No

-

No

OceanStor Dorado 6.1.5+ and OceanStor 6.1.5+ NAS storage devices are supported.

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

Yes

For OceanStor Dorado and OceanStor storage, the sector size is 512 bytes.

parameters.description

Description of the file system to be created.

Value type: character string

The value contains 0 to 255 characters.

No

-

No

  

parameters.advancedOptions

Advanced volume creation parameters.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"CAPACITYTHRESHOLD": 90}'

No

-

No

For details about the supported advanced parameters, see Table 4.

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.nfsvers

NFS mount option on the host. The following mount option is supported:

nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2.

No

-

This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format.

If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0.

mountOptions.sec

Kerberos 5 protocol for mounting NFS file systems.

No

-

  • If Kerberos 5 is used, set this parameter to krb5.
  • If Kerberos 5i is used, set this parameter to krb5i.
  • If Kerberos 5p is used, set this parameter to krb5p.
  • Kerberos supports only NFSv4.0 and later versions.
  • OceanStor Dorado and OceanStor 6.1.3 and later versions support Kerberos.

mountOptions.proto

Transmission protocol used for NFS mounting.

The value can be rdma.

No

-

  • The parameter is supported for NAS storage of OceanStor Dorado and OceanStor 6.1.7 and later.

mountOptions.port

Protocol port used for NFS mounting.

Conditionally mandatory

-

If the transmission protocol is rdma, set this parameter to 20049.

Table 3 Supported QoS configurations

Storage Type

Parameter

Description

Remarks

OceanStor V5

IOTYPE

Read/write type.

This parameter is optional. If it is not specified, the default value of the storage backend is used. For details, see related storage documents.

The value can be:

  • 0: read I/O
  • 1: write I/O
  • 2: read and write I/Os

MAXBANDWIDTH

Maximum bandwidth. This is a restriction policy parameter.

The value is an integer greater than 0, expressed in MB/s.

MINBANDWIDTH

Minimum bandwidth. This is a protection policy parameter.

The value is an integer greater than 0, expressed in MB/s.

MAXIOPS

Maximum IOPS. This is a restriction policy parameter.

The value is an integer greater than 0.

MINIOPS

Minimum IOPS. This is a protection policy parameter.

The value is an integer greater than 0.

LATENCY

Maximum latency. This is a protection policy parameter.

The value is an integer greater than 0, expressed in ms.

OceanStor Dorado/OceanStor

IOTYPE

Read/write type.

The value can be:

  • 2: read and write I/Os

MAXBANDWIDTH

Maximum bandwidth. This is a restriction policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MINBANDWIDTH

Minimum bandwidth. This is a protection policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MAXIOPS

Maximum IOPS. This is a restriction policy parameter.

The value is an integer ranging from 100 to 999999999.

MINIOPS

Minimum IOPS. This is a protection policy parameter.

The value is an integer ranging from 100 to 999999999.

LATENCY

Maximum latency. This is a protection policy parameter.

The value can be 0.5 or 1.5, expressed in ms.

Table 4 Supported advanced volume creation parameters

Parameter

Description

Remarks

CAPACITYTHRESHOLD

Total capacity alarm threshold.

Parameter type: uint64.

For details about the default value and value range, see the corresponding storage product manual.

2.1.1.2 - Dtree

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

Example of StorageClass Configuration Supported by the NFS Protocol

When a container uses the NFS protocol to connect to dtree resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-dtree-181
  parentname: parent-filesystem-name
  volumeType: dtree
  allocType: thin
  authClient: "*"
mountOptions:
  - nfsvers=4.1 # Specify the version 4.1 for NFS mounting.

Example of StorageClass Configuration Supported by the NFS+ Protocol

When a container uses the NFS+ protocol to connect to dtree resources, refer to the following StorageClass configuration example.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-dtree-181
  parentname: parent-filesystem-name
  volumeType: dtree
  allocType: thin
  authClient: "*"

Storage Class Parameters Supported by Dtrees

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located.

Conditionally mandatory

-

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

This parameter is mandatory if parameters.parentname is configured.

parameters.parentname

Name of a file system on the current storage device. Dtree is created in the file system.

Conditionally mandatory

-

This parameter is mandatory when parentname is not configured for the backend.

If parentname is configured only in the StorageClass but not configured in the storage backend, set CSIDriverObject.attachRequired to true during CSI installation.

parameters.volumeName

Name of the storage resource created by dynamic volume provisioning.

You can configure a placeholder to customize the storage resource name. The following placeholders are supported:

  • PVC namespace: {{ .PVCNamespace }}
  • PVC name: {{ .PVCName }}

No

-

  • The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). It cannot be left empty. The length of the expanded placeholder ranges from 1 to 255 characters.
  • Both the PVC namespace and PVC name must be configured.
  • To avoid duplicate resource names, the PVC UID is added to the end of the name as a unique identifier by default.

Configuration example:

PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434.

volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}.

The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the Dtree type is provisioned on the storage side.

Yes

-

When dtree is used, the value must be dtree.

parameters.authClient

IP address of the NFS client that can access the volume.

You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment.

Yes

-

The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system.

If the client host name is used, you are advised to use the full domain name.

The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses.

You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.rootSquash

Controls the root permission of the client.

The value can be:

  • root_squash: The client cannot access the storage system as user root. If a client accesses the storage system as user root, the client will be mapped as an anonymous user.
  • no_root_squash: A client can access the storage system as user root and has the permission of user root.

No

-

  

parameters.allSquash

Whether to retain the user ID (UID) and group ID (GID) of a shared directory.

The value can be:

  • all_squash: The UID and GID of the shared directory are mapped to anonymous users.
  • no_all_squash: The UID and GID of the shared directory are retained.

No

-

  

parameters.accesskrb5

Configures the krb5 security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

During mounting, you can specify the sec parameter in mountOptions.

parameters.accesskrb5i

Configures the krb5i security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

During mounting, you can specify the sec parameter in mountOptions.

parameters.accesskrb5p

Configures the krb5p security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

During mounting, you can specify the sec parameter in mountOptions.

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

For OceanStor Dorado and OceanStor storage, the sector size is 512 bytes.

parameters.description

Description of the dtree share to be created.

Value type: character string

The value contains 0 to 255 characters.

No

-

  

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.nfsvers

NFS mount option on the host. The following mount option is supported:

nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2.

No

-

This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format.

If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0.

mountOptions.sec

Kerberos 5 protocol for mounting NFS file systems.

No

-

  • If Kerberos 5 is used, set this parameter to krb5.
  • If Kerberos 5i is used, set this parameter to krb5i.
  • If Kerberos 5p is used, set this parameter to krb5p.
  • Kerberos supports only NFSv4.0 and later versions.
  • OceanStor Dorado and OceanStor 6.1.3 and later versions support Kerberos.

mountOptions.proto

Transmission protocol used for NFS mounting.

The value can be rdma.

No

-

  • The parameter is supported for NAS storage of OceanStor Dorado and OceanStor 6.1.7 and later.

mountOptions.port

Protocol port used for NFS mounting.

Conditionally mandatory

-

If the transmission protocol is rdma, set this parameter to 20049.

2.1.1.3 - Block Service

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

Block Storage Class Configuration Example

If LUNs are used as storage resources and the file system needs to be formatted to a local file system, refer to the following example.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: lun-181
  pool: StoragePool001
  volumeType: lun
  allocType: thin
  fsType: ext4

StorageClass Parameters Supported by Block Services

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Whether the Volume Management Takes Effect

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Yes

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Yes

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

Yes

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

Yes

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

Yes

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set.

Conditionally mandatory

-

No

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

parameters.pool

Name of the storage resource pool where the resource to be created is located.

No

-

No

If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool.

parameters.volumeName

Name of the storage resource created by dynamic volume provisioning.

You can configure a placeholder to customize the storage resource name. The following placeholders are supported:

  • PVC namespace: {{ .PVCNamespace }}
  • PVC name: {{ .PVCName }}

No

-

No

  • The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). It cannot be left empty. The length of the expanded placeholder ranges from 1 to 255 characters.
  • Both the PVC namespace and PVC name must be configured.
  • To avoid duplicate resource names, the PVC UID is added to the end of the name as a unique identifier by default.

Configuration example:

PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434.

volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}.

The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the dtree type is provisioned on the storage side.

Yes

-

Yes

The value is fixed to lun.

parameters.allocType

Allocation type of the volume to be created. The following types are supported:

  • thin: Not all required space is allocated during creation. Instead, the space is dynamically allocated based on the usage.
  • thick: All required space is allocated during creation.

No

thin

No

If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage.

OceanStor Dorado does not support thick.

parameters.fsType

Type of a host file system. The supported types are:

  • ext2
  • ext3
  • ext4
  • xfs

No

ext4

Yes

This parameter is available only when volumeMode of the PVC is set to Filesystem.

parameters.cloneSpeed

Cloning speed. The value ranges from 1 to 4.

No

3

No

4 indicates the highest speed. This parameter takes effect when a PVC is cloned or a PVC is created from a snapshot.

parameters.applicationType

Application type name of the LUN to be created.

No

-

Yes

Log in to DeviceManager and choose Services > Block Service > LUN Groups (or Namespace Groups) > LUNs (or Namespaces) > Create to obtain the application type name.

parameters.qos

LUN/NAS QoS settings of the PV on the storage side.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}'

No

-

No

For details about the supported QoS configurations, see Table 3.

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

No

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

Yes

For OceanStor Dorado and OceanStor storage, the sector size is 512 bytes.

parameters.description

Description of the LUN to be created.

Value type: character string

The value contains 0 to 255 characters.

No

-

No

  

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.discard

Automatically triggers the Trim or Discard operation when a file system is mounted. This operation instructs a block device to release unused blocks.

No

-

The xfs and ext4 file systems are supported.

Table 3 Supported QoS configurations

Parameter

Description

Remarks

IOTYPE

Read/write type.

The value can be:

  • 2: read and write I/Os

MAXBANDWIDTH

Maximum bandwidth. This is a restriction policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MINBANDWIDTH

Minimum bandwidth. This is a protection policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MAXIOPS

Maximum IOPS. This is a restriction policy parameter.

The value is an integer ranging from 100 to 999999999.

MINIOPS

Minimum IOPS. This is a protection policy parameter.

The value is an integer ranging from 100 to 999999999.

LATENCY

Maximum latency. This is a protection policy parameter.

The value can be 0.5 or 1.5, expressed in ms.

2.1.2 - Flash Storage (OceanStor A600/A800)

2.1.2.1 - File System

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

NFS Protocol Configuration Example

When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-nas-181
  pool: StoragePool001
  volumeType: fs
  allocType: thin
  authClient: "*"
mountOptions:
  - nfsvers=4.1 # Specify the version 4.1 for NFS mounting.

DataTurbo Protocol Configuration Example

If a container uses OceanStor A series storage and the storage supports DataTurbo-based access, you can refer to the following configuration example. In this example, the DataTurbo share user name is user01.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: dtfs-nas-181
  pool: pool001
  volumeType: fs
  allocType: thin
  authUser: user01

StorageClass Parameters Supported by File Services

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Whether the Volume Management Takes Effect

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Yes

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Yes

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

Yes

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

Yes

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

Yes

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set.

Conditionally mandatory

-

No

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

parameters.pool

Name of the storage resource pool where the resource to be created is located.

No

-

No

If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool.

parameters.volumeName

Name of the storage resource created by dynamic volume provisioning.

You can configure a placeholder to customize the storage resource name. The following placeholders are supported:

  • PVC namespace: {{ .PVCNamespace }}
  • PVC name: {{ .PVCName }}

No

-

No

  • The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). It cannot be left empty. The length of the expanded placeholder ranges from 1 to 255 characters.
  • Both the PVC namespace and PVC name must be configured.
  • To avoid duplicate resource names, the PVC UID is added to the end of the name as a unique identifier by default.

Configuration example:

PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434.

volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}.

The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the dtree type is provisioned on the storage side.

Yes

-

Yes

To use the file service, you must set this parameter to fs.

parameters.allocType

Allocation type of the volume to be created. The following types are supported:

  • thin: Not all required space is allocated during creation. Instead, the space is dynamically allocated based on the usage.

No

thin

No

If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage.

parameters.authClient

IP address of the NFS client that can access the volume. This parameter is mandatory when the nfs or nfs+ protocol is used.

You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment.

Conditionally mandatory

-

No

The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system.

If the client host name is used, you are advised to use the full domain name.

The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses.

You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test

parameters.authUser

DataTurbo user who can access the DataTurbo share. This parameter is mandatory when the DataTurbo(dtfs) protocol is used.

Conditionally mandatory

-

No

You can enter multiple DataTurbo users at a time and separate them with semicolons (;). Example: auth_user1;auth_user2;auth_user3

parameters.applicationType

Application type name when a file system is created.

No

-

Yes

Log in to DeviceManager and choose Services > File Service > File Systems > Create to obtain the application type name.

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

No

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.rootSquash

Controls the root permission of the client.

The value can be:

  • root_squash: The client cannot access the storage system as user root. If a client accesses the storage system as user root, the client will be mapped as an anonymous user.
  • no_root_squash: A client can access the storage system as user root and has the permission of user root.

No

-

No

  

parameters.allSquash

Whether to retain the user ID (UID) and group ID (GID) of a shared directory.

The value can be:

  • all_squash: The UID and GID of the shared directory are mapped to anonymous users.
  • no_all_squash: The UID and GID of the shared directory are retained.

No

-

No

  

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

Yes

The sector size of OceanStor A series is 512 bytes.

parameters.description

Description of the file system to be created.

Value type: character string

The value contains 0 to 255 characters.

No

-

No

  

parameters.advancedOptions

Advanced volume creation parameters.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"CAPACITYTHRESHOLD": 90}'

No

-

No

For details about the supported advanced parameters, see Table 3.

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.nfsvers

NFS mount option on the host. The following mount option is supported:

nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2.

No

-

This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format.

If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0.

mountOptions.dn

Domain name of the logical port used for mounting when the DataTurbo(dtfs) protocol is used.

No

WWN of a storage device.

To mount the HyperScale cluster file system, enter the domain name of the HyperScale cluster.

The description of the dn parameter is for reference only. For details about other mounting parameters of the DataTurbo protocol, see OceanStor DataTurbo DTFS User Guide.

Table 3 Supported advanced volume creation parameters

Parameter

Description

Remarks

CAPACITYTHRESHOLD

Total capacity alarm threshold.

Parameter type: uint64.

For details about the default value and value range, see the corresponding storage product manual.

2.1.3 - Mass Storage (FusionStorage Block/OceanStor Pacific Series)

2.1.3.1 - File System

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

NFS Protocol Configuration Example

When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-nas-181
  pool: pool001
  volumeType: fs
  allocType: thin
  authClient: "*"
mountOptions:
  - nfsvers=4.1 # Specify the version 4.1 for NFS mounting.

DPC Protocol Configuration Example

When the storage supports access using the DPC protocol, you can configure the mount parameters for DPC access in the StorageClass. In this example, acl is used as the authentication parameter for mounting, and cnflush is used to set the asynchronous disk flushing mode.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-dpc-101
  pool: pool001
  volumeType: fs
  allocType: thin
mountOptions:
  - acl # Set the authentication parameter.
  - cnflush # Set the asynchronous disk flushing mode.

StorageClass Parameters Supported by File Systems

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Whether the Volume Management Takes Effect

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Yes

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Yes

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

Yes

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

Yes

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

Yes

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set.

Conditionally mandatory

-

No

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

parameters.pool

Name of the storage resource pool where the resource to be created is located.

No

-

No

If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the Dtree type is provisioned on the storage side.

Yes

-

Yes

The value is fixed to fs.

parameters.allocType

Allocation type of the volume to be created. The following types are supported:

  • thin: Not all required space is allocated during creation. Instead, the space is dynamically allocated based on the usage.
  • thick: All required space is allocated during creation.

No

thin

No

If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage.

parameters.authClient

IP address of the NFS client that can access the volume. This parameter is mandatory when the NFS protocol is used.

You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment.

Conditionally mandatory

-

No

The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system.

If the client host name is used, you are advised to use the full domain name.

The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses.

You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test

parameters.storageQuota

File system quota settings.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"spaceQuota": "softQuota", "gracePeriod": 100}'

No

-

No

For details about the supported quota configurations, see Table 4.

parameters.qos

QoS settings of the file system on the storage side of the PV.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}'

No

-

No

For details about the supported QoS configurations, see Table 3.

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

No

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.rootSquash

Controls the root permission of the client.

The value can be:

  • root_squash: The client cannot access the storage system as user root. If a client accesses the storage system as user root, the client will be mapped as an anonymous user.
  • no_root_squash: A client can access the storage system as user root and has the permission of user root.

No

-

No

  

parameters.allSquash

Whether to retain the user ID (UID) and group ID (GID) of a shared directory.

The value can be:

  • all_squash: The UID and GID of the shared directory are mapped to anonymous users.
  • no_all_squash: The UID and GID of the shared directory are retained.

No

-

No

  

parameters.snapshotDirectoryVisibility

Whether the snapshot directory is visible.

The value can be:

  • visible: The snapshot directory is visible.
  • invisible: The snapshot directory is invisible.

No

-

No

  

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

No

For OceanStor Pacific NAS, the sector size is 1 KB.

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.nfsvers

NFS mount option on the host. The following mount option is supported:

nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2.

No

-

This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format.

If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0.

mountOptions.proto

Transmission protocol used for NFS mounting.

The value can be rdma.

No

-

This example applies to 8.2.0 or later.

mountOptions.port

Protocol port used for NFS mounting.

Conditionally mandatory

-

If the transmission protocol is rdma, set this parameter to 20049.

mountOptions.acl

The DPC namespace supports the ACL function. The DPC client supports POSIX ACL, NFSv4 ACL, and NT ACL authentication.

No

-

The descriptions of acl, aclonlyposix, cnflush, and cflush are for reference only. For details about the parameters, see OceanStor Pacific Series Product Documentation and choose Configuration > Basic Service Configuration Guide for File > Configuring Basic Services (DPC Scenario) > Accessing a DPC Share on a Client > Step 2.

mountOptions.aclonlyposix

The DPC namespace supports POSIX ACL, and the DPC client supports POSIX ACL authentication.

The following protocols support POSIX ACL: DPC, NFSv3, and HDFS. If NFSv4 ACL or NT ACL is used, the DPC client cannot identify the ACL of this type. As a result, the ACL of this type does not take effect.

No

-

If aclonlyposix and acl are used together, only acl takes effect. That is, the namespace supports the ACL function.

mountOptions.cnflush

Asynchronous disk flushing mode. That is, data is not flushed to disks immediately when files in the namespace are closed.

No

-

Asynchronous flushing mode: When a file is closed, data in the cache is not flushed to storage media in synchronous mode. Instead, data is written from the cache to the storage media in asynchronous flushing mode. After the write service is complete, data is flushed from the cache to disks periodically based on the flushing period. In a multi-client scenario, if concurrent operations are performed on the same file, the file size update is affected by the disk flushing period. That is, the file size is updated only after the disk flushing is complete. Generally, the update is completed within several seconds. Synchronous I/Os are not affected by the disk flushing period.

mountOptions.cflush

Synchronous disk flushing mode. That is, data is flushed to disks immediately when files in the namespace are closed.

No

-

By default, the synchronous disk flushing mode is used.

Table 3 Supported QoS configurations

Parameter

Description

Remarks

maxMBPS

Maximum bandwidth. This is a restriction policy parameter.

This parameter is mandatory. The value is an integer greater than 0, expressed in MB/s. For details about the maximum value, see the actual limit of the storage device. For example, the maximum value of OceanStor Pacific NAS is 1073741824.

maxIOPS

Maximum IOPS. This is a restriction policy parameter.

This parameter is mandatory. The value is an integer greater than 0. For details about the maximum value, see the actual limit of the storage device. For example, the maximum value of OceanStor Pacific NAS is 1073741824000.

Table 4 Supported quota configurations

Parameter

Description

Remarks

spaceQuota

File quota type.

This parameter is mandatory. Only softQuota or hardQuota can be configured.

gracePeriod

Grace period allowed when the soft quota is configured.

This parameter is conditionally optional only when spaceQuota is set to softQuota.

The value is an integer ranging from 0 to 4294967294.

2.1.3.2 - Dtree

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

Example of StorageClass Configuration Supported by the NFS Protocol

When a container uses the NFS protocol to connect to dtree resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-dtree-181
  parentname: parent-filesystem-name
  volumeType: dtree
  allocType: thin
  authClient: "*"
mountOptions:
  - nfsvers=4.1 # Specify the version 4.1 for NFS mounting.

Example of StorageClass Configuration Supported by the DPC Protocol

When a container uses the DPC protocol to connect to dtree resources, refer to the following StorageClass configuration example. In this example, acl is used as the authentication parameter for mounting, and cnflush is used to set the asynchronous disk flushing mode.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-dtree-181
  parentname: parent-filesystem-name
  volumeType: dtree
  allocType: thin
  authClient: "*"
mountOptions:
  - acl # Set the authentication parameter.
  - cnflush # Set the asynchronous disk flushing mode.

StorageClass Parameters Supported by Dtrees

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located.

Conditionally mandatory

-

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

This parameter is mandatory if parameters.parentname is set.

parameters.parentname

Name of a file system on the current storage device. Dtree is created in the file system.

Conditionally mandatory

-

This parameter is mandatory when parentname is not set for the backend.

If parentname is configured only in the StorageClass but not configured in the storage backend, set CSIDriverObject.attachRequired to true during CSI installation.

parameters.volumeName

Name of the storage resource created by dynamic volume provisioning.

You can configure a placeholder to customize the storage resource name. The following placeholders are supported:

  • PVC namespace: {{ .PVCNamespace }}
  • PVC name: {{ .PVCName }}

No

-

  • The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). It cannot be left empty. The length of the expanded placeholder ranges from 1 to 255 characters.
  • Both the PVC namespace and PVC name must be configured.
  • To avoid duplicate resource names, the PVC UID is added to the end of the name as a unique identifier by default.

Configuration example:

PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434.

volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}.

The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the Dtree type is provisioned on the storage side.

Yes

-

When dtree is used, the value must be dtree.

parameters.authClient

IP address of the NFS client that can access the volume.

You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment.

Yes

-

The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system.

If the client host name is used, you are advised to use the full domain name.

The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses.

You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.rootSquash

Controls the root permission of the client.

The value can be:

  • root_squash: The client cannot access the storage system as user root. If a client accesses the storage system as user root, the client will be mapped as an anonymous user.
  • no_root_squash: A client can access the storage system as user root and has the permission of user root.

No

-

  

parameters.allSquash

Whether to retain the user ID (UID) and group ID (GID) of a shared directory.

The value can be:

  • all_squash: The UID and GID of the shared directory are mapped to anonymous users.
  • no_all_squash: The UID and GID of the shared directory are retained.

No

-

  

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

For OceanStor Pacific dtrees, the sector size is 1 byte.

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.nfsvers

NFS mount option on the host. The following mount option is supported:

nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2.

No

-

This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format.

If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0.

mountOptions.proto

Transmission protocol used for NFS mounting.

The value can be rdma.

No

-

This parameter is supported by 8.2.0 or later.

mountOptions.port

Protocol port used for NFS mounting.

Conditionally mandatory

-

If the transmission protocol is rdma, set this parameter to 20049.

mountOptions.acl

The DPC namespace supports the ACL function. The DPC client supports POSIX ACL, NFSv4 ACL, and NT ACL authentication.

No

-

The descriptions of acl, aclonlyposix, cnflush, and cflush are for reference only. For details about the parameters, see OceanStor Pacific Series Product Documentation and choose Configuration > Basic Service Configuration Guide for File > Configuring Basic Services (DPC Scenario) > Accessing a DPC Share on a Client > Step 2.

mountOptions.aclonlyposix

The DPC namespace supports POSIX ACL, and the DPC client supports POSIX ACL authentication.

The following protocols support POSIX ACL: DPC, NFSv3, and HDFS. If NFSv4 ACL or NT ACL is used, the DPC client cannot identify the ACL of this type. As a result, the ACL of this type does not take effect.

No

-

If aclonlyposix and acl are used together, only acl takes effect. That is, the namespace supports the ACL function.

mountOptions.cnflush

Asynchronous disk flushing mode. That is, data is not flushed to disks immediately when files in the namespace are closed.

No

-

Asynchronous flushing mode: When a file is closed, data in the cache is not flushed to storage media in synchronous mode. Instead, data is written from the cache to the storage media in asynchronous flushing mode. After the write service is complete, data is flushed from the cache to disks periodically based on the flushing period. In a multi-client scenario, if concurrent operations are performed on the same file, the file size update is affected by the disk flushing period. That is, the file size is updated only after the disk flushing is complete. Generally, the update is completed within several seconds. Synchronous I/Os are not affected by the disk flushing period.

mountOptions.cflush

Synchronous disk flushing mode. That is, data is flushed to disks immediately when files in the namespace are closed.

No

-

By default, the synchronous disk flushing mode is used.

2.1.3.3 - Block Services

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

Block StorageClass Configuration Example

If LUNs are used as storage resources and the file system needs to be formatted to a local file system, refer to the following example.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: lun-181
  pool: StoragePool001
  volumeType: lun
  allocType: thin
  fsType: ext4

StorageClass Parameters Supported by Block Services

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Whether the Volume Management Takes Effect

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Yes

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Yes

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

Yes

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

Yes

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

Yes

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set.

Conditionally mandatory

-

No

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

parameters.pool

Name of the storage resource pool where the resource to be created is located.

No

-

No

If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the Dtree type is provisioned on the storage side.

Yes

-

Yes

The value is fixed to lun.

parameters.allocType

Allocation type of the volume to be created. The following types are supported:

  • thin: Not all required space is allocated during creation. Instead, the space is dynamically allocated based on the usage.
  • thick: All required space is allocated during creation.

No

thin

No

If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage.

parameters.fsType

Type of a host file system. The supported types are:

  • ext2
  • ext3
  • ext4
  • xfs

No

ext4

No

This parameter is available only when volumeMode of the PVC is set to Filesystem.

parameters.qos

LUN/NAS QoS settings of the PV on the storage side.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}'

No

-

No

For details about the supported QoS configurations, see Table 3.

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

No

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

Yes

For OceanStor Pacific SAN, the sector size is 1 MiB.

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.discard

Automatically triggers the Trim or Discard operation when a file system is mounted. This operation instructs a block device to release unused blocks.

No

-

The xfs and ext4 file systems are supported.

Table 3 Supported QoS configurations

Parameter

Description

Remarks

maxMBPS

Maximum bandwidth. This is a restriction policy parameter.

This parameter is mandatory. The value is an integer greater than 0, expressed in MB/s. For details about the maximum value, see the actual limit of the storage device. For example, the maximum value of OceanStor Pacific NAS is 1073741824.

maxIOPS

Maximum IOPS. This is a restriction policy parameter.

This parameter is mandatory. The value is an integer greater than 0. For details about the maximum value, see the actual limit of the storage device. For example, the maximum value of OceanStor Pacific NAS is 1073741824000.

2.1.4 - Mass Storage (OceanDisk Series)

2.1.4.1 - File System

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

NFS Protocol Configuration Example

When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.0 is specified for mounting.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: nfs-nas-181
  pool: StoragePool001
  volumeType: fs
  allocType: thin
  authClient: "*"
mountOptions:
  - nfsvers=4.0 # Specify the version 4.0 for NFS mounting.

StorageClass Parameters Supported by File Systems

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Whether the Volume Management Takes Effect

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Yes

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Yes

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

Yes

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

Yes

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

Yes

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set.

Conditionally mandatory

-

No

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

parameters.pool

Name of the storage resource pool where the resource to be created is located.

No

-

No

If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool.

parameters.volumeName

Name of the storage resource created by dynamic volume provisioning.

You can configure a placeholder to customize the storage resource name. The following placeholders are supported:

  • PVC namespace: {{ .PVCNamespace }}
  • PVC name: {{ .PVCName }}

No

-

No

  • The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). It cannot be left empty. The length of the expanded placeholder ranges from 1 to 255 characters.
  • Both the PVC namespace and PVC name must be configured.
  • To avoid duplicate resource names, the PVC UID is added to the end of the name as a unique identifier by default.

Configuration example:

PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434.

volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}.

The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the Dtree type is provisioned on the storage side.

Yes

-

Yes

The value is fixed to fs.

parameters.allocType

Allocation type of the volume to be created. The following types are supported:

  • thin: Not all required space is allocated during creation. Instead, the space is dynamically allocated based on the usage.

No

thin

No

If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage.

parameters.authClient

IP address of the NFS client that can access the volume.

You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment.

Yes

-

No

The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system.

If the client host name is used, you are advised to use the full domain name.

The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses.

You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test

parameters.cloneSpeed

Cloning speed. The value ranges from 1 to 4.

No

3

No

4 indicates the highest speed. This parameter takes effect when a PV is cloned or a PV is created using a snapshot.

parameters.applicationType

Application type name when a file system is created.

No

-

Yes

Log in to DeviceManager and choose Services > File Service > File Systems > Create to obtain the application type name.

parameters.qos

QoS settings of the file system on the storage side of the PV.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}'

No

-

No

For details about the supported QoS configurations, see Table 3.

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

No

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.rootSquash

Controls the root permission of the client.

The value can be:

  • root_squash: The client cannot access the storage system as user root. If a client accesses the storage system as user root, the client will be mapped as an anonymous user.
  • no_root_squash: A client can access the storage system as user root and has the permission of user root.

No

-

No

  

parameters.allSquash

Whether to retain the user ID (UID) and group ID (GID) of a shared directory.

The value can be:

  • all_squash: The UID and GID of the shared directory are mapped to anonymous users.
  • no_all_squash: The UID and GID of the shared directory are retained.

No

-

No

  

parameters.accesskrb5

Configures the krb5 security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

No

During mounting, you can specify the sec parameter in mountOptions.

parameters.accesskrb5i

Configures the krb5i security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

No

During mounting, you can specify the sec parameter in mountOptions.

parameters.accesskrb5p

Configures the krb5p security protocol.

  • read_only: read-only
  • read_write: read and write
  • none: no permission

No

-

No

During mounting, you can specify the sec parameter in mountOptions.

parameters.snapshotDirectoryVisibility

Whether the snapshot directory is visible.

The value can be:

  • visible: The snapshot directory is visible.
  • invisible: The snapshot directory is invisible.

No

-

No

Only NAS storage is supported.

parameters.reservedSnapshotSpaceRatio

Configures reserved snapshot space.

Value type: character string

Value range: 0 to 50

No

-

No

-

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

Yes

For OceanDisk, the sector size is 512 bytes.

parameters.description

Description of the file system to be created.

Value type: character string

The value contains 0 to 255 characters.

No

-

No

  

parameters.advancedOptions

Advanced volume creation parameters.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"CAPACITYTHRESHOLD": 90}'

No

-

No

For details about the supported advanced parameters, see Table 4.

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.nfsvers

NFS mount option on the host. The following mount option is supported:

nfsvers: protocol version for NFS mounting. The value can be 3 or 4.0.

No

-

This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format.

If the NFS version is specified for mounting, NFS 3 and 4.0 protocols are supported (the protocol must be supported and enabled on storage devices).

mountOptions.sec

Kerberos 5 protocol for mounting NFS file systems.

No

-

  • If Kerberos 5 is used, set this parameter to krb5.
  • If Kerberos 5i is used, set this parameter to krb5i.
  • If Kerberos 5p is used, set this parameter to krb5p.
  • Only NFS 4.0 supports Kerberos.

mountOptions.proto

Transmission protocol used for NFS mounting.

The value can be rdma.

No

-

-

mountOptions.port

Protocol port used for NFS mounting.

Conditionally mandatory

-

If the transmission protocol is rdma, set this parameter to 20049.

Table 3 Supported QoS configurations

Storage Type

Parameter

Description

Remarks

OceanStor V5

IOTYPE

Read/write type.

This parameter is optional. If it is not specified, the default value of the storage backend is used. For details, see related storage documents.

The value can be:

  • 0: read I/O
  • 1: write I/O
  • 2: read and write I/Os

MAXBANDWIDTH

Maximum bandwidth. This is a restriction policy parameter.

The value is an integer greater than 0, expressed in MB/s.

MINBANDWIDTH

Minimum bandwidth. This is a protection policy parameter.

The value is an integer greater than 0, expressed in MB/s.

MAXIOPS

Maximum IOPS. This is a restriction policy parameter.

The value is an integer greater than 0.

MINIOPS

Minimum IOPS. This is a protection policy parameter.

The value is an integer greater than 0.

LATENCY

Maximum latency. This is a protection policy parameter.

The value is an integer greater than 0, expressed in ms.

OceanStor Dorado/OceanStor

IOTYPE

Read/write type.

The value can be:

  • 2: read and write I/Os

MAXBANDWIDTH

Maximum bandwidth. This is a restriction policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MINBANDWIDTH

Minimum bandwidth. This is a protection policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MAXIOPS

Maximum IOPS. This is a restriction policy parameter.

The value is an integer ranging from 100 to 999999999.

MINIOPS

Minimum IOPS. This is a protection policy parameter.

The value is an integer ranging from 100 to 999999999.

LATENCY

Maximum latency. This is a protection policy parameter.

The value can be 0.5 or 1.5, expressed in ms.

Table 4 Supported advanced volume creation parameters

Parameter

Description

Remarks

CAPACITYTHRESHOLD

Total capacity alarm threshold.

Parameter type: uint64.

For details about the default value and value range, see the corresponding storage product manual.

2.1.4.2 - Block Services

Creating a StorageClass

  1. Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.

  2. Run the following command to create a StorageClass using the configuration file.

    kubectl apply -f mysc.yaml
    
  3. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

Block StorageClass Configuration Example

If LUNs are used as storage resources and the file system needs to be formatted to a local file system, refer to the following example.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mysc
provisioner: csi.huawei.com
parameters:
  backend: lun-181
  pool: StoragePool001
  volumeType: lun
  allocType: thin
  fsType: ext4

StorageClass Parameters Supported by Block Services

Table 1 StorageClass configuration parameters

Parameter

Description

Mandatory

Default Value

Whether the Volume Management Takes Effect

Remarks

metadata.name

User-defined name of a StorageClass object.

Yes

-

Yes

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

provisioner

Name of the provisioner.

Yes

csi.huawei.com

Yes

Set this parameter to the driver name set during Huawei CSI installation.

The value is the same as that of driverName in the values.yaml file.

reclaimPolicy

Reclamation policy. The following types are supported:

  • Delete: Resources are automatically reclaimed.
  • Retain: Resources are manually reclaimed.

No

Delete

Yes

  • Delete: When a PV/PVC is deleted, resources on the storage device are also deleted.
  • Retain: When a PV/PVC is deleted, resources on the storage device are not deleted.

allowVolumeExpansion

Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded.

No

false

Yes

This function can only be used to expand PV capacity but cannot be used to reduce PV capacity.

mountOptions

List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host.

No

-

Yes

For details about common parameters in mountOptions, see Table 2.

You can also specify other mount parameters.

parameters.backend

Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set.

Conditionally mandatory

-

No

If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources.

You are advised to specify a backend to ensure that the created resource is located on the expected backend.

parameters.pool

Name of the storage resource pool where the resource to be created is located.

No

-

No

If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool.

parameters.volumeType

Type of the volume to be created. The following types are supported:

  • lun: A LUN is provisioned on the storage side.
  • fs: A file system is provisioned on the storage side.
  • dtree: A volume of the Dtree type is provisioned on the storage side.

Yes

-

Yes

The value is fixed to lun.

parameters.allocType

Allocation type of the volume to be created. The following types are supported:

  • thin: Not all required space is allocated during creation. Instead, the space is dynamically allocated based on the usage.
  • thick: All required space is allocated during creation.

No

thin

No

If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage.

OceanStor Dorado does not support thick.

parameters.fsType

Type of a host file system. The supported types are:

  • ext2
  • ext3
  • ext4
  • xfs

No

ext4

No

This parameter is available only when volumeMode of the PVC is set to Filesystem.

parameters.cloneSpeed

Cloning speed. The value ranges from 1 to 4.

No

3

No

4 indicates the highest speed. This parameter takes effect when you clone a PVC or create a PVC from a snapshot.

parameters.applicationType

Application type name of the LUN to be created.

No

-

Yes

Log in to DeviceManager and choose Services > Block Service > LUN Groups (or Namespace Groups) > LUNs (or Namespaces) > Create to obtain the application type name.

parameters.qos

LUN/NAS QoS settings of the PV on the storage side.

The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}'

No

-

No

For details about the supported QoS configurations, see Table 3.

parameters.fsPermission

Permission on the directory mounted to a container.

No

-

No

For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755.

parameters.disableVerifyCapacity

Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.

The value can be:

  • "true": disables volume capacity verification.
  • "false": enables volume capacity verification.
NOTICE:

When Red Hat OpenShift Virtualization is used to connect to CSI, this parameter must be set to true.

No

"true"

Yes

For OceanDisk, the sector size is 512 bytes.

parameters.description

Description of the LUN to be created.

Value type: character string

The value contains 0 to 255 characters.

No

-

No

  

Table 2 Common parameters in mountOptions

Parameter

Description

Mandatory

Default Value

Remarks

mountOptions.discard

Automatically triggers the Trim or Discard operation when a file system is mounted. This operation instructs a block device to release unused blocks.

No

-

The xfs and ext4 file systems are supported.

Table 3 Supported QoS configurations

Parameter

Description

Remarks

IOTYPE

Read/write type.

The value can be:

  • 2: read and write I/Os

MAXBANDWIDTH

Maximum bandwidth. This is a restriction policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MINBANDWIDTH

Minimum bandwidth. This is a protection policy parameter.

The value is an integer ranging from 1 to 999999999, expressed in MB/s.

MAXIOPS

Maximum IOPS. This is a restriction policy parameter.

The value is an integer ranging from 100 to 999999999.

MINIOPS

Minimum IOPS. This is a protection policy parameter.

The value is an integer ranging from 100 to 999999999.

LATENCY

Maximum latency. This is a protection policy parameter.

The value can be 0.5 or 1.5, expressed in ms.

2.2 - Managing a StorageClass

2.2.1 - Querying a StorageClass

  1. Run the following command to view the information about the created StorageClass.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

2.2.2 - Modifying a StorageClass

Kubernetes allows only the allowVolumeExpansion field of a StorageClass to be modified. The modification method is as follows:

  1. Run the following command to check whether the StorageClass can be expanded:

    kubectl get sc mysc
    

    If the command output is displayed as the following example, the StorageClass mysc cannot be expanded:

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           false                  8s
    
  2. Run the following command to enable capacity expansion for the StorageClass:

    kubectl patch sc mysc --patch '{"allowVolumeExpansion":true}'
    
  3. Check the StorageClass again and ensure that the modification is successful.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           true                   8s
    

2.2.3 - Deleting a StorageClass

  1. Run the following command to view the StorageClass:

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME   PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc   csi.huawei.com   Delete          Immediate           false                  8s
    
  2. Run the following command to delete the StorageClass:

    kubectl delete sc mysc
    

    If the following information is displayed, the deletion is successful:

    storageclass.storage.k8s.io "mysc" deleted
    

3 - Persistent Volume Management

Based on service requirements, files in containers need to be persistently stored on disks. When the containers are re-built or re-allocated to new nodes, the persistent data can still be used.

To persistently store data on storage devices, you need to use the PersistentVolume (PV) and PersistentVolumeClaim (PVC) when provisioning containers.

  • PV: a piece of storage in the Kubernetes cluster that has been provisioned by an administrator or dynamically provisioned using a StorageClass .
  • PVC: a request for storage by a user. A PVC consumes PV resources. A PVC can request specific size and access modes. For example, a PV can be mounted in ReadWriteOnce, ReadOnlyMany, or ReadWriteMany mode. For details, see Access Modes .

This section describes how to use Huawei CSI to create, clone, and expand the capacity of a PV and PVC.

3.1 - Configuring PVs

Huawei CSI allows storage resources (LUNs or file systems) to be created on Huawei storage and provided for containers based on user settings. For details about the supported features, see Compatibility and Features of the storage device.

PV configurations can be classified into configuring dynamic PVs or static PVs, and managing PVs.

  • Configuring dynamic PV does not require a PV to be created in advance. Huawei CSI automatically creates resources required by a PV on storage devices based on a StorageClass. In addition, you can create a PV when creating a PVC.
  • Configuring a static PV requires the administrator to create required resources on a storage device in advance and use existing resources by creating a PV. In addition, you can specify the associated PV when creating a PVC.
  • Managing PVs does not require a PV to be created in advance. You can specify the StorageClass and resource information on the storage device in a PVC. Create the PVC and PV at the same time, and manage all existing storage resources in the cluster.

3.1.1 - Configuring Dynamic PVs

Dynamic volume provisioning allows storage volumes to be created on demand. Dynamic volume provisioning depends on the StorageClass objects. The cluster administrator can define multiple StorageClass objects as required and specify a StorageClass that meets service requirements when declaring a PV or PVC. When applying for resources from Huawei storage devices, Huawei CSI creates storage resources that meet service requirements based on the preset StorageClass.

Configuration Description

Perform the following steps to configure and use dynamic PVs:

Preparation

Before configuring dynamic PVs, configure StorageClass by referring to Configuring a StorageClass .

Configuring a PVC

  1. Prepare the PVC configuration file mypv.yaml. The following is an example. For details about other parameters, see Table 1 .

    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: mypvc
    spec:
      accessModes:
        - ReadWriteOnce
      volumeMode: Filesystem
      storageClassName: mysc
      resources:
        requests:
          storage: 100Gi
    
  2. Run the following command to create a PVC using the configuration file.

    kubectl create -f mypvc.yaml
    
  3. After a period of time, run the following command to view the information about the created PVC.

    kubectl get pvc mypvc
    

    The following is an example of the command output. If the PVC status is Bound, the PVC has been created and can be used by a Pod.

    NAME        STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    mypvc       Bound    pvc-840054d3-1d5b-4153-b73f-826f980abf9e   100Gi      RWO            mysc           12s
    

Table 1 PVC parameters for configuring a dynamic PV

Parameter

Description

Mandatory

Default Value

Remarks

metadata.name

User-defined name of a PVC object.

Yes

-

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

spec.volumeMode

Volume mode. This parameter is optional. When LUN volumes are used, the following types are supported:

  • Filesystem: local file system.
  • Block: raw device.

No

Filesystem

This parameter takes effect when a PV is mounted. The default value is Filesystem.

  • Filesystem indicates that a container accesses a PV using a local file system. The local file system type is specified by the fsType field in the specified StorageClass. Storage of the Dtree type also uses this parameter.
  • Block indicates that a PV is accessed in raw volume mode.

spec.storageClassName

Name of the StorageClass object.

Yes

-

Name of the StorageClass object required by services.

spec.resources.requests.storage

Size of the volume to be created. The format is ***Gi and the unit is GiB.

Yes

10Gi

The PVC capacity depends on storage specifications and host specifications. For example, OceanStor Dorado 6.1.2 or OceanStor Pacific series 8.1.0 is connected to CentOS 7. If ext4 file systems are used, see Table 2. If XFS file systems are used, see Table 3. If NFS or raw devices are used, the capacity must meet the specifications of the used Huawei storage device model and version.

If the PVC capacity does not meet the specifications, a PVC or Pod may fail to be created due to the limitations of storage specifications or host file system specifications.

spec.accessModes

Access mode of the volume.

  • RWO (ReadWriteOnce): A volume can be mounted to a node in read/write mode. This mode also allows multiple Pods running on the same node to access the volume.
  • ROX (ReadOnlyMany): A volume can be mounted to multiple nodes in read-only mode.
  • RWX (ReadWriteMany): A volume can be mounted to multiple nodes in read/write mode.
  • RWOP (ReadWriteOncePod): A volume can only be mounted to a single Pod in read/write mode. Kubernetes 1.22 and later versions support this feature.

Yes

ReadWriteOnce

  • RWO/ROX/RWOP: supported by all types of volumes. RWOP is supported only by Kubernetes 1.22 and later versions. For versions earlier than Kubernetes 1.29, you need to enable this feature by following the instructions in Enabling the ReadWriteOncePod Feature Gate.
  • The support for RWX is as follows:
    • NAS storage: supported by all volumes
    • SAN storage: supported only by volumes whose volumeMode is set to Block

Table 2 ext4 capacity specifications

Storage Type

Storage Specifications

ext4 Specifications

CSI Specifications

OceanStor Dorado

512 Ki to 256 Ti

50 Ti

512 Ki to 50 Ti

OceanStor Pacific series

64 Mi to 512 Ti

50 Ti

64 Mi to 50 Ti

OceanDisk

512 Ki to 256 Ti

50 Ti

512 Ki to 50 Ti

Table 3 XFS capacity specifications

Storage Type

Storage Specifications

XFS Specifications

CSI Specifications

OceanStor Dorado

512 Ki to 256 Ti

500 Ti

512 Ki to 256 Ti

OceanStor Pacific series

64 Mi to 512 Ti

500 Ti

64 Mi to 500 Ti

OceanDisk

512 Ki to 256 Ti

500 Ti

512 Ki to 256 Ti

Using a PVC

After a PVC is created, you can use the PVC to create a Pod. The following is a simple example of using a PVC. In this example, the created Pod uses the newly created mypvc.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 2
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers: 
      - image: nginx:alpine
        name: container-0 
        volumeMounts: 
        - mountPath: /tmp
          name: pvc-mypvc 
      restartPolicy: Always 
      volumes: 
      - name: pvc-mypvc 
        persistentVolumeClaim: 
          claimName:  mypvc  # name of PVC


If Pods are batch created using PVCs, the Pods are in the ContainerCreating status for a long time, and the huawei-csi-node service is in the OOMKilled status, the memory of the huawei-csi-node service is insufficient. Increase the memory limit of huawei-csi-node by referring to Table 1 .

3.1.2 - Configuring a Static PV

Static volume provisioning allows administrators to use a resource created on the storage side as a PV for containers in the cluster.

Configuration Description

Perform the following steps to configure a static PV:

Preparation

A storage resource, such as a LUN or file system, required by the PV to be created exists on the storage device. If the storage resource is a file system, you also need to create the share and client information of the file system.

Configuring a PV

  1. Prepare the PV configuration file mypv.yaml. The following is an example. For details about other parameters, see Table 1 .

    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: mypv
    spec:
      volumeMode: Filesystem
      storageClassName: "" # The value must be to "".
      accessModes:
        - ReadWriteOnce
      csi:
        driver: csi.huawei.com # Enter the CSI driver name.
        volumeHandle: iscsi-dorado-181.lun0001 # Enter the volume name.
        fsType: xfs # Set the file system type.
      capacity:
        storage: 100Gi
    


    In the configuration file for static volume provisioning, storageClassName must be set to "". Otherwise, Kubernetes will use the default StorageClass.

  2. Run the following command to create a PV based on the prepared .yaml file.

    kubectl create -f mypv.yaml
    
  3. After a period of time, run the following command to view the information about the created PV.

    kubectl get pv
    

    The following is an example of the command output. If the PV status is Available, the PV is successfully created.

    NAME       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM               STORAGECLASS   REASON   AGE
    mypv       100Gi      RWO            Retain           Available                                               4s
    

Table 1 Parameters for configuring a static PV

Parameter

Description

Mandatory

Default Value

Remarks

metadata.name

User-defined name of a PV object.

Yes

-

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

spec.volumeMode

Volume mode. This parameter is optional. When LUN volumes are used, the following types are supported:

  • Filesystem: local file system.
  • Block: raw device.

No

Filesystem

This parameter takes effect when a PV is mounted. The default value is Filesystem.

  • Filesystem indicates that a container accesses a PV using a local file system. The local file system type is specified by the fsType field in the specified StorageClass.
  • Block indicates that a PV is accessed in raw volume mode.

spec.storageClassName

Name of the StorageClass object. This parameter is mandatory.

Yes

-

Set the parameter to an empty string, that is, enter "".

spec.accessModes

Access mode of the volume.

  • RWO (ReadWriteOnce): A volume can be mounted to a node in read/write mode. This mode also allows multiple Pods running on the same node to access the volume.
  • ROX (ReadOnlyMany): A volume can be mounted to multiple nodes in read-only mode.
  • RWX (ReadWriteMany): A volume can be mounted to multiple nodes in read/write mode.
  • RWOP (ReadWriteOncePod): A volume can only be mounted to a single Pod in read/write mode. Kubernetes 1.22 and later versions support this feature.

Yes

ReadWriteOnce

  • RWO/ROX/RWOP: supported by all types of volumes. RWOP is supported only by Kubernetes 1.22 and later versions. Check whether this feature is enabled for your Kubernetes cluster by referring to Enabling the ReadWriteOncePod Feature Gate.
  • The support for RWX is as follows:
    • NAS storage: supported by all volumes
    • SAN storage: supported only by volumes whose volumeMode is set to Block

spec.csi.driver

CSI driver name.

Yes

csi.huawei.com

Set this parameter to the driver name set during Huawei CSI installation.

spec.csi.volumeHandle

Unique identifier of a storage resource. This parameter is mandatory.

Format: <backendName>.<volume-name>

Yes

-

The value of this parameter consists of the following parts:

  • <backendName>: indicates the name of the backend where the volume resides. You can run the following command to obtain the configured backend information.

    oceanctl get backend

  • <volume-name>: indicates the name of a resource (LUN/file system) on the storage. You can obtain the value from DeviceManager.

spec.csi.fsType

Type of a host file system. This parameter is optional. The supported types are:

  • ext2
  • ext3
  • ext4
  • xfs

No

-

If this parameter is not set, the default value ext4 is used. This parameter is available only when volumeMode is set to Filesystem.

spec.csi.volumeAttributes.dTreeParentName

Name of the parent file system when the volume resource type is dtree.

Conditionally mandatory

-

This parameter is mandatory when the managed object is a dtree resource and the parentname parameter is not configured in the storage backend.

If dTreeParentName is configured only in the PV but parentname is not configured in the corresponding storage backend, set CSIDriverObject.attachRequired to true during CSI installation according to Table 5.

spec.capacity.storage

Volume size.

Yes

100Gi

Ensure that the size is the same as that of the corresponding resource on the storage. Kubernetes will not invoke CSI to check whether the value of this parameter is correct. Therefore, the PV can be successfully created even if its capacity is inconsistent with that of the corresponding resource on the storage.

spec.mountOptions.nfsvers

NFS mount option on the host. The following mount option is supported:

nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2.

No

-

This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format.

If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0.

spec.mountOptions.acl

The DPC namespace supports the ACL function. The DPC client supports POSIX ACL, NFSv4 ACL, and NT ACL authentication.

No

-

The descriptions of acl, aclonlyposix, cnflush, and cflush are for reference only. For details about the parameters, see OceanStor Pacific Series Product Documentation and choose Configuration > Basic Service Configuration Guide for File > Configuring Basic Services (DPC Scenario) > Accessing a DPC Share on a Client > Step 2.

spec.mountOptions.aclonlyposix

The DPC namespace supports POSIX ACL, and the DPC client supports POSIX ACL authentication.

The following protocols support POSIX ACL: DPC, NFSv3, and HDFS. If NFSv4 ACL or NT ACL is used, the DPC client cannot identify the ACL of this type. As a result, the ACL of this type does not take effect.

No

-

If aclonlyposix and acl are used together, only acl takes effect. That is, the namespace supports the ACL function.

spec.mountOptions.cnflush

Asynchronous disk flushing mode. That is, data is not flushed to disks immediately when files in the namespace are closed.

No

-

Asynchronous flushing mode: When a file is closed, data in the cache is not flushed to storage media in synchronous mode. Instead, data is written from the cache to the storage media in asynchronous flushing mode. After the write service is complete, data is flushed from the cache to disks periodically based on the flushing period. In a multi-client scenario, if concurrent operations are performed on the same file, the file size update is affected by the disk flushing period. That is, the file size is updated only after the disk flushing is complete. Generally, the update is completed within several seconds. Synchronous I/Os are not affected by the disk flushing period.

spec.mountOptions.cflush

Synchronous disk flushing mode. That is, data is flushed to disks immediately when files in the namespace are closed.

No

-

By default, the synchronous disk flushing mode is used.

Configuring a PVC

After a PV is created in static volume provisioning mode, you can create a PVC based on the PV for containers.

  1. Prepare the PVC configuration file mypv.yaml. The following is an example. For details about other parameters, see Table 2 .

    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: mypvc
    spec:
      storageClassName: ""
      accessModes:
        - ReadWriteOnce
      volumeMode: Filesystem
      resources:
        requests:
          storage: 100Gi
      volumeName: mypv # Enter the name of the corresponding PV.
    
  2. Run the following command to create a PVC based on the configured .yaml file.

    kubectl create -f mypvc.yaml
    
  3. After a period of time, run the following command to view the information about the created PVC.

    kubectl get pvc
    

    The following is an example of the command output. If the PVC status is Bound, the PVC is successfully created.

    NAME        STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    mypvc       Bound    pvc-840054d3-1d5b-4153-b73f-826f980abf9e   100Gi      RWO                           12s
    

Table 2 PVC parameters for configuring a static PV

Parameter

Description

Mandatory

Default Value

Remarks

metadata.name

User-defined name of a PVC object.

Yes

-

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

spec.accessModes

Access mode of the volume.

  • RWO (ReadWriteOnce): A volume can be mounted to a node in read/write mode. This mode also allows multiple Pods running on the same node to access the volume.
  • ROX (ReadOnlyMany): A volume can be mounted to multiple nodes in read-only mode.
  • RWX (ReadWriteMany): A volume can be mounted to multiple nodes in read/write mode.
  • RWOP (ReadWriteOncePod): A volume can only be mounted to a single Pod in read/write mode. Kubernetes 1.22 and later versions support this feature.

Yes

ReadWriteOnce

  • RWO/ROX/RWOP: supported by all types of volumes. RWOP is supported only by Kubernetes 1.22 and later versions. For versions earlier than Kubernetes 1.29, you need to enable this feature by following the instructions in Enabling the ReadWriteOncePod Feature Gate.
  • The support for RWX is as follows:
    • NAS storage: supported by all volumes
    • SAN storage: supported only by volumes whose volumeMode is set to Block

spec.volumeMode

Volume mode.

No

Filesystem

This parameter is optional. The value can be Filesystem or Block. The default value is Filesystem. This parameter takes effect when a Pod is created. Filesystem indicates that a file system is created on a PVC to access the storage. Block indicates that a raw volume is used to access the storage.

spec.resources.requests.storage

Size of the volume to be created.

Yes

-

Size of the volume to be created. The format is ***Gi and the unit is GiB.

The PVC capacity depends on storage specifications and host specifications. For example, OceanStor Dorado 6.1.2 or OceanStor Pacific series 8.1.0 is connected to CentOS 7. If ext4 file systems are used, see Table 2. If XFS file systems are used, see Table 3. If NFS or raw devices are used, the capacity must meet the specifications of the used Huawei storage device model and version.

If the PVC capacity does not meet the specifications, a PVC or Pod may fail to be created due to the limitations of storage specifications or host file system specifications.

When a PVC is created using a static PV and the PVC capacity is smaller than the capacity of the bound PV, the PVC capacity is set to the capacity of the bound PV. If the PVC capacity is greater than the capacity of the bound PV, the PVC cannot be created.

spec.volumeName

Name of the PV object.

Yes

-

This parameter is mandatory when a PVC is created statically.

spec.storageClassName

Name of the StorageClass object.

Yes

-

When a PVC is created, an empty character string is transferred. If this parameter is not set, the default StorageClass object name will be used.

Using a PVC

The use method is the same as that for dynamic volume provisioning in Using a PVC .

3.1.3 - Managing PVs

Manage Volume Provisioning allows administrators to use resources created on storage as PVs and supports features of dynamic volumes, such as capacity expansion, snapshot, and clone. This is a custom capability of Huawei CSI. This feature applies to the following scenarios:

  • In the reconstruction containerized applications, existing storage volumes need to be used.
  • The Kubernetes cluster is rebuilt.
  • Storage data is migrated in disaster recovery (DR) scenarios.


Manage Volume Provisioning allows existing storage resources to be managed by Kubernetes. You are not allowed to manage a storage resource for multiple times and concurrently delete or create a storage resource. When a storage resource is managed by multiple clusters, operations on the managed volume in a single cluster take effect only in the cluster and will not be synchronized to other clusters. Instead, you need to perform these operations on the managed volume in other clusters. For example, when you expand the capacity of a PVC in a cluster, the capacity of the corresponding PVC in other clusters will not be automatically expanded. In this case, you need to manually expand the capacity in other clusters by running the expansion commands in Expanding the Capacity of a PV .

Configuration Description

Perform the following steps to manage and use PVs:

Preparation

  • You have registered the storage where the volume to be managed resides with CSI.
  • You have logged in to the storage device to obtain the name and capacity of the volume to be managed.
  • The StorageClass has been configured. For details, see Configuring a StorageClass (pay attention to the Whether the Volume Management Takes Effect field in the table).

Configuring a PVC

  1. Prepare the PVC configuration file mypv.yaml. The following is an example. For details about other parameters, see Table 1 .

    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: mypvc
      annotations:
        csi.huawei.com/manageVolumeName: "*"  # Enter the storage resource name.
        csi.huawei.com/manageBackendName: "*" # Enter the storage backend name.
      labels:
        provisioner: csi.huawei.com
    spec:
      accessModes:
        - ReadWriteOnce
      volumeMode: Filesystem
      storageClassName: mysc
      resources:
        requests:
          storage: 100Gi
    
  2. Run the following command to create a PVC using the configuration file.

    kubectl create -f mypvc.yaml
    
  3. After a period of time, run the following command to view the information about the created PVC.

    kubectl get pvc mypvc
    

    The following is an example of the command output. If the PVC status is Bound, the PVC has been created and can be used by a Pod.

    NAME        STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    mypvc       Bound    pvc-840054d3-1d5b-4153-b73f-826f980abf9e   100Gi      RWO            mysc           12s
    

Table 1 PVC parameters for managing PVs

Parameter

Description

Mandatory

Default Value

Remarks

metadata.annotations

PVC object annotations. Set the following parameters:

  • Driver name/manageVolumeName: volume name on the storage.
  • Driver name/manageBackendName: name of the backend to which the volume belongs.

Yes

csi.huawei.com/manageVolumeName: * csi.huawei.com/manageBackendName: *

  • For details about how to obtain Driver name, see Table 4.
  • Driver name/manageVolumeName: name of an existing volume on the storage. Only English characters are supported.
  • Driver name/manageBackendName: name of the storage backend in CSI.

You can run the oceanctl get backend -n huawei-csi command to obtain the backend name.

metadata.labels

PVC object labels.

No

-

Format: provisioner: Driver name specified during installation

Example: provisioner: csi.huawei.com

This parameter takes effect when a PVC is created. It is used to listen to PVC resources and obtain information about metadata.annotations.

metadata.name

User-defined name of a PVC object.

Yes

-

Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit.

spec.volumeMode

Volume mode. This parameter is optional. When LUN volumes are used, the following types are supported:

  • Filesystem: local file system.
  • Block: raw device.
NOTE:

This parameter takes effect when a PV is mounted. The use method of this parameter must be the same as that of the managed volume.

  • If a volume is used as a raw volume before being managed, volumeMode must be set to Block.
  • If a volume is used in ext2, ext3, or ext4 mode before being managed, volumeMode must be set to Filesystem and fsType in the StorageClass must be set to ext2, ext3, or ext4.
  • If a volume is used in XFS mode before being managed, volumeMode must be set to Filesystem and fsType in the StorageClass must be set to xfs.

No

Filesystem

This parameter takes effect when a PV is mounted.

  • Filesystem indicates that a container accesses a PV using a local file system. The local file system type is specified by the fsType field in the specified StorageClass.
  • Block indicates that a PV is accessed in raw volume mode.

spec.storageClassName

Name of the StorageClass object.

Yes

-

The configuration of the StorageClass must be the same as that of the managed volume.

spec.resources.requests.storage

Size of the volume to be created. The format is ***Gi and the unit is GiB.

Yes

-

The PVC capacity depends on storage specifications and host specifications. For example, OceanStor Dorado 6.1.2 or OceanStor Pacific series 8.1.0 is connected to CentOS 7. If ext4 file systems are used, see Table 2. If XFS file systems are used, see Table 3. If NFS or raw devices are used, the capacity must meet the specifications of the used Huawei storage device model and version.

If the PVC capacity does not meet the specifications, a PVC or Pod may fail to be created due to the limitations of storage specifications or host file system specifications.

spec.accessModes

Access mode of the volume.

  • RWO (ReadWriteOnce): A volume can be mounted to a node in read/write mode. This mode also allows multiple Pods running on the same node to access the volume.
  • ROX (ReadOnlyMany): A volume can be mounted to multiple nodes in read-only mode.
  • RWX (ReadWriteMany): A volume can be mounted to multiple nodes in read/write mode.
  • RWOP (ReadWriteOncePod): A volume can only be mounted to a single Pod in read/write mode. Kubernetes 1.22 and later versions support this feature.

Yes

ReadWriteOnce

  • RWO/ROX/RWOP: supported by all types of volumes. RWOP is supported only by Kubernetes 1.22 and later versions. For versions earlier than Kubernetes 1.29, you need to enable this feature by following the instructions in Enabling the ReadWriteOncePod Feature Gate.
  • The support for RWX is as follows:
    • NAS storage: supported by all volumes
    • SAN storage: supported only by volumes whose volumeMode is set to Block

Using a PVC

The procedure is the same as that for Using a PVC for dynamic volume provisioning.

3.2 - Managing PVs

3.2.1 - Expanding the Capacity of a PV


For OceanStor V700R001C10 as well as OceanStor Dorado V700R001C10 and later versions, the minimum capacity of a file system after capacity expansion is limited. For details, see the product documentation of the corresponding storage device.

When the capacity of a PVC used by a container is insufficient, you need to expand the capacity of the PVC.

Prerequisites

  • A PVC has been created, the backend to which it resides exists and supports capacity expansion.

  • Compatibility and Features lists the storage that supports capacity expansion, and Kubernetes Feature Matrix lists the Kubernetes versions that support capacity expansion.

  • The csi-resizer service is enabled for huawei-csi-controller.

    kubectl describe deploy huawei-csi-controller -n huawei-csi | grep csi-resizer
    

    If the following information is displayed, the csi-resizer service is enabled.

       csi-resizer:
        Image:      k8s.gcr.io/sig-storage/csi-resizer:v1.9.0
    

Procedure

  1. Run the following command to check whether the StorageClass supports capacity expansion. In the preceding command, mysc indicates the name of the StorageClass to be queried.

    kubectl get sc mysc
    

    The following is an example of the command output.

    NAME              PROVISIONER      RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    mysc              csi.huawei.com   Delete          Immediate           true                  172m
    

    If the value of ALLOWVOLUMEEXPANSION is true, the current StorageClass supports capacity expansion. In this case, go to 3 .

  2. Run the following command to change the value of allowVolumeExpansion to true. In the preceding command, mysc indicates the name of the StorageClass to be modified.

    kubectl patch sc mysc --patch '{"allowVolumeExpansion":true}'
    
  3. Run the following command to query the StorageClass name of the PVC. In the preceding command, mypvc indicates the name of the PVC to be expanded.

    kubectl get pvc mypvc
    

    The following is an example of the command output.

    NAME               STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      AGE
    mypvc              Bound    pvc-3383be36-537c-4cb1-8f32-a415fa6ba384   2Gi        RW0            mysc              145m
    
  4. Run the following command to expand the capacity.

    kubectl patch pvc mypvc -p '{"spec":{"resources":{"requests":{"storage":"120Gi"}}}}'
    

    In the preceding command, mypvc indicates the name of the PVC to be expanded, and 120Gi indicates the capacity after expansion. Change the values based on the site requirements.

    • The PVC capacity depends on storage specifications and host specifications. For example, OceanStor Dorado 6.1.2 or OceanStor Pacific series 8.1.0 is connected to CentOS 7. If ext4 file systems are used, see Table 2 . If XFS file systems are used, see Table 3 . If NFS or raw devices are used, the capacity must meet the specifications of the used Huawei storage device model and version.
    • If the PVC capacity does not meet the specifications, a PVC or Pod may fail to be created due to the limitations of storage specifications or host file system specifications.
    • If the capacity expansion fails because the target capacity exceeds the storage pool capacity, see Failed to Expand the PVC Capacity Because the Target Capacity Exceeds the Storage Pool Capacity .
  5. Run the following command to check whether the capacity modification takes effect.

    kubectl get pvc
    

    The following is an example of the command output. If the value of CAPACITY is changed to the specified capacity, the capacity expansion is successful.

    NAME        STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    mypvc       Bound    pvc-3383be36-537c-4cb1-8f32-a415fa6ba384   120Gi       RWO            mysc           24s
    

3.2.2 - Cloning a PV

This section describes how to clone a PVC.

When cloning a PVC, you need to specify the data source. The following is an example of cloning a PVC. In this example, mypvc is used as the data source and a PVC named myclone is created.

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: myclone
spec:
  storageClassName: mysc
  dataSource:
    name: mypvc
    kind: PersistentVolumeClaim
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi

  • The specified storageClassName must be the same as the StorageClass of the source volume in dataSource.
  • The capacity of the clone volume must be greater than or equal to that of the source volume. Equal capacity is recommended.

Prerequisites

The source PVC already exists in the system, and the backend where the source PVC resides supports cloning. Compatibility and Features lists the storage that supports cloning, and Kubernetes Feature Matrix lists the Kubernetes versions that support cloning.

Procedure

  1. Run the following command to create a PVC based on the configuration file of the clone volume.

    kubectl create -f myclone.yaml
    

3.2.3 - Changing a PV

3.2.3.1 - Enabling the PVC Change Feature

The PVC change feature is disabled by default during Huawei CSI installation. To use this feature, perform the following steps.

3.2.3.1.1 - Enabling the PVC Change Feature Using Helm

Prerequisites

You have installed Huawei CSI using Helm.

Procedure

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to check whether the PVC change feature is enabled.

    helm-huawei-csi indicates the Helm chart name specified during installation, and huawei-csi indicates the Helm chart namespace specified during installation. For details about the component package path, see Table 1 .

    helm get values helm-huawei-csi -n huawei-csi -a | grep volumeModify -A 1
    

    The following is an example of the command output.

    • If enabled: true is displayed in the command output, the feature is enabled. In this case, skip the following steps.
    • If enabled: false is displayed in the command output, perform the following steps to enable the PVC change feature.
    volumeModify:
      enabled: false
    
  3. Go to the /helm/esdk directory and run the following command to configure the volume change CRD.

    # kubectl apply -f ./crds/volume-modify/
    customresourcedefinition.apiextensions.k8s.io/volumemodifyclaims.xuanwu.huawei.io configured
    customresourcedefinition.apiextensions.k8s.io/volumemodifycontents.xuanwu.huawei.io configured
    


    If the command output contains Warning: resource customresourcedefinitions/volumemodifycontents.xuanwu.huawei.io is missing the kubectl.kubernetes.io/last-applied-configuration…, you can ignore it. This message is displayed because the kubectl create command instead of the kubectl apply command is used for installation by Helm.

  4. Run the following command to obtain the original service configuration file.

    helm get values helm-huawei-csi -n huawei-csi -a > ./update-values.yaml
    
  5. Run the vi update-values.yaml command to open the file obtained in 4 and modify the following configuration. After the modification is complete, press Esc and enter :wq! to save the modification.

    csiExtender:
      volumeModify:    
        enabled: true
    
  6. Run the following command to update Huawei CSI services.

    helm upgrade helm-huawei-csi ./ -n huawei-csi  -f ./update-values.yaml
    
  7. Run the following command to check whether the services are started.

    kubectl get pod -n huawei-csi
    

    The following is an example of the command output. In the preceding command, huawei-csi indicates the namespace for deploying Huawei CSI.

    NAME                                     READY     STATUS    RESTARTS   AGE
    huawei-csi-controller-6dfcc4b79f-9vjtq   10/10     Running   0          24m
    huawei-csi-node-tqs87                    3/3       Running   0          20m
    

3.2.3.1.2 - Enabling the PVC Change Feature Manually

Prerequisites

Huawei CSI has been manually installed.

Procedure

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Go to the manual/esdk working directory and run the following command to configure the volume change CRD.

    kubectl apply -f ./crds/volume-modify/
    
  3. Run the following command. For details about the component package path, see Table 1 .

    kubectl apply -f ./deploy/huawei-csi-controller-extender.yaml
    
  4. Run the following command to check whether the services are started.

    kubectl get pod -n huawei-csi
    

    The following is an example of the command output. In the preceding command, huawei-csi indicates the namespace for deploying Huawei CSI.

    NAME                                     READY     STATUS    RESTARTS   AGE
    huawei-csi-controller-6dfcc4b79f-9vjtq   10/10     Running   0          24m
    huawei-csi-node-tqs87                    3/3       Running   0          24m
    

3.2.3.2 - Configuring PVC Changes

The PVC change feature is implemented using CRD. Related resources are described as follows.

Table 1 Resource description

NAME

APIVERSION

NAMESPACED

KIND

volumemodifyclaims

xuanwu.huawei.io/v1

false

VolumeModifyClaim

volumemodifycontents

xuanwu.huawei.io/v1

false

VolumeModifyContent

  • VolumeModifyClaim resources can be created, deleted, and queried, but cannot be updated.
  • VolumeModifyContent resources can only be queried and are used to display the change details of a single PVC. Do not manually create, delete, or modify the resources.
  • VolumeModifyContent resources are managed by VolumeModifyClaim. Do not manually manage VolumeModifyContent resources.

3.2.3.2.1 - Creating a PVC Change

Prerequisites

The storage backends associated with the PVC to be changed are HyperMetro storage backends. If they are not HyperMetro storage backends, configure them by following the instructions in Updating a Storage Backend .

PVC Change File Description

The sample template of the PVC change file is /examples/volumemodifyclaim.yaml. The following table lists the configuration items.

Table 1 Parameter description

Parameter

Description

Mandatory

Default Value

Remarks

apiVersion

API group, which is of the string type.

Yes

xuanwu.huawei.io/v1

The value is fixed at xuanwu.huawei.io/v1.

kind

Resource type, which is of the string type.

Yes

VolumeModifyClaim

The value is fixed at VolumeModifyClaim.

metadata.name

Name of a cluster resource object, which is of the string type.

Yes

-

The name must comply with the naming rules of a DNS subdomain name. The value can contain a maximum of 63 characters, including digits, lowercase letters, hyphens (-), and periods (.). It must start and end with a lowercase letter or digit.

Note: During a PVC change, the original StorageClass is backed up. The name of the backup StorageClass is <Original StorageClass name><VolumeModifyClaim name>, and must comply with the StorageClass naming rules.

spec.source.kind

Data source type, which is of the string type.

Yes

StorageClass

This parameter can only be set to StorageClass.

spec.source.name

Data source name, which is of the string type.

Yes

-

Only a StorageClass name can be configured.

spec.parameters.hyperMetro

Whether to change a common volume to a HyperMetro volume. Currently, the value can only be "true".

Yes

-

Only common storage volumes at the primary site can be changed to HyperMetro storage volumes.

spec.parameters.metroPairSyncSpeed

Data synchronization speed of a HyperMetro pair. The value ranges from 1 to 4.

The value can be:

  • 1: low
  • 2: medium
  • 3: high
  • 4: highest

No

-

This parameter is available only when spec.parameters.hyperMetro is set to "true".

Note:

  • If this parameter is not configured, the storage speed of the HyperMetro pair is determined by the storage device.
  • The highest synchronization speed may increase the host latency.

  • The spec.source.kind and spec.source.name parameters are used to specify the volume change scope. For example, if they are set to a StorageClass and the corresponding name respectively, all PVCs in the Bound state provisioned using the target StorageClass will be changed.
  • After all associated PVCs are changed, Huawei CSI will replace the original StorageClass and add the spec.parameters parameter of the VolumeModifyClaim so that the PVCs meet the StorageClass definition.

For details about the configuration in typical scenarios, see the following example:

Changing a Common Volume to a HyperMetro Volume

The following is an example of changing a common volume to a HyperMetro volume:

apiVersion: xuanwu.huawei.io/v1
kind: VolumeModifyClaim
metadata:
  name: myvmc
spec:
  source:
    kind: StorageClass
    name: mysc
  parameters:
    hyperMetro: "true"

Creating a PVC Change Resource

  • The changed HyperMetro volumes must be in HyperMetro AA mode.
  • When a common volume is changed to a HyperMetro volume, only the storage volume at the primary site can be changed.
  • Do not use Huawei CSI to manage a PVC during PVC change resource creation.
  • Multiple VolumeModifyClaim resources cannot be created for the same PVC. If the target PVC needs to be changed for multiple times, perform the changes one by one.

To create a PVC change resource using a PVC change file, perform the following steps:

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to create a PVC change.

    kubectl create -f volumemodifyclaim.yaml 
    
  3. Query the creation result by following the instructions in Querying a PVC Change .

3.2.3.2.2 - Querying a PVC Change

This section describes how to use Kubectl to query the PVC change status. Currently, Huawei CSI provides the following APIs through CRD.

Querying a VolumeModifyClaim

To query a VolumeModifyClaim using kubectl, perform the following steps.

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to query a PVC change. In the command, vmc-name indicates the name of the VolumeModifyClaim resource.

    kubectl get volumemodifyclaims <vmc-name> -owide
    

    The following is an example of the command output.

    NAME    STATUS      READY   SOURCEKIND     SOURCENAME   STARTEDAT              COMPLETEDAT            AGE
    myvmc   Completed   1/1     StorageClass   mysc         2024-06-06T03:19:13Z   2024-06-06T03:19:16Z   2m2s
    

    Table 1 Command output description

    Parameter

    Description

    NAME

    VolumeModifyClaim resource name.

    STATUS

    VolumeModifyClaim resource status. The value can be:

    • Pending: initial status.
    • Creating: The VolumeModifyClaim has completed basic verification and the server has received the change task, but the task has not been completed.
    • Completed: All associated PVCs are changed.
    • Rollback: When associated PVCs are partially changed, a user deletes PVCs.
    • Deleting: When all associated PVCs are changed, a user deletes PVCs.

    READY

    Ratio of the number of changed PVCs to the total number of PVCs that need to be changed.

    SOURCEKIND

    Data source type, for example, StorageClass.

    SOURCENAME

    Data source name, for example, StorageClass name.

    STARTEDAT

    Change start time, that is, the timestamp when the server receives the task and starts to process the task.

    COMPLETEDAT

    Change completion time, that is, the timestamp when the changes of all associated PVCs are complete. This parameter exists only when STATUS is Completed.

    AGE

    Lifetime of a VolumeModifyClaim from the time when it is created to the current time.


You can use kubectl to view the Events information of a VolumeModifyClaim. If a VolumeModifyClaim cannot meet the creation requirements or an error occurs during the creation, the server will record the Events information. The following command is used as an example:

kubectl describe volumemodifyclaims local-to-hypermetro 

Querying a VolumeModifyContent

A VolumeModifyContent is created using a VolumeModifyClaim and records the change details of a single PVC. To query a VolumeModifyContent using kubectl, perform the following steps:

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to query a PVC change. In the command, myvmc-uid indicates the VolumeModifyContent resource name.

    kubectl get volumemodifycontents myvmc-uid  -owide
    

    The following is an example of the command output.

    NAME         STATUS      MODIFYCLAIMNAME     SOURCEVOLUME   STARTEDAT              COMPLETEDAT            AGE
    myvmc-uid    Completed   myvmc               default/mypvc  2024-06-06T03:19:07Z   2024-06-06T03:19:09Z   36m
    

    Table 2 Command output description

    Parameter

    Description

    NAME

    VolumeModifyContent resource name. The format is VolumeModifyClaim name-UID of the associated PVC.

    STATUS

    VolumeModifyContent resource status. The value can be:

    • Pending: initial status.
    • Creating: The VolumeModifyContent has completed basic verification and the server has received the change task, but the task has not been completed.
    • Completed: The associated PVC is changed.
    • Rollback: The PVC change is being rolled back.

    MODIFYCLAIMNAME

    Name of the associated VolumeModifyClaim.

    SOURCEVOLUME

    Information about the associated PVC. The format is Namespace name/PVC name.

    STARTEDAT

    PVC change start time, that is, the timestamp when the server receives the task and starts to process the task.

    COMPLETEDAT

    PVC change completion time, that is, the timestamp when the changes of all associated PVCs are complete. This parameter exists only when STATUS is Completed.

    AGE

    Lifetime of a VolumeModifyContent from the time when it is created to the current time.


You can use kubectl to view the Events information of a VolumeModifyContent. If a VolumeModifyContent cannot meet the creation requirements or an error occurs during the PVC change, the server will record the Events information. The following command is used as an example:

kubectl describe volumemodifycontents myvmc-uid

3.2.3.2.3 - Deleting a PVC Change

  • If STATUS of a VolumeModifyClaim is Creating, deleting the VolumeModifyClaim resource will delete the created resource on the storage side and then remove the cluster resource. After the deletion, if you continue to use the original StorageClass for PVC management, you need to restore the associated storage backend to a non-HyperMetro storage backend.
  • If STATUS of a VolumeModifyClaim is Pending or Completed, deleting the VolumeModifyClaim resource will only remove the cluster resource and will not delete the created resource on the storage side (that is, there is not interaction with the storage side).
  • VolumeModifyContent resources are managed by VolumeModifyClaim. Do not manually manage VolumeModifyContent resources.
  • If some PVCs among the PVCs to be changed meet the change requirements and the batch change fails, all PVC changes will be removed. As a result, the PVCs that meet the change requirements will not meet the change requirements.
  • If a PVC to be changed has been manually managed on the storage side, the change may fail. Do not manually manage storage volumes when using the change feature.

This section describes how to use kubectl to delete a PVC change. The procedure is as follows.

Procedure

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to delete a PVC change. In the command, vmc-name indicates the name of the VolumeModifyClaim resource.

    kubectl delete volumemodifyclaims <vmc-name>
    
  3. Query the creation result by following the instructions in Querying a PVC Change .