On Thu, 3 Oct 2019 at 12:45, Gianluca Cecchi <gianluca.cecchi@gmail.com> wrote:
On Thu, Oct 3, 2019 at 6:55 AM Eyal Shenitzky <eshenitz@redhat.com> wrote:
You can use the update_storage_domains action.
According to the action implementation [1], it seems that you need to specify where you want the disk to appear (in which storage domains).

For example:
If the disks already reside on sd1 and you want to copy it to sd2, you need to specify both sd1 and sd2.




--
Regards,
Eyal Shenitzky


I can try, thanks.
But is it supported on block based storage such as iSCSI or FC?
I see this in your [1] above
"
# We don't support move&copy for non file based storages:
if disk.storage_type != otypes.DiskStorageType.IMAGE:
    return changed
"

Disk type IMAGE is the term for both Block and File-based disks.
So I guess that there is a problem with the documentation.


Also it is not clear in my opinion the action connected to the different "state" possibilities: present/absent/attached/detached
In web admin gui I can have a disk active on a VM and I can:

- deactivate the disk 
I see red down arrow for the disk that remains associated with the VM

- remove the disk
a) remove permanently removes the disk from storage
b) if I don't select "remove permanently" the disk goes into the floating disks list

How do they map with Ansible module state options?

You can have a look at the 'example' section to get more information on the supported actions.

 

Gianluca 
Gianluca




--
Regards,
Eyal Shenitzky