Solved

Export Restorepoint Fails


Userlevel 1

I have installed k10 in a vCluster environment which has k3s as k8s distribution.
k8s version: 1.23.5+k3s1
kasten version: 6.0.1


When I run the policy for backing up the namespace. My backup policy creates volumesnapshots suceessfully but it is failing at the Export restoringpoint phase with the folllowing error.

I have run the k10 primer tool it has all checks ok. Below is the output.

@WDX5VBJHW32 MINGW64 ~
$ curl -s https://docs.kasten.io/tools/k10_primer.sh  | bash
Namespace option not provided, using default namespace
Checking for tools
 --> Found kubectl
 --> Found helm
 --> Found jq
Checking if the Kasten Helm repo is present
 --> The Kasten Helm repo was found
Checking for required Helm version (>= v3.0.0)
 --> No Tiller needed with Helm v3.12.0
K10Primer image
 --> Using Image (gcr.io/kasten-images/k10tools:6.0.1) to run test
Checking access to the Kubernetes context  
 --> Able to access the default Kubernetes namespace
K10 Kanister tools image
 --> Using Kanister tools image (ghcr.io/kanisterio/kanister-tools:0.92.0) to run test

Running K10Primer Job in cluster with command-
     ./k10tools primer
serviceaccount/k10-primer created
clusterrolebinding.rbac.authorization.k8s.io/k10-primer created
job.batch/k10primer created
Pod k10primer-xqdpj is in Pending phase
Pod Ready!

I0626 20:58:47.427457      10 request.go:690] Waited for 1.032461062s due to client-side throttling, not priority and fairness, request: GET:https://100.94.253.124:443/apis/k3s.cattle.io/v1
Kubernetes Version Check:
  Valid kubernetes version (v1.23.5+k3s1)  -  OK

RBAC Check:
  Kubernetes RBAC is enabled  -  OK

Aggregated Layer Check:
  The Kubernetes Aggregated Layer is enabled  -  OK

         Found multiple snapshot API group versions, using preferred.
CSI Capabilities Check:
  Using CSI GroupVersion snapshot.storage.k8s.io/v1  -  OK

         Found multiple snapshot API group versions, using preferred.
Validating Provisioners:
csi.nutanix.com:
  Is a CSI Provisioner  -  OK
  Missing/Failed to Fetch CSIDriver Object
  Storage Classes:
    nutanix-volume
      Valid Storage Class  -  OK
  Volume Snapshot Classes:
    nutanix-snapshot-class
      Has k10.kasten.io/is-snapshot-class annotation set to true  -  OK
      Has deletionPolicy 'Delete'  -  OK

Validate Generic Volume Snapshot:
  Pod created successfully  -  OK
  GVS Backup command executed successfully  -  OK
  Pod deleted successfully  -  OK

serviceaccount "k10-primer" deleted
clusterrolebinding.rbac.authorization.k8s.io "k10-primer" deleted
job.batch "k10primer" deleted
 

Export Restoring task Fails with the below error

 - cause:
              cause:
                cause:
                  cause:
                    message: Failed to get snapshot class with error
                      volumesnapshotclass.snapshot.storage.k8s.io
                      "k10-clone-nutanix-snapshot-class" not found
                  file: kasten.io/k10/kio/exec/phases/phase/phase_utils.go:359
                  function: kasten.io/k10/kio/exec/phases/phase.createPVCandSnapshotFromSource
                  linenumber: 359
                  message: Failed to create snapshot from source
                file: kasten.io/k10/kio/exec/phases/phase/copy_snapshots.go:906
                function: kasten.io/k10/kio/exec/phases/phase.(*artifactCopier).createPVCFromCSISnapshot
                linenumber: 906
                message: Failed to clone volume and snapshot from source snapshot
              file: kasten.io/k10/kio/exec/phases/phase/copy_snapshots.go:1504
              function: kasten.io/k10/kio/exec/phases/phase.(*gvcConverter).Convert
              linenumber: 1504
              message: Error creating portable snapshot
            fields:
              - name: type
                value: CSI
              - name: id
                value: k10-csi-snap-zxqtrt5qmmdb5r2w
            file: kasten.io/k10/kio/exec/phases/phase/copy_snapshots.go:440
            function: kasten.io/k10/kio/exec/phases/phase.(*artifactCopier).convertSnapshots.func1
            linenumber: 440
            message: Failed to export snapshot data
 

Below is the output of VolumeSnapshotClass 

$ kubectl get volumesnapshotclasses.snapshot.storage.k8s.io -A
NAME                     DRIVER            DELETIONPOLICY   AGE
nutanix-snapshot-class   csi.nutanix.com   Delete           3h31m

$ kubectl describe volumesnapshotclasses.snapshot.storage.k8s.io nutanix-snapshot-class
Name:             nutanix-snapshot-class
Namespace:
Labels:           app.kubernetes.io/managed-by=Helm
Annotations:      k10.kasten.io/is-snapshot-class: true
                  meta.helm.sh/release-name: nutanix-csi-storage
                  meta.helm.sh/release-namespace: caas-nutanix-csi
API Version:      snapshot.storage.k8s.io/v1
Deletion Policy:  Delete
Driver:           csi.nutanix.com
Kind:             VolumeSnapshotClass
Metadata:
  Creation Timestamp:  2023-06-26T16:39:55Z
  Generation:          1
  Resource Version:    1121833
  UID:                 e939bb5f-2ba2-48c8-9ac0-b00898f8dbc5
Parameters:
  csi.storage.k8s.io/snapshotter-secret-name:       ntnx-secret
  csi.storage.k8s.io/snapshotter-secret-namespace:  caas-nutanix-csi
  Storage Type:                                     NutanixVolumes
Events:                                             <none>
 

icon

Best answer by Hagag 27 June 2023, 09:25

View original

2 comments

Userlevel 5
Badge +2

Hello @shanmukh 

To prevent accidental deletions of the underlying VolumeSnapshotContent, K10 creates a clone of the original VolumeSnapshotClass with the DeletionPolicy set to 'Retain' with name ( k10-clone-nutanix-snapshot-class). This process ensures that the original snapshot remains intact. From this cloned snapshot, K10 creates a volume to facilitate data export.

but I am still not sure the reason behind the inability of K10 to create the cloned VolumeSnapshotclass.

 i think creating it manually would fix the issue
 

apiVersion: snapshot.storage.k8s.io/v1
deletionPolicy: Retain
driver: csi.nutanix.com
kind: VolumeSnapshotClass
metadata:
  labels:
    kanister-cloned-from: nutanix-snapshot-class 
  name: k10-clone-nutanix-snapshot-class


  

Userlevel 1

Thank you Hagag. After Manually creating the VolumeSnapshotClass Export phase was completed sucessfully.

Comment