On 20/10/15 04:13 -0200, Martinx - ジェームズ wrote:
Guys,
Hi Martin,
I have an Ansible automation to deploy OpenStack Kilo, it works like a charm, specially the following playbook: https://github.com/sandvine/os-ansible-deployment-lite/blob/kilo/ansible/roles/glance/tasks/default-images.yml In one shot, I can add remote images (Glance downloads on demand) and update its properties immediatly... But, new Glance lost all functionality that make this to work.
I'd like to start by clarifying that the issues you're facing are related to the client library and not the API. Glance API v2 has stayed the same since it was added and it keeps backwards compatibility with older releases in the 2.x series. It does have some differences with the API v1 but must of them relate to security models that were improved. That said, lets focus on the client library. First and foremost, the immediate solution for your scripts that will allow you to update them progressively is to add `--os-image-api-version 1` to your ansible playbook. This is not ideal, true.
To begin with, OS_IMAGE_API version 2, doesn't have "--location" anymore... Why not? It is VERY useful. Please, bring it back. Or at least, document how to do the same when using API 2...
As mentioned above, there are some incompatibilities. Some could be brought back others won't. We've listed some of these incompatibilities in this wiki page: https://wiki.openstack.org/wiki/Glance-v2-v1-client-compatability
Also, new (API 2) "glance image-update" REQUIRES the Image ID, this sucks because it is much easier to use the Image Name instead... So, I updated my Ansible playbook to deploy Liberty... But Glance doesn't work the way it should work... For example, here...: https://github.com/sandvine/os-ansible-deployment-lite/blob/liberty/ansible/roles/glance/tasks/default-images.yml ...I had to disable all "glance image-update" calls, because it simple doesn't work anymore, even using OS_IMAGE_API=1 !!!
This doesn't seem to be related to the current API nor the client release. It'd be great if you could file a bug for this in launchpad with a bit more details so we can debug it.
Look what happens now: .... changed: [localhost] => (item=glance image-create --location http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img --name "CirrOS 0.3.4 - Minimalist - 32-bit - Cloud Based Image" --is-public true --container-format bare --disk-format qcow2) .... failed: [localhost] => (item=glance image-update --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scsi "CirrOS 0.3.4 - Minimalist - 32-bit - Cloud Based Image") => {"changed": true, "cmd": ["glance", "image-update", "--property", "hw_scsi_model=virtio-scsi", "--property", "hw_disk_bus=scsi", "CirrOS 0.3.4 - Minimalist - 32-bit - Cloud Based Image"], "delta": "0:00:00.898007", "end": "2015-10-20 01:10:03.837781", "item": "glance image-update --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scsi \"CirrOS 0.3.4 - Minimalist - 32-bit - Cloud Based Image\"", "rc": 1, "start": "2015-10-20 01:10:02.939774", "warnings": []} stderr: Unable to upload image data to an image which is active. ....
It seems that the image has been moved to an active state and then you tried to add a location. Is that right? Active images can't be changed. They are immutable. Martin, Thanks for sending this out. Happy to help debugging and any feedback on the CLI is super welcomed. That'll help us work on a better compatibility layer. Cheers, Flavio
It is even more weird, because those two commands, that doesn't work when with Ansible, works manually... For example: --- #! /bin/bash source ~/admin-openrc.sh glance image-create --location http://uec-images.ubuntu.com/releases/14.04.3/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img --is-public true --disk-format qcow2 --container-format bare --name "Ubuntu 14.04.3 LTS - Trusty Tahr - 64-bit - Cloud Based Image" glance image-update --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scsi "Ubuntu 14.04.3 LTS - Trusty Tahr - 64-bit - Cloud Based Image" --- Works! But only outside of Ansible... I triple checked everything (credentials that Ansible uses (ansible/group_vars/all), with the one that I source under Bash)... Maybe I am missing some typo again... =) I appreciate any help! Thanks in advance! Best, Thiago _______________________________________________ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : [email protected] Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
-- @flaper87 Flavio Percoco
signature.asc
Description: PGP signature
_______________________________________________ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : [email protected] Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
