Hi,
I am about to write a new cloud volume module for Packet Host, and I was researching how the volume attachment should be handled.
I assume a simple scenario: you have a server running in some cloud provider, and you create a volume in the provider, and then you want to attach the volume to the running server. You then want to do it with Ansible.
The way the volume is attached varies greatly in the cloud volume modules. I identified following distinct approaches:
-
volume module has state: present, absent, <something_weird>; and optional instance_id parameter (which can be omitted). The attachment is handled based on the value(s) in the instance_id param. examples: http://docs.ansible.com/ansible/ec2_vol_module.html, http://docs.ansible.com/ansible/gce_pd_module.html,
-
volume module has state present, absent, attached, detached; e.g.http://docs.ansible.com/ansible/cs_volume_module.html
-
there is an extra module for volume attachment, e.g. http://docs.ansible.com/ansible/profitbricks_volume_attachments_module.html, http://docs.ansible.com/ansible/rax_cbs_attachments_module.html, http://docs.ansible.com/ansible/os_server_volume_module.html
-
the volume module has optional “command” parameter with enums attach|detach, e.g. http://docs.ansible.com/ansible/digital_ocean_block_storage_module.html
I don’t intend to make order in this, and I don’t complain about it. I would just like to ask the maintainers which approach they prefer for new cloud volume module.
Which of those cloud volume modules I should follow when writing new one?
Thanks for answering,
Tomas Karasek