You can trivially pre-generate a UUID (via uuidgen or similar) to create your image with a known UUID if that's sufficient for you.
$UUID=$(uuidgen) glance image-create --id $UUID ... On Fri, Feb 19, 2016 at 6:17 PM, Martinx - ジェームズ <thiagocmarti...@gmail.com> wrote: > Guys, > > I want to formalize my protest against Glance V2 usability. > > With Glance V1, you can straight away, add an image based on its remote URL > location, then, Glance will download the image ONLY when someone launch it. > > This is very cool and I can add, easily and automatically by Ansible, for > example, dozens of images at once, right after deploying OpenStack. > > However, this is much worse now, when with Glance V2, as follows: > > ----- > *** Glance V1 procedure: > > 1) Add an image and its remote location at once: > > glance image-create --location > http://cdimage.debian.org/cdimage/openstack/8.3.0/debian-8.3.0-openstack-amd64.qcow2 > --is-public true --name "Debian 8.3.0 - Jessie - 64-bit - Cloud Based Image" > --container-format bare --disk-format qcow2 > > See it? Glance V1 is awesome! > > -- > > *** Glance V2 procedure: > > 1) Add an Image WITHOUT a location: > > glance image-create --visibility public --name \"Debian 8.3.0 - Jessie - > 64-bit - Cloud Based Image\" --container-format bare --disk-format qcow2 > > 2) Look (or parse somehow) the stdout, copy to clipboad the Image ID. > > 3) Add the location of the image: > > glance location-add --url > http://cdimage.debian.org/cdimage/openstack/8.3.0/debian-8.3.0-openstack-amd64.qcow2 > $PASTE_IMAGE_ID > > See it? Glance V2 sucks. > ----- > > It is more complicated now, specially to automate this with Ansible or > other tool! Because there is a need to parser the stdout of step "1" and > store the Image ID somewhere (like a variable), and then, add the remote > location URL for the image. > > Please guys, do something about this! > > NOTE: I will be happy to be wrong here, let me know if I am missing > something. > > I believe that, if the "glance location-add" starts to accept "image name" > (instead of only ID), it will make the automation easier, because the name > is predictable, and the ID is random. Or, if someone tells me how to > auto-generate random IDs for OpenStack, so it will be predictable (I'll be > able to use auto-genarated ID with "image-create", I believe), then, it will > also make the automation easier, I'll be okay with that too! > > Thanks in advance! > > Regards, > Thiago > > _______________________________________________ > Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack > Post to : openstack@lists.openstack.org > Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack > _______________________________________________ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack