As a vSphere administrator, you can use the vSphere IaaS control plane to view details and monitor key metrics related to persistent volumes, such as PV health status, storage compliance status, and binding information. You can identify potential issues like PV detachment or storage non-compliance and, if needed remediate the issues by reapplying storage policy or migrating the volume to another datastore.

Monitor and Manage Persistent Volumes

As a vSphere administrator, you can use the vSphere IaaS control plane to display persistent volumes and review their details.

Procedure

  1. In the vSphere Client, navigate to the namespace that has persistent volumes.
    1. From the vSphere Client home menu, select Workload Management.
    2. Click the Namespaces tab, and select the namespace from the list.
  2. Click the Storage tab and click Persistent Volume Claims.
    The vSphere Client lists all persistent volume claim objects and corresponding volumes available in the namespace.
  3. To view details of a selected persistent volume, click the name of the volume in the Persistent Volume Name column.
    The Container Volumes panel opens.
  4. Click the Details icon, and switch between the Basics and Kubernetes objects tabs.

    Basics tab displays such details as the pod, datastore, and storage policy related to the persistent volume
    The tabs display the following information related to the Kubernetes persistent volume.
    Item Description
    Type Type of storage that backs the persistent volume, such as block.
    Volume ID An ID of the volume.
    Volume Path Path to the virtual disk that backs the volume. The path includes the datastore name, the folder on the datastore, and the name of the disk. For example, [sharedVmfs-0] fcd/1b325557eb7f4a0991fb47ab1f32f74d.vmdk.
    Pod or VM Name of the pod or VM that uses the volume.

    You can click the link to display the item in the vSphere inventory.

    Datastore Datastore where the virtual disk that backs the volume resides.

    You can click the link to display the datasotre in the inventory. Use the datastore browser to navigate to the virtual disk. See Using Datastore Browser in vSphere Environment.

    Storage Policy The storage policy that the volume uses.
    Compliance Status The storage compliance status of the volume.
    Health Status The health status of the volume.
    Namespace The namespace where the volume resides.
    Persistent Volume Claim Information related to the persistent volume claim in the Kubernetes environment that is bound to the volume.
    Note: To monitor volume health status using the kubectl command, see Monitor Volume Health in a vSphere Namespace or TKG Cluster.

What to do next

For more details, see https://knowledge.broadcom.com/external/article?legacyId=90607.

Check Health and Storage Compliance Status of a Persistent Volume

On the Basics tab, you can check the health status of the persistent volume. You can also check its storage compliance status and reapply the storage policy if the status is out of date.

Procedure

  1. Click the Basics tab and verify the health status of the volume.
    Health Status Description
    Accessible The persistent volume is accessible and available for use.
    Inaccessible The persistent volume is inaccessible and cannot be used. For example, the volume becomes inaccessible if the datastore that stores the volume cannot be reached by the hosts that connect to the datastore.
  2. Verify the storage compliance status.
    You can see one of the following in the Compliance Status column.
    Compliance Status Description
    Compliant The datastore where the virtual disk backing the volume resides has the storage capabilities that the policy requires.
    Out of Date This status indicates that the policy has been edited, but the new storage requirements have not been communicated to the datastore. To communicate the changes, reapply the policy to the volume that is out of date.
    Noncompliant The datastore supports specified storage requirements, but cannot currently satisfy the storage policy. For example, the status might become Noncompliant when physical resources of the datastore are unavailable. You can bring the datastore into compliance by making changes in the physical configuration of your host cluster, for example by adding hosts or disks to the cluster. If additional resources satisfy the storage policy, the status changes to Compliant.

    If you cannot bring the datastore in the compliance, you can migrate the volume to a compliant datastore.

    Not Applicable The storage policy references datastore capabilities that are not supported by the datastore.
  3. If the compliance status is Out of Date, select the volume and click Reapply Policy.
    PVC appears as Out of Date
    The status changes to Compliant.

Migrate Persistent Volumes

As a vSphere administrator, you can use the vSphere IaaS control plane to migrate persistent volumes to a different datastore. For example, you might need to migrate a volume when its current datastore can no longer satisfy the volume storage requirements.

Note: When VMs reside on a datastore, the system alerts you and prevents the task from completion if you attempt to put the datastore into maintenance mode. However, if virtual disks backing persistent volumes are on the datastore, it can enter maintenance mode without warning. This means no safeguards prevent you from deleting a datastore in maintenance mode that still contains active volumes. To avoid accidentally deleting such datastrore, consider migrating the volumes to a different datastore before putting the original datastore into maintenance,

Prerequisites

  • Make sure that the original and target datastore is accessible to all Supervisor nodes. This applies to one-zone and three-zone deployments.

    For example, in a single-zone deployment, the target datastore must be shared across the nodes. The system doesn't prevent you from moving a volume from shared storage to non-shared storage, but the volume becomes inaccessible, which can affect the apps that use the volume.

  • If a volume is attached to a VM, the VM remains locked during volume relocation. If the volume you relocate is attached to a node VM, such as the TKG node, the system does not allow any other control operations on the VM. The operations include attaching or detaching other volumes to the VM, migrating the VM to a different datastore, changing any configuration of the VM, and so on.
  • Because PMEM datastores are not supported, attempts to relocate a volume to a PMEM datastore fail.
  • The target datastore must have sufficient free capacity to accommodate the migrated volume. If the free space of a datastore is less than the volume size, you cannot select the datastore for migration.
  • The system does not support storage policy changes during the migration operation. However, the system doesn’t prevent you from selecting a target datastore that is not compatible with the volume policy.

For additional details and known issues, see the Broadcom Knowledge Base article https://knowledge.broadcom.com/external/article?articleNumber=313416.

Procedure

  1. In the Container Volumes panel, select the volume or several volumes and click the Migrate button.
  2. In the Migrate volume dialog box, select the target datastore.
    Make sure that the target datastore is compatible and accessible to the volume.
  3. Acknowledge that you accept potential consequences of the migration.
    For example, the volume might become inaccessible or the target datastore might be incompatible with the storage policy the volume uses.
  4. Click Migrate.