This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2248091 - Creating virtual machine may incorrectly use already existing PVC in the namespace
Summary: Creating virtual machine may incorrectly use already existing PVC in the name...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.13.5
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
: ---
Assignee: Tal Nisan
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-06 05:16 UTC by nijin ashok
Modified: 2023-11-08 02:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 02:27:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   CNV-34877 0 None None None 2023-11-08 02:27:28 UTC

Description nijin ashok 2023-11-06 05:16:00 UTC
Description of problem:

The namespace was already having a PVC named mytestvm:

~~~
# oc get pvc mytestvm
NAME       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                           AGE
mytestvm   Bound    pvc-9049ae50-3cfc-4b4a-9504-e65eb5dca2e1   10Gi       RWO            ocs-external-storagecluster-ceph-rbd   13m
~~~

Then created a new VM "mytestvm" from the OpenShift Console (Virtual machines => Create => From template => select a template => Quick create virtual machine). The VM was created with the above PVC:

~~~
oc get pod virt-launcher-mytestvm-slzxl -o json |jq '.spec.volumes[7]'
{
  "name": "rootdisk",
  "persistentVolumeClaim": {
    "claimName": "mytestvm"
  }
}
~~~

By default, the generated PVC name is the same as the VM name. However, there is no validation that the PVC already exists and is being used. 


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

OpenShift Virtualization   4.13.5

How reproducible:

100%

Steps to Reproduce:

1. Create a PVC.
2. Create a VM with the same name as of above PVC.
3. The PVC in [1] was attached to the new VM as rootdisk.

Actual results:

Creating a virtual machine may incorrectly use already existing PVC in the namespace

Expected results:

I think it should generate a new name for the PVC if there is already an existing PVC with the same name.

Additional info:


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