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