Bug 1565979 - REST-API: GET diskattachments for a vm is missing an attachment of a snapshot disk (that is attached to another vm)
Summary: REST-API: GET diskattachments for a vm is missing an attachment of a snapshot...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.2.2.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.2.3
: ---
Assignee: shani
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-11 08:45 UTC by Natalie Gavrielov
Modified: 2018-04-22 11:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-22 11:10:37 UTC
oVirt Team: Storage
rule-engine: ovirt-4.2+
rule-engine: blocker+


Attachments (Terms of Use)
logs: engine, vdsm, server (2.95 MB, application/zip)
2018-04-11 08:45 UTC, Natalie Gavrielov
no flags Details
engine.log, art_log.log (1.63 MB, application/zip)
2018-04-22 09:37 UTC, Natalie Gavrielov
no flags Details

Description Natalie Gavrielov 2018-04-11 08:45:57 UTC
Created attachment 1420234 [details]
logs: engine, vdsm, server

Description of problem:
GET diskattachments is missing an attachment of a snapshot disk (that is attached to another vm).

Version-Release number of selected component:
rhvm-4.2.2.6-0.1.el7.noarch
vdsm-4.20.23-1.el7ev.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a vm, with 1 disk, and create a snapshot.
2. Create a second vm (backup vm) with 2 disks (no snapshot)
3. Attach the snapshot disk of the source vm (from step 1) to the backup vm (from step 2)
4. Start vms
4. Get disk attachments for the backup vm.

Actual results:
The output for https://ovirt-_engine/ovirt-engine/api/vms/1c1d8786-0853-4daf-bb37-528383c4f892/diskattachments shows only 2 disk attachments.
The missing disk attachment is for the disk that is attached to both vms.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<disk_attachments>
  <disk_attachment href="/ovirt-engine/api/vms/1c1d8786-0853-4daf-bb37-528383c4f892/diskattachments/fac03be5-2da2-46fe-abfb-f42e5bbbecc1" id="fac03be5-2da2-46fe-abfb-f42e5bbbecc1">
    <active>true</active>
    <bootable>true</bootable>
    <interface>virtio</interface>
    <logical_name>/dev/vda</logical_name>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/fac03be5-2da2-46fe-abfb-f42e5bbbecc1" id="fac03be5-2da2-46fe-abfb-f42e5bbbecc1" />
    <vm href="/ovirt-engine/api/vms/1c1d8786-0853-4daf-bb37-528383c4f892" id="1c1d8786-0853-4daf-bb37-528383c4f892" />
  </disk_attachment>
  <disk_attachment href="/ovirt-engine/api/vms/1c1d8786-0853-4daf-bb37-528383c4f892/diskattachments/fd994388-be5f-4195-bc42-cf91eec16a9d" id="fd994388-be5f-4195-bc42-cf91eec16a9d">
    <active>true</active>
    <bootable>false</bootable>
    <interface>virtio</interface>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/fd994388-be5f-4195-bc42-cf91eec16a9d" id="fd994388-be5f-4195-bc42-cf91eec16a9d" />
    <vm href="/ovirt-engine/api/vms/1c1d8786-0853-4daf-bb37-528383c4f892" id="1c1d8786-0853-4daf-bb37-528383c4f892" />
  </disk_attachment>
  <disk_attachment href="/ovirt-engine/api/vms/1c1d8786-0853-4daf-bb37-528383c4f892/diskattachments/310a2504-d992-4c0d-8373-9fee4b2aeca7" id="310a2504-d992-4c0d-8373-9fee4b2aeca7">
    <active>true</active>
    <bootable>false</bootable>
    <interface>virtio</interface>
    <logical_name>/dev/vdb</logical_name>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/310a2504-d992-4c0d-8373-9fee4b2aeca7" id="310a2504-d992-4c0d-8373-9fee4b2aeca7" />
    <vm href="/ovirt-engine/api/vms/1c1d8786-0853-4daf-bb37-528383c4f892" id="1c1d8786-0853-4daf-bb37-528383c4f892" />
  </disk_attachment>
</disk_attachments>  

Expected results:
should have 3 disk attachments, including the disk that's attached to both vms.

Additional info:
- 4.1 regression
- UI shows that backup vm has 3 disks, (one of them is attached to the source vm) which is correct.

- output for lsblk on the vm that supposed to have 3 disk attachments:
NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                  11:0    1 1024M  0 rom
vda                 252:0    0   10G  0 disk
|-vda1              252:1    0  700M  0 part
|-vda2              252:2    0    1G  0 part
`-vda3              252:3    0  8.3G  0 part
  `-VolGroup01-root 253:0    0  8.3G  0 lvm  /
vdb                 252:16   0   10G  0 disk
vdc                 252:32   0   10G  0 disk
|-vdc1              252:33   0  700M  0 part /boot
|-vdc2              252:34   0    1G  0 part [SWAP]
`-vdc3              252:35   0  8.3G  0 part

- The output of disk attachments of the source vm (step 1)
https://ovirt_engine/ovirt-engine/api/vms/9d0de8d6-0d9c-4555-b027-8649f5bf71c1/diskattachments

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<disk_attachments>
  <disk_attachment href="/ovirt-engine/api/vms/9d0de8d6-0d9c-4555-b027-8649f5bf71c1/diskattachments/fd994388-be5f-4195-bc42-cf91eec16a9d" id="fd994388-be5f-4195-bc42-cf91eec16a9d">
    <active>true</active>
    <bootable>true</bootable>
    <interface>virtio</interface>
    <logical_name>/dev/vda</logical_name>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/fd994388-be5f-4195-bc42-cf91eec16a9d" id="fd994388-be5f-4195-bc42-cf91eec16a9d" />
    <vm href="/ovirt-engine/api/vms/9d0de8d6-0d9c-4555-b027-8649f5bf71c1" id="9d0de8d6-0d9c-4555-b027-8649f5bf71c1" />
  </disk_attachment>
</disk_attachments>

Comment 1 Red Hat Bugzilla Rules Engine 2018-04-11 13:36:53 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 3 Natalie Gavrielov 2018-04-22 09:37:14 UTC
Created attachment 1425291 [details]
engine.log, art_log.log

from art_log.log:
2018-04-22 : - MainThread - diskattachments - DEBUG - CREATE request content is --  url:/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381/diskattachments body:<disk_attachment id="fa13ce2b-d12c-43f7-95c5-3381ee307942">
    <active>true</active>
    <interface>virtio</interface>
    <disk id="fa13ce2b-d12c-43f7-95c5-3381ee307942">
        <snapshot id="32152584-e176-4eda-aabc-22462f02a9b3"/>
    </disk>
</disk_attachment>
</disk_attachments>

*Before* starting the VMs:

backup_vm_TestCase6169_2212094949:

<disk_attachments>
  <disk_attachment href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381/diskattachments/929c12ed-abfb-4075-af74-36e64aa31222" id="929c12ed-abfb-4075-af74-36e64aa31222">
    <active>true</active>
    <bootable>true</bootable>
    <interface>virtio</interface>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/929c12ed-abfb-4075-af74-36e64aa31222" id="929c12ed-abfb-4075-af74-36e64aa31222" />
    <vm href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381" id="89ff2a96-fca3-44b2-ab8c-4c3edaef4381" />
  </disk_attachment>
  <disk_attachment href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381/diskattachments/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942">
    <active>true</active>
    <bootable>false</bootable>
    <interface>virtio</interface>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942" />
    <vm href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381" id="89ff2a96-fca3-44b2-ab8c-4c3edaef4381" />
  </disk_attachment>
  <disk_attachment href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381/diskattachments/373b6035-694a-4c36-92a6-6fadae82c2e4" id="373b6035-694a-4c36-92a6-6fadae82c2e4">
    <active>true</active>
    <bootable>false</bootable>
    <interface>virtio</interface>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/373b6035-694a-4c36-92a6-6fadae82c2e4" id="373b6035-694a-4c36-92a6-6fadae82c2e4" />
    <vm href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381" id="89ff2a96-fca3-44b2-ab8c-4c3edaef4381" />
  </disk_attachment>


source_vm_TestCase6169_2212073511:

<disk_attachments>
  <disk_attachment href="/ovirt-engine/api/vms/0744f5dc-7af6-4ba8-a4d4-e0a1ef0960d7/diskattachments/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942">
    <active>true</active>
    <bootable>true</bootable>
    <interface>virtio</interface>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942" />
    <vm href="/ovirt-engine/api/vms/0744f5dc-7af6-4ba8-a4d4-e0a1ef0960d7" id="0744f5dc-7af6-4ba8-a4d4-e0a1ef0960d7" />
  </disk_attachment>
</disk_attachments>

*After* starting the VMs:

backup_vm_TestCase6169_2212094949:
<disk_attachments>
  <disk_attachment href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381/diskattachments/929c12ed-abfb-4075-af74-36e64aa31222" id="929c12ed-abfb-4075-af74-36e64aa31222">
    <active>true</active>
    <bootable>true</bootable>
    <interface>virtio</interface>
    <logical_name>/dev/vda</logical_name>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/929c12ed-abfb-4075-af74-36e64aa31222" id="929c12ed-abfb-4075-af74-36e64aa31222" />
    <vm href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381" id="89ff2a96-fca3-44b2-ab8c-4c3edaef4381" />
  </disk_attachment>
  <disk_attachment href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381/diskattachments/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942">
    <active>true</active>
    <bootable>false</bootable>
    <interface>virtio</interface>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942" />
    <vm href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381" id="89ff2a96-fca3-44b2-ab8c-4c3edaef4381" />
  </disk_attachment>
  <disk_attachment href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381/diskattachments/373b6035-694a-4c36-92a6-6fadae82c2e4" id="373b6035-694a-4c36-92a6-6fadae82c2e4">
    <active>true</active>
    <bootable>false</bootable>
    <interface>virtio</interface>
    <logical_name>/dev/vdb</logical_name>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/373b6035-694a-4c36-92a6-6fadae82c2e4" id="373b6035-694a-4c36-92a6-6fadae82c2e4" />
    <vm href="/ovirt-engine/api/vms/89ff2a96-fca3-44b2-ab8c-4c3edaef4381" id="89ff2a96-fca3-44b2-ab8c-4c3edaef4381" />
  </disk_attachment>
</disk_attachments>

source_vm_TestCase6169_2212073511:
https://storage-ge-09.scl.lab.tlv.redhat.com/ovirt-engine/api/vms/0744f5dc-7af6-4ba8-a4d4-e0a1ef0960d7/diskattachments
<disk_attachments>
  <disk_attachment href="/ovirt-engine/api/vms/0744f5dc-7af6-4ba8-a4d4-e0a1ef0960d7/diskattachments/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942">
    <active>true</active>
    <bootable>true</bootable>
    <interface>virtio</interface>
    <logical_name>/dev/vda</logical_name>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/fa13ce2b-d12c-43f7-95c5-3381ee307942" id="fa13ce2b-d12c-43f7-95c5-3381ee307942" />
    <vm href="/ovirt-engine/api/vms/0744f5dc-7af6-4ba8-a4d4-e0a1ef0960d7" id="0744f5dc-7af6-4ba8-a4d4-e0a1ef0960d7" />
  </disk_attachment>
</disk_attachments>

Comment 4 Natalie Gavrielov 2018-04-22 11:10:37 UTC
Noticing now that the issue is not a missing disk attachment, it is a missing logical name for the snapshot disk.
Closing this one and opening a new one for the missing logical name issue.


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