Bug 1935073
Summary: | Ansible ovirt_disk module can create disks with conflicting IDs that cannot be removed | ||
---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Juan Orti <jortialc> |
Component: | ovirt-engine | Assignee: | Ahmad Khiet <akhiet> |
Status: | CLOSED ERRATA | QA Contact: | Amit Sharir <asharir> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 4.4.4 | CC: | akhiet, dfodor, eshenitz, mnecas, mperina, sfishbai |
Target Milestone: | ovirt-4.4.6 | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | ovirt-engine-4.4.6.6 | Doc Type: | No Doc Update |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-06-01 13:22:12 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Juan Orti
2021-03-04 10:53:55 UTC
Hi, I can't reproduce this bug using ovirt engine web admin, because if it is backend issue, it should also appear when using webadmin. can you please verify if it is reproducing? or try reproduce it using webadmin? Thank you (In reply to Ahmad Khiet from comment #5) > Hi, > > I can't reproduce this bug using ovirt engine web admin, because if it is > backend issue, it should also appear when using webadmin. > can you please verify if it is reproducing? > or try reproduce it using webadmin? > > > Thank you This bug cannot be reproduced via webadmin, only via REST-API. Hi, I did automation to simulate HTTP calls from ansible modules. I did not face this error or any error creating a shareable disk in iscsi and nfs domains and attach them to 5 virtual machines. can you please verify if it is still reproducing? Ahmad, Please attach the requests you used for the disk creation. Did you try to create 2 disks with the same ID? Hi, finally reproduced. added the same id to the disks as Eyal mentioned in the comment. the error I see is diffrent [697edb29-50bd-4c05-bf26-d276ceb2c984] Command 'org.ovirt.engine.core.bll.storage.disk.image.AddImageFromScratchCommand' failed: CallableStatementCallback; SQL [{call insertimage(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}ERROR: duplicate key value violates unique constraint "pk_images" Detail: Key (image_guid)=(b548366b-fb51-4b41-97be-733c887fe305) already exists. │ │ Where: SQL statement "INSERT INTO images ( │ │ creation_date, │ │ image_guid, │ │ it_guid, │ │ size, │ │ ParentId, │ │ imageStatus, │ │ lastModified, │ │ vm_snapshot_id, │ │ volume_type, │ │ image_group_id, │ │ volume_format, │ │ active, │ │ volume_classification │ │ ) │ │ VALUES ( │ │ v_creation_date, │ │ v_image_guid, │ │ v_it_guid, │ │ v_size, │ │ v_ParentId, │ │ v_imageStatus, │ │ v_lastModified, │ │ v_vm_snapshot_id, │ │ v_volume_type, │ │ v_image_group_id, │ │ v_volume_format, │ │ v_active, │ │ v_volume_classification │ │ )" PL/pgSQL function insertimage(timestamp with time zone,uuid,uuid,bigint,uuid,integer,timestamp with time zone,uuid,integer,integer,uuid,boolean,smallint) line 3 at SQL statement; .... Here's what I used to create the disks : curl --location --request POST 'http://akhiet-vm:8080/ovirt-engine/api/disks' \ --header 'Authorization: Basic ABC' \ --header 'Content-Type: application/xml' \ --data-raw '<disk id="b7a4c6c5-443b-47c5-967f-6abc79675e8b"> <image_id>b548366b-fb51-4b41-97be-733c887fe305</image_id> <storage_domains> <storage_domain id="d14754a2-92c3-4b2d-a2fb-74e20114cbd6"/> </storage_domains> <name>t9</name> <provisioned_size>1048576</provisioned_size> <format>raw</format> <sparse>false</sparse> <shareable>true</shareable> </disk>' Removing needinfo as you managed to reproduce. The issue happens when creating a disk specifying an existing ID. I verified the bug using REST-API calls like mentioned in comment #6. Version for testing : # rpm -q vdsm vdsm-4.40.60.6-1.el8ev.x86_64 # rpm -q ovirt-engine ovirt-engine-4.4.6.6-0.10.el8ev.noarch # rpm -qa | grep release rhv-release-4.4.6-7-001.noarch redhat-release-8.4-0.6.el8.x86_64 redhat-release-eula-8.4-0.6.el8.x86_64 POST API call I used for verification (used it twice in a row with the same paremters): <disk id="[]"> <image_id>"[]"</image_id> <storage_domains> <storage_domain id="[]"/> </storage_domains> <name>"[]"</name> <provisioned_size>"[]"</provisioned_size> <format>raw</format> <sparse>false</sparse> <shareable>true</shareable> </disk> Verification summary and conclusions - After completing the flow mentioned - the expected log output matched the actual log output. When trying to add a disk with the same id as an existing disk I got this error - "Cannot add Virtual Disk. One of the Template Images already exists" (as expected) - this message appeared both in API call response and in the engine.log. Bug verified. 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: RHV Manager security update (ovirt-engine) [ovirt-4.4.6]), 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:2179 |