Cleanup Volume Snapshots which are no longer required from VKS Guest Cluster
search cancel

Cleanup Volume Snapshots which are no longer required from VKS Guest Cluster

book

Article ID: 421356

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

  • In the ideal scenario, the Backup appliance which took the Volume Snapshot is responsible for cleaning up the volumeSnapshot and volumeSnapshotContent objects on the Guest Cluster as well as the Supervisor cluster.

  • The same should in turn clean up the actual snapshots on the first-class disks inside the datastores.

  • However, in the event you see volumeSnapshot and volumeSnapshotContent objects inside the Guest Cluster which aren't valid anymore, refer this kb to manually clean them up.

Environment

VMware vSphere Kubernetes Service

Resolution

  1. Ensure that the Deletion policy on VolumeSnapshotContents is Delete and not Retain. Most of the time, the volumesnapshots and VolumeSnaphotContents don't get deleted from the guest cluster because the backup appliance somehow changes the DeletionPolicy on each VolumeSnapshotContent from Delete to Retain after VolumeSnapshot is created. This causes them to not delete at all. In case you see that the Deletion policy on VolumeSnapshotContents is Delete and not Retain, change it to "Delete" manually.

  2. Delete the VolumeSnapshot. This should delete the VolumeSnaphotContent associated with it. 

If the VolumeSnapshots is missing and only VolumeSnapshotContents is present inside the Guest cluster, follow the below steps.

  1. Like earlier, ensure that the Deletion policy on VolumeSnapshotContent is Delete and not Retain.

  2. Delete the VolumeSnapshotContents which should trigger the deletion of VolumeSnapshots in the Supervisor cluster too