How to backup vms and vm snapshots with velero
This guide provides instructions on how to backup virtual machines and snapshots of the virtualmachines of kubevirt with velero.
Categories:
less than a minute
prerequisites
- a running cluster
- rook-ceph as storage provider
- a s3 storage ( in this case minio)
- a kubevirt vm running in the cluster
in this example minio is used.
step 1: configure velero
veleroValues:
namespace: "velero"
accessKeyId: "minio"
secretAccessKey: "minio123"
backupLocationConfig:
s3Url: "http://10.2.10.110:30090" # nodeport of minio
in the kubeopsctl.yaml:
velero: true
after that you can execute:
kubeopsctl apply -f kubeopsctl.yaml
step 2: check the s3 storage bucket for velero
the bucket for velero ( default velero ) in the s3 storage should be accessible for velero, so check if you have correct rights for writing into the bucket. so in this example we set the bucket to public:

step 3: create backup of namespace
velero backup get
velero backup create kubeops1 --include-namespaces <Namespace of kubevirt vm>
the name backup name must be unique.
then you can check with
velero backup get
velero backup describe kubeops1
velero backup logs kubeops1
after that, you can restore
velero restore get
velero restore create kubeops1 --from-backup kubeops1
the restore name must be unique. you can check the restores with
velero restore get
velero restore create kubeops1 --from-backup kubeops1