Closed Akasurde closed 4 years ago
Corresponding reverted commit in this repository: 29363bb1cf77246bec2afc656a3c6ea05f6f10f9
Hi @n0p90,
Done some investigation and I was able to reproduce it only when the disk name was not matching the cd_iso
.
Are you sure that the disk name is the same?
Do you have multiple disks with the same name?
Thing is that I did not use the ovirt-iso-uploader
but uploaded directly to the iso domain.
(tested on oVirt 4.4.1)
Hello @mnecas,
Thanks a lot for your response.
As far as I can tell, in oVirt 4.3 it's not possible to upload an image to an ISO storage domain through the web interface. I can only upload an image to Data domains through the web interface and have to use the ovirt-iso-uploader
utility on the hosted engine to upload to ISO domains.
Maybe this changed in oVirt 4.4? Or are you uploading to a storage with "Domain Type = Data" and not "Domain Type = ISO"?
I only have one disk with this name. That's the reason why I was using an ISO storage domain instead of a Data one, this way a single ISO can be shared between multiple data centers.
The only workaround I found to make it work in oVirt 4.3 with the current ovirt_vm
module is to:
cd_iso
to include the ISO by ID, such that this ID matches the ISO in the data center where the VM is deployedMaybe this changed in oVirt 4.4? Or are you uploading to storage with "Domain Type = Data" and not "Domain Type = ISO"?
I have tried both Data and ISO and no issues and don't think that the upload method has any effect.
Good thinking to use the disk ID.
Checking code and can't see anything :(
Here you can see filter from all disks to get only those with a specific name
https://github.com/oVirt/ovirt-ansible-collection/blob/fbc54047075334e2839d44c929f7d0b71e1564aa/plugins/modules/ovirt_vm.py#L1665
If you could rerun it but add to the module before it fails raise Exception(disks)
disks
is an empty list. The module is crashing here:
https://github.com/oVirt/ovirt-ansible-collection/blob/fbc54047075334e2839d44c929f7d0b71e1564aa/plugins/modules/ovirt_vm.py#L1671
The get
call results in a API GET request to /disks/centos-8.2.iso
which returns a 404.
The underlying problem is that the new code is using the disks_service
to get a list of ISO. This only returns the ISOs stored in storage domains with "Domain Type = Data", not the ones in "Domain Type = ISO".
To visually confirm that: ISO stored in ISO domains are not visible on https://ovirt.example.org/ovirt-engine/webadmin/#disks, only the ones stored in Data domains are visible.
ISO stored in ISO domains iso_storage
are visible on https://ovirt.example.org/ovirt-engine/webadmin/#storage-images;name=iso_storage
Looks like a difference between 4.3 and 4.4. In 4.4 I can see the disks from Domain Type ISO under https://ovirt.example.org/ovirt-engine/webadmin/#disks (will look into that later if I have an issue in env or it's by design).
Thanks a lot now I know what the issue was!
From @n0p90 on Jul 09, 2020 22:03
SUMMARY
Module
ovirt_vm
crashes with the error HTTP response code is 404 when starting a VM with an attached ISO provided by name through thecd_iso
parameter.Reverting commit 23761b98801ff6891d38af32d961daba1baf1bce fixes the issue.
ISSUE TYPE
COMPONENT NAME
cd_iso
parameter of theovirt_vm
moduleANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Upload an ISO to
iso_storage
storage domain (Domain Type: ISO, Storage Type: NFS):EXPECTED RESULTS
The VM boots correctly using the provided ISO image.
ACTUAL RESULTS
The play crashes with the following stack trace:
Copied from original issue: ansible/ansible#70547