cloudscale-ch / ansible-collection-cloudscale

cloudscale.ch Ansible Collection
https://galaxy.ansible.com/cloudscale_ch/cloud
GNU General Public License v3.0
7 stars 3 forks source link

Allow adding additional volumes during server creation #60

Closed nerrehmit closed 1 year ago

nerrehmit commented 3 years ago

We would like to be able to add several disks to a newly created server right at the start, similar to how it is possible with the API.

If I read it correctly the ansible module currently supports adding an additional bulk volume via the bulk_volume_size_gb param.

However adding 2+ bulk volumes or any additional ssd volume besides the root volume is not possible.

Our current workaround is to add the desired disks right after the server creation with the volume module, but we are looking to simplify the setup. Because of the well established workaround this is not a high priority issue for us.

href commented 3 years ago

Thank you for your request.

This is something we have considered adding before, but we are currently unconvinced that it would be a good change. Neither for the Ansible module, nor for the official API it ultimately calls.

Volumes are increasingly used as a place for storage that is independent of the virtual servers attached to it. That is, volumes may be moved, and one day might even be attached to multiple servers at the same time.

Adding complexity to the server module (or /v1/servers API call), is therefore a road that will only get us so far.

Instead we recommend to create volumes as separate objects in Ansible (as you currently do), and to attach them to the server in a separate step. You can even create the volumes first, then attach them to the server after it has been created.

We feel that this is the right way, as it allows you change the volume at a later time. Though it's not unthinkable that this could be done through the server module, it would probably become more obsolete as we add features to the /v1/volumes API endpoint, like the ability to take snapshots.

I understand that you are looking to simplify the setup - I feel you would pay a price for that down the line. Beyond leading to a few more lines of code, is there anything else that such a change would help you with? Maybe I'm not seeing the big picture and there's a good argument for your request that I'm not seeing.

href commented 1 year ago

I'm closing this, due to inactivity. Feel free to re-open if you'd like to continue the discussion.