Bug 2227933

Summary: VM with Instancetype can't be cloned
Product: Container Native Virtualization (CNV) Reporter: Denys Shchedrivyi <dshchedr>
Component: VirtualizationAssignee: sgott
Status: NEW --- QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: high    
Version: 4.14.0   
Target Milestone: ---   
Target Release: 4.15.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Denys Shchedrivyi 2023-07-31 20:54:58 UTC
Description of problem:
 Can't clone the VM with instance type. vmclone object stuck in `RestoreInProgress` state:

> $ oc get vmclone
> NAME                 PHASE               SOURCEVIRTUALMACHINE   TARGETVIRTUALMACHINE
> clone-instancetype   RestoreInProgress   vm-fedora-csmall       vm-fedora-csmall-clone


 and there is an error message  about conflict in vmrestore:

> $ oc describe vmrestore
>  ----     ------                      ----                   ----                -------
>  Warning  VirtualMachineRestoreError  2m34s (x17 over 8m7s)  restore-controller  VirtualMachineRestore encountered error admission webhook "virtualmachine-validator.kubevirt.io" denied the request: VM field conflicts with selected Instancetype, VM field conflicts with selected Instancetype, VM field conflicts with selected Instancetype, VM field conflicts with selected Instancetype


 The used Instancetype:

apiVersion: instancetype.kubevirt.io/v1beta1
kind: VirtualMachineInstancetype
metadata:
  creationTimestamp: "2023-07-31T20:31:42Z"
  generation: 1
  name: csmall
  namespace: default
  resourceVersion: "381097"
  uid: d22d6d0e-6eb0-4f7a-9ab9-0066cd677a43
spec:
  cpu:
    guest: 1
  memory:
    guest: 1Gi





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


How reproducible:


Steps to Reproduce:
1. create instancetype
2. create VM with this instancetype
3. clone VM

Actual results:
 VM failed to clone

Expected results:
 VM successfully cloned

Additional info: