Bug 2224663 - The VM clone cannot be used as a source for other clonings
Summary: The VM clone cannot be used as a source for other clonings
Keywords:
Status: NEW
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.14.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.15.0
Assignee: sgott
QA Contact: Kedar Bidarkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-21 21:19 UTC by Denys Shchedrivyi
Modified: 2023-08-02 13:01 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CNV-31229 0 None None None 2023-07-21 21:19:53 UTC

Description Denys Shchedrivyi 2023-07-21 21:19:13 UTC
Description of problem:
 
 VM Cloning stuck in RestoreInProgress phase when using recently created VM clone as the source:

> $ oc get vmclone
> NAME               PHASE               SOURCEVIRTUALMACHINE   TARGETVIRTUALMACHINE
> testclone          Succeeded           vm-fedora              vm-fedora-clone
> testclone-cloned   RestoreInProgress   vm-fedora-clone        vm-fedora-clone2


 There is an error in vmrestore events:
> $  oc describe vmrestore
> .
> Events:
>   Type     Reason                      Age                 From                Message
>  Warning  VirtualMachineRestoreError  49s                 restore-controller  VirtualMachineRestore encountered error Operation cannot be fulfilled on virtualmachines.kubevirt.io "vm-fedora-clone2": the object has been modified; please apply your changes to the latest version and try again
>  Warning  VirtualMachineRestoreError  45s (x24 over 51s)  restore-controller  VirtualMachineRestore encountered error error patching VM vm-fedora-clone2: failed to apply patch for VM [
> {"op": "replace", "path": "/spec/template/spec/domain/devices/interfaces/0/macAddress", "value": ""},
> {"op": "replace", "path": "/spec/template/spec/domain/firmware/serial", "value": "new-serial-new"},
> {"op": "remove", "path": "/metadata/annotations/kubevirt.io~1latest-observed-api-version"},
> {"op": "remove", "path": "/metadata/annotations/kubevirt.io~1storage-observed-api-version"},
> {"op": "remove", "path": "/metadata/annotations/restore.kubevirt.io~1lastRestoreUID"},
> {"op": "replace", "path": "/spec/template/spec/domain/firmware/uuid", "value": ""}
> ]: error in remove for path: '/metadata/annotations/kubevirt.io~1latest-observed-api-version': Unable to remove nonexistent key: kubevirt.io/latest-observed-api-version: missing value




Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. create VM
2. Clone VM
3. Clone again using the VM clone as a source

Actual results:
 VM cloning failed

Expected results:
 VM successfully cloned

Additional info:

Comment 1 Denys Shchedrivyi 2023-07-21 22:15:12 UTC
Wanted to add - see this issue only when used `annotationFilters` field in the VirtualMachineClone, e.g.:

apiVersion: clone.kubevirt.io/v1alpha1
kind: VirtualMachineClone
metadata:
  name: testclone-cloned
spec:
  source:
    apiGroup: kubevirt.io
    kind: VirtualMachine
    name: vm-fedora-clone
  target:
    apiGroup: kubevirt.io
    kind: VirtualMachine
    name: vm-fedora-clone2
  annotationFilters:
    - "somekey/*"



 Without `annotationFilters` VM succesfully cloned.


Note You need to log in before you can comment on or make changes to this bug.