Description of problem: I hit an issue today when using ansible to manage oVirt templates, which was caused by a typo. I effectively created a template in one datacenter with a disk in another one. Version-Release number of selected component (if applicable): python-ovirt-engine-sdk4-4.2.6-2.el7.centos.x86_64 ansible-2.5.3-1.el7.noarch How reproducible: Always Steps to Reproduce: 1. set up oVirt 4.2 with two datacenters (local storage in my case): dc1 (master storage domain dc1_local, cluster dc1) dc2 (master storage domain dc2_local, cluster dc2) 2. create an ansible playbook to import a template from Glance and specify a cluster: dc1 and storage_domain: dc2_local 3. run the playbook Actual results: Playbook runs fine, resulting in a template in dc1 whose disk resides in dc2 Expected results: Playbook errors out as there is no storage domain dc2_local in dc1 Additional info: The problem may be much deeper since the ovirt-engine API should not allow for such a template to be defined. May need to re-assign this to the proper component after finding the root cause. Here's the playbook snippet I used: - name: Import glance image as template ovirt_templates: auth: "{{ ovirt_auth }}" state: imported name: fc28-cloud-test image_disk: "Fedora 28 Cloud Base Image v1.1 for x86_64" template_image_disk_name: fc28-cloud-sda image_provider: ovirt-image-repository storage_domain: "dc2_local" cluster: "dc1" Also a note: now I cannot delete the template since the DC it is assigned to obviously can't remove the disk from another DC's storage.
The problem is in ImportRepoImageCommand:validate. We need to check there wheter specified storage domain is in specified datacenter and if not fail.
It's still possible create template in <datacenter_1> with disk on storage domain in <datacenter_2> Tested: python-ovirt-engine-sdk4-4.3.2-1.el7ev.x86_64 (older but I think that version of SDK doesn't matter) and 4.3.5.4-0.1.el7 used task from ansible as is mentioned in comment #0 Also it's not possible delete template: fc28-cloud-test: Cannot remove Template. Storage Domain doesn't exist.
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020. Since the problem described in this bug report should be resolved in oVirt 4.4.0 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.