Bug 2253217

Summary: Cloning PVC autofills wrong size
Product: Container Native Virtualization (CNV) Reporter: joherr
Component: User ExperienceAssignee: Tal Nisan <tnisan>
Status: CLOSED MIGRATED QA Contact: Guohua Ouyang <gouyang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.14.0CC: ycui
Target Milestone: ---   
Target Release: ---   
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: 2023-12-07 06:21:57 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:
Attachments:
Description Flags
screenshot of cloning dialog none

Description joherr 2023-12-06 14:40:49 UTC
Description of problem:
When cloning a PVC of 60GiB size, the system autofills the remote size to be 8192 PeB. This size cannot be changed in the UI before starting the clone.

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

How reproducible:
always

Steps to Reproduce:
1.Create a VM with a PVC of 60Gib
2.Power off the VM
3.As a cluster admin, clone the 60GiB PVC

Actual results:
The system tries to clone the 60 GiB PVC as a 8192 PeB

Expected results:
A new pvc of the 60 GiB

Additional info:

This seems like the closed BZ 2177979.

I will upload a screenshot of the UI.
Here is the yaml for the original pvc.

```
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    cdi.kubevirt.io/storage.bind.immediate.requested: "true"
    cdi.kubevirt.io/storage.contentType: kubevirt
    cdi.kubevirt.io/storage.pod.phase: Succeeded
    cdi.kubevirt.io/storage.populator.progress: 100.0%
    cdi.kubevirt.io/storage.preallocation.requested: "false"
    cdi.kubevirt.io/storage.usePopulator: "true"
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
    volume.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
  creationTimestamp: "2023-12-05T17:34:19Z"
  finalizers:
  - kubernetes.io/pvc-protection
  - provisioner.storage.kubernetes.io/cloning-protection
  labels:
    app: containerized-data-importer
    app.kubernetes.io/component: storage
    app.kubernetes.io/managed-by: cdi-controller
    app.kubernetes.io/part-of: hyperconverged-cluster
    app.kubernetes.io/version: 4.14.0
    kubevirt.io/created-by: 60f46f91-2db3-4118-aaba-b1697b29c496
  name: win2k19-base
  namespace: base-images
  ownerReferences:
  - apiVersion: cdi.kubevirt.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: DataVolume
    name: win2k19-base
    uid: 8980e7b7-ce0b-47b4-a7e4-f4c79e984ebe
  resourceVersion: "697047"
  uid: fccb0aa9-8541-4b51-b49e-ddceaa22b68c
spec:
  accessModes:
  - ReadWriteMany
  dataSource:
    apiGroup: cdi.kubevirt.io
    kind: VolumeImportSource
    name: volume-import-source-8980e7b7-ce0b-47b4-a7e4-f4c79e984ebe
  dataSourceRef:
    apiGroup: cdi.kubevirt.io
    kind: VolumeImportSource
    name: volume-import-source-8980e7b7-ce0b-47b4-a7e4-f4c79e984ebe
  resources:
    requests:
      storage: "64424509440"
  storageClassName: ocs-storagecluster-ceph-rbd
  volumeMode: Block
  volumeName: pvc-dbfc9fe9-5677-469d-9402-c2f3a22dab3f
status:
  accessModes:
  - ReadWriteMany
  capacity:
    storage: 60Gi
  phase: Bound
```

Here is the yaml for the cloning pvc.

```
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    volume.beta.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
    volume.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
  creationTimestamp: "2023-12-06T14:24:07Z"
  finalizers:
  - kubernetes.io/pvc-protection
  name: win2k19-base-clone
  namespace: base-images
  resourceVersion: "1551054"
  uid: f72665c3-6408-4129-82a2-e663d8ecc0cc
spec:
  accessModes:
  - ReadWriteMany
  dataSource:
    apiGroup: ""
    kind: PersistentVolumeClaim
    name: win2k19-base
  dataSourceRef:
    apiGroup: ""
    kind: PersistentVolumeClaim
    name: win2k19-base
  resources:
    requests:
      storage: "9223372036854775807"
  storageClassName: ocs-storagecluster-ceph-rbd
  volumeMode: Block
status:
  phase: Pending
```

Comment 1 joherr 2023-12-06 14:43:44 UTC
Created attachment 2002922 [details]
screenshot of cloning dialog

This is a screenshot of the UI cloning dialog. The size of the original PVC seems to be converted to bytes and the dropdown is set to Tib. Neither of these can be changed in the UI, they are greyed out.

Comment 2 Ying Cui 2023-12-07 06:21:57 UTC
Close the bug as UI already moved to jira bug CNV-36169 for bug management.