I recently tried to use cinderutils::ensure / profile::labs::cindermount::srv in puppet to mount cinder volumes, as is mentioned in:
https://wikitech.wikimedia.org/wiki/Help:Adding_disk_space_to_Cloud_VPS_instances#Cinder
as an alternative to manually running wmcs-prepare-cinder-volume.
When doing that I ran into some issues:
a) puppet runs the command but fails to mount the volume with the error message "Refusing to format volume in non-interactive mode without --allow-unattended-format""
I uploaded a suggested patch at gerrit:1056606 that would add that --allow-unattended-format parameter not being fully sure if that's really ok. Seems the most obvious fix attempt though.
b) When I try to use the "min_gb" and "max_gb" parameters to give the "size hints" [1] I can't set a size of 1GB. (my volume is 1GB). If I set min_gb to 1 that is considered "not larger than 1GB" and it fails to mount. If I skip min_gb it defaults to 10GB and therefore also won't mount. If I set it to 0.8, puppet fails because that isn't an integer.
gerrit:1057000 is a suggested patch for that that simply allows floating point numbers OR integers. The calculations made using it are in bytes, so _I think_ that would just work.
Could you please review or even merge my changes or leave comments either here or directly on Gerrit?
Thank you very much.
[1]
<snip> from cinderutils::ensure ... # Unfortunately we don't have a way to distinguish between attached volumes # other than by size. That means that if this class is used to mount volumes # that were re-attached after use on a different host, the behavior is somewhat # undefined: any volume can get mounted at any of the requested mount points. # This can be worked around by mounting the volumes by hand (using prepare_cinder_volume # in interactive mode) or by providing size hints via min_gb and max_gb if you need # to e.g. mount a small volume at /small and a big volume at /big.