[openstack-dev] [cinder] Bug#1231298 - size parameter for volume creation

Vishvananda Ishaya vishvananda at gmail.com
Fri Aug 8 17:33:35 UTC 2014


On Aug 8, 2014, at 6:55 AM, Dean Troyer <dtroyer at gmail.com> wrote:

> On Fri, Aug 8, 2014 at 12:36 AM, Ganapathy, Sandhya <sandhya.ganapathy at hp.com> wrote:
> This is to discuss Bug #1231298 – https://bugs.launchpad.net/cinder/+bug/1231298
> 
> ... 
> Conclusion reached with this bug is that, we need to modify cinder client in order to accept optional size parameter (as the cinder’s API allows)  and calculate the size automatically during volume creation from image.
> 
> There is also an opinion that size should not be an optional parameter during volume creation – does this mean, Cinder’s API should be changed in order to make size a mandatory parameter.
> 
> 
> In cinderclient I think you're stuck with size as a mandatory argument to the 'cinder create' command, as you must be backward-compatible for at least a deprecation period.[0]
> 
> Your option here[1] is to use a sentinel value for size that indicates the actual volume size should be calculated and let the client do the right thing under the hood to feed the server API.  Other project CLIs have used both 'auto' and '0' in situations like this.  I'd suggest '0' as it is still an integer and doesn't require potentially user-error-prone string matching to work.

We did this for novaclient volume attach and allowed device to be ‘auto' or the argument to be omitted. I don’t see a huge problem turning size into an optional parameter as long as it doesn’t break older scripts. Turning it from an arg into a kwarg would definitely require deprecation.

Vish

> 
> FWIW, this is why OSC changed 'volume create' to make --size an option and make the volume name be the positional argument.
> 
> [0] The deprecation period for clients is ambiguous as the release cycle isn't timed but we think of deprecations that way.  Using integrated release cycles is handy but less than perfect to correlate to the client's semver releases.
> [1] Bad pun alert...or is there such a thing as a bad pun???
> 
> dt
> 
> -- 
> 
> Dean Troyer
> dtroyer at gmail.com
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140808/db92446d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140808/db92446d/attachment.pgp>


More information about the OpenStack-dev mailing list