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’: ‘’},
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=‘’,
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
auto_ip=False)
File “”, 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.