If I do something like 

#!/usr/bin/env python

import shade

# Initialize and turn on debug logging
shade.simple_logging(debug=True)

cloud = shade.openstack_cloud()

cloud.create_server(
    name='my-server',
    image={'id': '<SHA>'},
    key_name='mykey',
    availability_zone='my-avail-zone',
    flavor='m1.medium',
    auto_ip=False)


That works as expected but if I do

#!/usr/bin/env python

import shade

# Initialize and turn on debug logging
shade.simple_logging(debug=True)

cloud = shade.openstack_cloud()

cloud.create_server(
    name='my-server',
    image='<SHA>',
    key_name='mykey',
    availability_zone='my-avail-zone',
    flavor='m1.medium',
    auto_ip=False)


I get the following stack trace

Traceback (most recent call last):
>   File "./make_vm_images.py", line 16, in <module>
>     auto_ip=False)
>   File "<decorator-gen-6>", line 2, in create_server
>   File 
> "/opt/miniconda/envs/ansible/lib/python2.7/site-packages/shade/_utils.py", 
> line 393, in func_wrapper
>     return func(*args, **kwargs)
>   File 
> "/opt/miniconda/envs/ansible/lib/python2.7/site-packages/shade/openstackcloud.py",
>  
> line 5510, in create_server
>     "Error in creating the server.")
>   File "/opt/miniconda/envs/ansible/lib/python2.7/contextlib.py", line 35, 
> in __exit__
>     self.gen.throw(type, value, traceback)
>   File 
> "/opt/miniconda/envs/ansible/lib/python2.7/site-packages/shade/_utils.py", 
> line 461, in shade_exceptions
>     raise exc.OpenStackCloudBadRequest(error_message)


I'm guessing that it's hitting the lines 
here: 
https://github.com/openstack-infra/shade/blob/master/shade/openstackcloud.py#L5477-L5481

And when it's not a dict it tries doing an image lookup which fails because 
the image is a shared image and not a project image. I'm wondering if 
there's any way to force ansible to pass in image as a dict I tried 
constructing the image YAML as an object but that fails as well.

On Tuesday, April 4, 2017 at 7:45:15 AM UTC-6, Lucas Nunno wrote:
>
> @Markku Any ideas when we are not authorized to accept the image via 
> glance?
>
> ➜ glance member-update <SHA> <NAME> accepted
> 403 Forbidden: You are not authorized to lookup the members of the image 
> <SHA>. (HTTP 403)
>
> I'm seeing the same issue as the parent post. Updating the code by hand 
> does work i.e. what Michal posted, but I'd like to use that as a last 
> resort.
>
> On Thursday, March 16, 2017 at 5:49:50 AM UTC-6, Markku Tavasti wrote:
>>
>>
>> maanantai 7. marraskuuta 2016 16.15.59 UTC+2 Lars Van Casteren kirjoitti:
>>>
>>>
>>> fatal: [localhost]: FAILED! => {"changed": false, "extra_data": null, 
>>> "failed": true, "msg": "Error in creating instance (Inner Exception: 
>>> create() takes at least 4 arguments (9 given))"}
>>>
>>>
>> I got this error when image was shared from other project with 'glance 
>> member-create' but that was not accepted. 'nova image-list' showed image, 
>> glance image-list not. 
>> After 'glance member-update' everything works.  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/48d6ce45-0e53-4370-ab8c-dcb2d79799b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to