Skip to main content

Recently, I am playing around TCE(Tanzu Community Edition) 0.10 in my homelab. I found something interesting and would like to share my findings here.

The environment is like below:
vSphere vCenter: 7.0.3
ESXi: 7.0.3
TCE: 0.10
Kubernetes : v1.21.5+vmware.1
vSphere CSI: csi.vsphere.vmware.com
k10: 4.5.10/4.5.11
Location profile: Minio S3/VBR v11a

The backup policy :

So that the policy will keep 1 daily snapshot in vSphere FCD. I can see the snapshot vmdk from the datastore after successful policy runs.

I can also do a restore job from my Minio S3. The restore job seems to work fine. But if I restore it into the original namespace and the original application is still existing, I may get an alarm from the vSphere side.

The error message is “A specified parameter was not correct: id Cannot be performed on FCD with snapshots.”

The reason for this alarm is k10 kicks off a pvc deletion task from Kubernetes side and Kubernetes passes it to vSphere directly. But from the vSphere side, the pvc is mapping to a vmdk with snapshot. vSphere couldn't delete this parent vmdk directly, it would break the snapshot chain.

To avoid this issue, we just need to remove all the snapshots from K10 GUI before we do the restore job.


So, for the vSphere integration, may I request that the restore job could check the existing snapshot and remove all the snapshots before kick off pvc deletion task?

Hi @Lei Wei !

I got the same message on vsphere server one month ago when I tried to remove one persistent volumes in my rancher cluster. In my case the problem was related to a badly configuration of CPI driver and I resolved it by adding the correct configuration of vsphere environment in my rancher cluster configuration as shown there: https://rancher.com/docs/rke/latest/en/config-options/cloud-providers/vsphere/config-reference/#:~:text=cloud_provider%3A%0A%20%20%20%20name%3A%20vsphere,hn1/resources/myresourcepool 
Maybe you have to do the same with your tanzu cluster (?) 

I hope this can help u


Hi, @mario996 

Thanks for the info.

My tanzu cluster had the correct vSphere configuration, I can remove PVs in my tanzu cluster and its related storage object in vSphere datastore. 


The only issue I met is when I restore an application to the existing namespace with snapshots. The snapshots are taken by K10, and K10 requires at least one snapshot keeping it in the datastore. 


@Lei Wei Thanks for this. Great information. So you were able to get the snapshotting to work (i.e. latest csi-vsphere driver). I read a post somewhere where they claimed that TCE did storage slightly differently than in full blown Tanzu and that it would not work. If you have the instructions that you followed that you could share that would be great!.

I have setup TCE a few times and on the last one I connected it to a vsphere datastore. I was able to leverage a storage class to use the csi driver but had an issue when trying to snapshot and then ran out of time for that test since not work related 😞. I wanted to get back to it in the near future.

cheers

 


Hi, Geoff

I just followed the official guide, nothing special. After workload cluster is ready, I use the yaml connected to vSphere datatore.

 

kind: StorageClass  
apiVersion: storage.k8s.io/v1  
metadata:  
  name: standard  
  annotations:  
    storageclass.kubernetes.io/is-default-class: "true"  
provisioner: csi.vsphere.vmware.com  
parameters:  
  datastoreurl: ds:///vmfs/volumes/622a19d3-91aee82b-59df-1c697aafcbf9/

 


Hi, Geoff

I just followed the official guide, nothing special. After workload cluster is ready, I use the yaml connected to vSphere datatore.

 

kind: StorageClass  
apiVersion: storage.k8s.io/v1  
metadata:  
  name: standard  
  annotations:  
    storageclass.kubernetes.io/is-default-class: "true"  
provisioner: csi.vsphere.vmware.com  
parameters:  
  datastoreurl: ds:///vmfs/volumes/622a19d3-91aee82b-59df-1c697aafcbf9/

 

Ok thanks. What is your volumesnapshotclass? I think either I was using and earlier version of csi-vsphere before snapshotting was enabled or something else.

 

Thanks


I don’t have volumesnapshot installed. My k10 pre-flight check also reported:

CSI Capabilities Check:
  VolumeSnapshot CRD-based APIs are not installed  -  Error

This error can be ignore because I use vSphere integration for the snapshot. 


Ah ok so you have it as an infrastructure profile. Got it thanks


Comment