Bug 1954017

Summary: VM Rename causes loss of data when a VM defines dataVolumeTemplates
Product: Container Native Virtualization (CNV) Reporter: Omer Yahud <oyahud>
Component: VirtualizationAssignee: Omer Yahud <oyahud>
Status: CLOSED ERRATA QA Contact: Israel Pinto <ipinto>
Severity: high Docs Contact:
Priority: high    
Version: 2.6.0CC: cnv-qe-bugs, fdeutsch, ibezukh, kbidarka, sgott, ycui, yzamir
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-operator-container-v4.8.0-60 hco-bundle-registry-container-v4.8.0-375 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 14:30:44 UTC 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 Omer Yahud 2021-04-27 12:58:10 UTC
Description of problem:
During a rename process of a VM, a VM is deleted and created with a new name, in the case of VMs with dataVolumeTemplate defined, the backing DV/PVC are also removed and the data of the VM is lost.

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


How reproducible:
100%

Steps to Reproduce:
1.Create a VM that defines a dataVolumeTemplate (clone from an existing PVC)
2.Make persistent changes to the VM (create a file)
3.Rename the VM and notice that the created file is gone (a new DV has cloned the existing PVC again)

Actual results:
VM data is lost

Expected results:
VM data should remain intact

Comment 2 sgott 2021-06-07 11:59:01 UTC
VM rename option has been removed entirely. To verify, ensure vm rename option doesn't exist.

Comment 4 sgott 2021-06-14 12:02:14 UTC
This BZ failed QE because the rename endpoint was removed fromt he api, but the option to rename appears to still be present in the client.

Comment 6 Igor Bezukh 2021-06-14 12:17:42 UTC
Hi,

According to the output of the virtctl you've used, it's code was based on a Git commit from 15th of April, while the VM rename removal was merged only on May the 7th.

This is why you still could invoke the rename command.

I've took the latest virtctl build from Brew, using think link: https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1625638

The issue is being resolved there.

If you confirm, please move the bug to ON_QA

TIA
Igor

Comment 7 sgott 2021-07-07 12:11:56 UTC
Kedar, I think this is already fixed in 4.8.0, can you please verify the client change is present?

Comment 8 Kedar Bidarkar 2021-07-08 17:50:46 UTC
Tested With Package version: kubevirt-virtctl-4.8.0-226.el8.x86_64.rpm

]$ virtctl --help 
virtctl controls virtual machine related operations on your kubernetes cluster.

Available Commands:
  addvolume    add a volume to a running VM
  console      Connect to a console of a virtual machine instance.
  expose       Expose a virtual machine instance, virtual machine, or virtual machine instance replica set as a new service.
  fslist       Return full list of filesystems available on the guest machine.
  guestosinfo  Return guest agent info about operating system.
  help         Help about any command
  image-upload Upload a VM image to a DataVolume/PersistentVolumeClaim.
  migrate      Migrate a virtual machine.
  pause        Pause a virtual machine
  removevolume remove a volume from a running VM
  restart      Restart a virtual machine.
  start        Start a virtual machine.
  stop         Stop a virtual machine.
  unpause      Unpause a virtual machine
  userlist     Return full list of logged in users on the guest machine.
  version      Print the client and server version information.
  vnc          Open a vnc connection to a virtual machine instance.

---

Summary: We no longer have the "rename" option while we do "virtctl --help"

Tested this with 4.8.0 virtctl package.

Moving this bug to 4.8.0 and also marking this as VERIFIED.

Comment 11 errata-xmlrpc 2021-07-27 14:30:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 4.8.0 Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2920