Preparing a PVC Change File

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.

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"