Created attachment 1247153 [details] ansible playbook Description of problem: adding disk to VM as bootable fail when there is already disk with the same name There is unclear what should happen: - name: Create disk 1 ovirt_disks: name: myvm_disk1 vm_name: myvm size: 20GiB format: cow interface: virtio bootable: True storage_domain: s1 auth: "{{ovirt_auth}}" first case: - there isn't any disk of name myvm_disk1 in storage s1 - so create it and attach it to vm myvm second case: - in storage s1 is already disk myvm_disk1 (as template or as disk of another VM) but not a disk with that name which is attached to VM myvm - so create a new disk and attach it to VM myvm? !!OR!! - try to add any? all? disk of that name to VM? third case: - in storage s1 is already disk myvm_disk1 (as template or as disk of another VM) and other disk with that name is attached to VM myvm - so based on declarative models of ansible, it should check that disk with that name is already attached to VM myvm? !!OR!! - try to add any? all? disk of that name to VM which isn't attached to VM myvm? - This case is described in attached playbook.yml - run twice Version-Release number of selected component (if applicable): 4.1.0 How reproducible: always with provided playbook Steps to Reproduce: 1. Run attached playbook twice Actual results: Failed with "msg": "Fault reason is \"Operation Failed\". Fault detail is \"[Cannot attach Virtual Disk. Disk myvm_disk1 in VM myvm is already marked as boot.]\". HTTP response code is 409." Additional info: Attached playbook will fail in second run, but it should pass with all ok
Maybe in third case, there is missing a parametr "force" to force create another disk for that VM
Ansible is declarative, so I guess that it doesn't create the disk as it exists already, which is normal. But, I'll let Ondra reply. Anyhow I don't see any high severity here.
Why not open the bug upstream, btw?
I think we should implement force parameter. That's in my opinion all we can do, as user must implement his playbook properly and work with IDs to reliably work with disks.
As agreed please open this issue at github.