What happened:
When attempting to restore a backed-up VM, the restore fails with an error similar to the following: error restoring virtualmachines.kubevirt.io/vms/one: admission webhook "virtualmachine-validator.kubevirt.io" denied the request: Failure to find instancetype: controllerrevisions.apps "node1-o1.large-3ae509a7-5446-4119-945d-1eb2a00d00cb-1" not found
What you expected to happen:
The ControllerRevision is correctly backed up with the VM when a label is specified, and the restore completes successfully.
How to reproduce it (as minimally and precisely as possible):
Create a VM with a VirtualMachineClusterInstanceType or VirtualMachineInstanceType and an identifying label
Back up the VM with Velero, specifying the label. e.g. velero backup create node1-backup --include-namespaces vms -l name=node1 --snapshot-move-data --wait
Delete the backed-up VM kubectl delete vm node1
Attempt to restore the VM velero restore create --from-backup node1-backup
Additional context:
When specifying a label filter, the ControllerRevision resource is not added to the backup, despite being owned by the VirtualMachine resource. Labels applied to the VirtualMachine resource are not propagated down to the ControllerRevision created by KubeVirt.
If the label filter is removed and the entire namespace is backed up, the ControllerRevision resource is included in the backups and subsequently restored successfully..
What happened: When attempting to restore a backed-up VM, the restore fails with an error similar to the following:
error restoring virtualmachines.kubevirt.io/vms/one: admission webhook "virtualmachine-validator.kubevirt.io" denied the request: Failure to find instancetype: controllerrevisions.apps "node1-o1.large-3ae509a7-5446-4119-945d-1eb2a00d00cb-1" not found
What you expected to happen: The
ControllerRevision
is correctly backed up with the VM when a label is specified, and the restore completes successfully.How to reproduce it (as minimally and precisely as possible):
velero backup create node1-backup --include-namespaces vms -l name=node1 --snapshot-move-data --wait
kubectl delete vm node1
velero restore create --from-backup node1-backup
Additional context: When specifying a label filter, the
ControllerRevision
resource is not added to the backup, despite being owned by theVirtualMachine
resource. Labels applied to theVirtualMachine
resource are not propagated down to theControllerRevision
created by KubeVirt.If the label filter is removed and the entire namespace is backed up, the
ControllerRevision
resource is included in the backups and subsequently restored successfully..Environment:
virtctl version
):kubectl version
): N/Auname -a
):Linux node-agent-debug 6.6.33-talos #1 SMP Tue Jun 18 14:02:42 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
talosctl