Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1624910

Summary: REST: run once VM with an attached ISO file that resides on a data domain fails on validation error that active ISO domain is missing
Product: [oVirt] ovirt-engine Reporter: Elad <ebenahar>
Component: RestAPIAssignee: Fedor Gavrilov <fgavrilo>
Status: CLOSED NOTABUG QA Contact: Elad <ebenahar>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.6.2CC: bugs, ebenahar, fkust, frolland, tnisan
Target Milestone: ovirt-4.3.3Keywords: Automation
Target Release: ---Flags: rule-engine: ovirt-4.3+
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-21 09:59:45 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:
Attachments:
Description Flags
logs none

Description Elad 2018-09-03 14:54:30 UTC
Created attachment 1480576 [details]
logs

Description of problem:
Via REST, An attempt to run once a VM with an attached ISO file that resides on a data domain, fails with a conflict message that there is no active ISO domain.
See bug 1554117 for webadmin fix.


Version-Release number of selected component (if applicable):
ovirt-engine-4.2.6.5-0.0.master.20180829082211.git3013edd.el7.noarch
vdsm-4.20.39-5.giteee4cd2.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Upload an ISO file to a data domain
2. Via REST, run once a VM with this ISO file 

Request:

2018-09-03 17:39:52,027 - MainThread - vms - DEBUG - Action request content is --  url:/ovirt-engine/api/vms/7e46806a-b586-4a01-98ca-4374dcabf1c9/start body:<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <use_cloud_init>false</use_cloud_init>
    <use_sysprep>false</use_sysprep>
    <vm>
        <os>
            <boot>
                <devices>
                    <device>cdrom</device>
                </devices>
            </boot>
        </os>
        <cdroms>
            <cdrom>
                <file id="disk_raw_0317222646"/>
            </cdrom>
        </cdroms>
    </vm>
</action>



Actual results:
Response:

2018-09-03 17:39:52,027 - MainThread - vms - INFO - Using Correlation-Id: vms_syncAction_ced94877-7358-42c3
2018-09-03 17:39:53,846 - MainThread - vms - DEBUG - Cleaning Correlation-Id: vms_syncAction_ced94877-7358-42c3
2018-09-03 17:39:53,847 - MainThread - api_utils - ERROR - Failed to syncAction element NOT as expected:
        Status: 409
        Reason: Conflict
        Detail: [Cannot run VM with attached CD without an active ISO domain.
Alternatives:
- Attach an ISO Domain (to enable CD operations).
- Change the boot sequence, using the Edit VM command (Boot Sub-Tab).
- Select a different boot device (using the 'Run Once' command).]

2018-09-03 17:39:53,849 - MainThread - vms - ERROR - Response code is not valid, expected is: [200, 201], actual is: 409


Expected results:
Run once VM with ISO file that resides on a data domain should succeed via REST


Additional info:
Logs

Comment 1 Fedor Gavrilov 2019-02-15 13:53:11 UTC
Elad, currently this does not reproduce for me.

To make sure there is no misunderstanding, here is my setup:
Freshly installed host and engine, both from yesterday's master branch, the only ISO image resides on an only domain (not counting ovirt-image-repository):
domain type: Data (Master)
storage type: NFS
I run the reproducer and I get 200 OK, VM status changes to running in web UI, everything seems fine.
I ran debug and it seems that storagePoolIsoMapDao.get(new StoragePoolIsoMapId(domainId, vm.getStoragePoolId())) in RunVMValidator that previously was either null or non active now returns active as it should.

So, I guess, nothing to fix here anymore?

Comment 2 Elad 2019-02-18 12:14:33 UTC
Is the ISO file residing on a data domain?

Comment 3 Elad 2019-03-06 15:47:01 UTC
Using ovirt-engine-4.3.1.1-0.1.el7.noarch, still impossible to run once a VM with ISO that resides on a data domain, using REST:

====================
Request:

url:/ovirt-engine/api/vms/881ba627-96af-42fd-809d-7de3475c8736/start body:<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <use_cloud_init>false</use_cloud_init>
    <use_sysprep>false</use_sysprep>
    <vm>
        <os>
            <boot>
                <devices>
                    <device>cdrom</device>
                </devices>
            </boot>
        </os>
        <cdroms>
            <cdrom>
                <file id="cirunner.iso"/>
            </cdrom>
        </cdroms>
    </vm>
</action>


===========================
Response:

        Status: 409
        Reason: Conflict
        Detail: [Cannot run VM with attached CD without an active ISO domain.
Alternatives:
- Attach an ISO Domain (to enable CD operations).
- Change the boot sequence, using the Edit VM command (Boot Sub-Tab).
- Select a different boot device (using the 'Run Once' command).]

Comment 4 Tal Nisan 2019-03-13 13:36:32 UTC
Elad, to choose an ISO file for a CDROM that resides on a data domain, you have to specify in the request the UUID of the data disk containing the ISO image (as file names are not unique), if you supply a file name this refers to the old API and the image that Engine will attempt to attach as CDROM will be from the ISO domain, please verify again by running once with the UUID and see if that works, if so please close the bug as it is an expected behavior

Comment 5 Elad 2019-03-21 09:59:45 UTC
Correct, with image UUID it works, thanks for the clarification. 
Closing the bug