Created attachment 1247153 [details]
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
- there isn't any disk of name myvm_disk1 in storage s1
- so create it and attach it to vm myvm
- 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?
- try to add any? all? disk of that name to VM?
- 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?
- 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):
always with provided playbook
Steps to Reproduce:
1. Run attached playbook twice
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."
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
As agreed please open this issue at github.