Repository: ansible/ansible

Issue:
os_server fails to create instance
_From @bryfry on October 1, 2016 3:52_

##### ISSUE TYPE
- Bug Report
- Documentation Report
##### COMPONENT NAME

[ansible-modules-core/cloud/openstack/os_server](https://github.com/ansible/ansible-modules-core/blob/18f710fe32b54732862c930be6f297ab2da07e6a/cloud/openstack/os_server.py)
##### ANSIBLE VERSION

```
ansible 2.2.0 (devel 60b322e3ca) last updated 2016/09/30 22:52:06 (GMT -400)
  lib/ansible/modules/core: (detached HEAD 18f710fe32) last updated 2016/09/30 22:52:08 (GMT -400)
  lib/ansible/modules/extras: (detached HEAD a58e1d59c0) last updated 2016/09/30 22:52:09 (GMT -400)
  config file = 
  configured module search path = Default w/o overrides
```
##### CONFIGURATION

None
##### OS / ENVIRONMENT

Ubuntu Server 16.04
##### SUMMARY

os_server fails to launch an instance with the below illogical error:

```
fatal: [localhost]: FAILED! => {"changed": false, "extra_data": null, "failed": true, "msg": "Error in creating instance (Inner Exception: create() takes at least 4 arguments (10 given))"}
```
##### STEPS TO REPRODUCE

`pip install ansible shade` yields ansible==2.1.2.0 shade==1.12.1
or 
`pip install git+git://github.com/ansible/ansible.git@devel git+git://github.com/openstack-infra/shade.git@master` yields ansible==2.2.0 shade==1.12.2.dev1

Same results for either case

```
- name: "{{ instance_name }} - os - launch instance"
  os_server:
    cloud: "{{ cloud_name }}"
    state: present
    name: "{{ instance_name }}"
    image: "{{ instance_image }}"
    flavor: "{{ instance_flavor }}"
    key_name: "{{ instance_key_name }}"
    meta:
      type: "{{ instance_type }}"
      bootstrapped: "false"
    availability_zone: "{{ instance_az }}"
    nics: 
     - port-name: "{{ instance_name }}-port"
    wait: yes
  register: instance_result
```
##### EXPECTED RESULTS

An instance should be launched; the number 10 should be greater than 4; I've begun questioning everything.  Clearly there is something wrong but even if it is something that I have done incorrectly this error message is beyond cryptic and even digging into the module and shade code has not enlightened me.  Please help me and everyone who makes the same mistake as me in the future to not have this level of confusion.  Thank you.
##### ACTUAL RESULTS

```
TASK [launch-instance : nginx - os - launch instance] **************************
task path: /home/ubuntu/git/services-ansible/roles/launch-instance/tasks/main.yml:32
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/core/cloud/openstack/os_server.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ubuntu
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004 `" && echo ansible-tmp-1475290735.9-140508241290004="` echo $HOME/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmp6xrd2V TO /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/os_server.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/ /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/os_server.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/os_server.py; rm -rf "/home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/" > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "extra_data": null,
    "failed": true,
    "invocation": {
        "module_args": {
            "api_timeout": null,
            "auth": null,
            "auth_type": null,
            "auto_ip": true,
            "availability_zone": "az0",
            "boot_from_volume": false,
            "boot_volume": null,
            "cacert": null,
            "cert": null,
            "cloud": "services",
            "config_drive": false,
            "delete_fip": false,
            "endpoint_type": "public",
            "flavor": "m1.medium",
            "flavor_include": null,
            "flavor_ram": null,
            "floating_ip_pools": null,
            "floating_ips": null,
            "image": "xenial",
            "image_exclude": "(deprecated)",
            "key": null,
            "key_name": "a3s-key",
            "meta": {
                "bootstrapped": "false",
                "type": "a3s-nginx"
            },
            "name": "nginx",
            "network": null,
            "nics": [
                {
                    "port-name": "nginx-port"
                }
            ],
            "region_name": null,
            "scheduler_hints": null,
            "security_groups": [
                "default"
            ],
            "state": "present",
            "terminate_volume": false,
            "timeout": 180,
            "userdata": null,
            "verify": true,
            "volume_size": false,
            "volumes": [],
            "wait": true
        },
        "module_name": "os_server"
    },
    "msg": "Error in creating instance (Inner Exception: create() takes at least 4 arguments (10 given))"
}
```


_Copied from original issue: ansible/ansible-modules-core#5116_


Discussion:
_From @ansibot on October 1, 2016 4:13_

<!-- @bryfry: Thanks for filing this bug report! -->

@emonty, @shrews, @juliakreger, @j2sol, @rcarrillocruz, ping. This issue is waiting on your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_bug_new --->

_From @ansibot on October 16, 2016 8:28_

@emonty, @shrews, @juliakreger, @j2sol, @rcarrillocruz, ping. This issue is still waiting on your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_renotify_maintainer --->

_From @ansibot on October 31, 2016 8:40_

@emonty, @shrews, @juliakreger, @j2sol, @rcarrillocruz, ping. This issue is still waiting on your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_renotify_maintainer --->

_From @aerosol on November 2, 2016 8:10_

I'm also facing this issue. I have a feeling it comes from the openstack platform I'm provisioning against and has little to do with local libs, since I can't run a playbook that worked last week and no local changes have been made :rage2: 

@bryfry have you found anything?

_From @aerosol on November 2, 2016 8:34_

@bryfry oddly enough, downgrading `shade` locally pushed this a little bit forward for me

`pip install -I shade==1.11.1`

_From @ansibot on November 15, 2016 9:42_

@emonty, @shrews, @juliakreger, @j2sol, @rcarrillocruz, ping. This issue is still waiting on your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_renotify_maintainer --->

_From @Thingee on November 16, 2016 19:54_

I just gave this a try on city cloud with ansible 2.2.0.0 and shade 1.12.1 and didn't experience any problems. Is there a particular public cloud you're able to reproduce this on so I can further look into this problem? Thanks!

```
cat test_os_server_create.yml
- hosts: localhost
  connection: local
  tasks:
    - os_port:
        cloud: citycloud
        region_name: Sto2
        name: test_port
        network: test
        state: present

    - os_server:
        cloud: citycloud
        state: present
        name: test
        image: Ubuntu 16.04 Xenial Xerus
        region_name: Sto2
        flavor: 1C-0.5GB
        key_name: launcher
        meta:
          type: foo
          bootstrapped: "false"
        nics:
          - port-name: test_port
        wait: yes
```

```
(ansible) ubuntu@devstack:~/test/ansible$ ansible-playbook -vvvv test_os_server_create.yml
No config file found; using defaults
 [WARNING]: Host file not found: /etc/ansible/hosts

 [WARNING]: provided hosts list is empty, only localhost is available

Loading callback plugin default of type stdout, v2.0 from /home/ubuntu/.virtualenvs/ansible/local/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc

PLAYBOOK: test_os_server_create.yml ********************************************
1 plays in test_os_server_create.yml

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
Using module file /home/ubuntu/.virtualenvs/ansible/local/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ubuntu
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1479325268.96-105737182381391 `" && echo ansible-tmp-1479325268.96-105737182381391="` echo $HOME/.ansible/tmp/ansible-tmp-1479325268.96-105737182381391 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpgXnFKx TO /home/ubuntu/.ansible/tmp/ansible-tmp-1479325268.96-105737182381391/setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1479325268.96-105737182381391/ /home/ubuntu/.ansible/tmp/ansible-tmp-1479325268.96-105737182381391/setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/ubuntu/.virtualenvs/ansible/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1479325268.96-105737182381391/setup.py; rm -rf "/home/ubuntu/.ansible/tmp/ansible-tmp-1479325268.96-105737182381391/" > /dev/null 2>&1 && sleep 0'
ok: [localhost]

TASK [os_port] *****************************************************************
task path: /home/ubuntu/test/ansible/test_os_server_create.yml:4
Using module file /home/ubuntu/.virtualenvs/ansible/local/lib/python2.7/site-packages/ansible/modules/core/cloud/openstack/os_port.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ubuntu
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1479325269.63-106950633813333 `" && echo ansible-tmp-1479325269.63-106950633813333="` echo $HOME/.ansible/tmp/ansible-tmp-1479325269.63-106950633813333 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpgD6dRl TO /home/ubuntu/.ansible/tmp/ansible-tmp-1479325269.63-106950633813333/os_port.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1479325269.63-106950633813333/ /home/ubuntu/.ansible/tmp/ansible-tmp-1479325269.63-106950633813333/os_port.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/ubuntu/.virtualenvs/ansible/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1479325269.63-106950633813333/os_port.py; rm -rf "/home/ubuntu/.ansible/tmp/ansible-tmp-1479325269.63-106950633813333/" > /dev/null 2>&1 && sleep 0'
changed: [localhost] => {
    "changed": true,
    "id": "b7070587-2a60-4f08-885c-b1ddb0aa45c2",
    "invocation": {
        "module_args": {
            "admin_state_up": null,
            "allowed_address_pairs": null,
            "api_timeout": null,
            "auth": null,
            "auth_type": null,
            "availability_zone": null,
            "cacert": null,
            "cert": null,
            "cloud": "citycloud",
            "device_id": null,
            "device_owner": null,
            "endpoint_type": "public",
            "extra_dhcp_opts": null,
            "fixed_ips": null,
            "key": null,
            "mac_address": null,
            "name": "test_port",
            "network": "test",
            "no_security_groups": false,
            "region_name": "Sto2",
            "security_groups": null,
            "state": "present",
            "timeout": 180,
            "verify": true,
            "wait": true
        },
        "module_name": "os_port"
    },
    "port": {
        "admin_state_up": true,
        "description": "",                                                                                                                                                                                                                                           
        "device_id": "",
        "device_owner": "",
        "dns_name": null,
        "extra_dhcp_opts": [],
        "fixed_ips": [
            {
                "ip_address": "10.2.0.4",
                "subnet_id": "d7ec194e-0bdb-4f7a-9218-908f0f73a828"
            }
        ],
        "id": "b7070587-2a60-4f08-885c-b1ddb0aa45c2",
        "mac_address": "fa:16:3e:33:30:f3",
        "name": "test_port",
        "network_id": "e71e2293-4675-4d48-b39d-3a35fb9744cf",
        "security_groups": [
            "e34d6b62-c7e2-4208-9bc1-5c9467362fbe"
        ],
        "status": "DOWN",
        "tenant_id": "XXXXXX",
        "updated_at": "2016-11-16T19:41:13"
    }
}

TASK [os_server] ***************************************************************
task path: /home/ubuntu/test/ansible/test_os_server_create.yml:11
Using module file /home/ubuntu/.virtualenvs/ansible/local/lib/python2.7/site-packages/ansible/modules/core/cloud/openstack/os_server.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ubuntu
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1479325274.3-255162864437237 `" && echo ansible-tmp-1479325274.3-255162864437237="` echo $HOME/.ansible/tmp/ansible-tmp-1479325274.3-255162864437237 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpoOgOPj TO /home/ubuntu/.ansible/tmp/ansible-tmp-1479325274.3-255162864437237/os_server.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1479325274.3-255162864437237/ /home/ubuntu/.ansible/tmp/ansible-tmp-1479325274.3-255162864437237/os_server.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/ubuntu/.virtualenvs/ansible/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1479325274.3-255162864437237/os_server.py; rm -rf "/home/ubuntu/.ansible/tmp/ansible-tmp-1479325274.3-255162864437237/" > /dev/null 2>&1 && sleep 0'
changed: [localhost] => {
    "changed": true,
    "id": "936ef73b-3866-4f14-a3f4-8157ac421c4a",
    "invocation": {
        "module_args": {
            "api_timeout": null,
            "auth": null,
            "auth_type": null,
            "auto_ip": true,
            "availability_zone": null,
            "boot_from_volume": false,
            "boot_volume": null,
            "cacert": null,
            "cert": null,
            "cloud": "citycloud",
            "config_drive": false,
            "delete_fip": false,
            "endpoint_type": "public",
            "flavor": "1C-0.5GB",
            "flavor_include": null,
            "flavor_ram": null,
            "floating_ip_pools": null,
            "floating_ips": null,
            "image": "Ubuntu 16.04 Xenial Xerus",
            "image_exclude": "(deprecated)",
            "key": null,
            "key_name": "launcher",                                                                                                                                                                                                                                   [171/1803]
            "meta": {
                "bootstrapped": "false",
                "type": "foo"
            },
            "name": "test",
            "network": null,
            "nics": [
                {
                    "port-name": "test_port"
                }
            ],
            "region_name": "Sto2",
            "reuse_ips": true,
            "scheduler_hints": null,
            "security_groups": [
                "default"
            ],
            "state": "present",
            "terminate_volume": false,
            "timeout": 180,
            "userdata": null,
            "verify": true,
            "volume_size": false,
            "volumes": [],
            "wait": true
        },
        "module_name": "os_server"
    },
    "openstack": {
        "HUMAN_ID": true,
        "NAME_ATTR": "name",
        "OS-DCF:diskConfig": "MANUAL",
        "OS-EXT-AZ:availability_zone": "nova",
        "OS-EXT-STS:power_state": 1,
        "OS-EXT-STS:task_state": null,
        "OS-EXT-STS:vm_state": "active",
        "OS-SRV-USG:launched_at": "2016-11-16T19:42:32.000000",
        "OS-SRV-USG:terminated_at": null,
        "accessIPv4": "185.62.207.64",
        "accessIPv6": "",
        "addresses": {
            "test": [
                {
                    "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:33:30:f3",
                    "OS-EXT-IPS:type": "fixed",
                    "addr": "10.2.0.4",
                    "version": 4
                },
                {
                    "OS-EXT-IPS-MAC:mac_addr": "de:ad:be:ef:be:ef",
                    "OS-EXT-IPS:type": "floating",
                    "addr": "185.62.207.64",
                    "version": 4
                }
            ]
        },
        "adminPass": "XXXXXX",
        "az": "nova",
        "cloud": "citycloud",
        "config_drive": "",
        "created": "2016-11-16T19:42:28Z",
        "flavor": {
            "id": "8e00bc89-f2b0-40d3-96d4-05bd67f6e6bf",
            "name": "1C-0.5GB"
        },
        "hostId": "009db600992e8b83c0e90f9f48e50d0810e57a524ea597cf58a9c81b",
        "human_id": "test",
        "id": "936ef73b-3866-4f14-a3f4-8157ac421c4a",
        "image": {
            "id": "f3a5855a-eb28-4806-bb2c-0090b889782f",
            "name": "Ubuntu 16.04 Xenial Xerus"
        },
        "interface_ip": "185.62.207.64",
        "key_name": "launcher",
        "metadata": {
            "bootstrapped": "false",
            "type": "foo"
        },
        "name": "test",
        "networks": {
            "test": [
                "10.2.0.4"
            ]
        },
        "os-extended-volumes:volumes_attached": [],
        "private_v4": "10.2.0.4",
        "progress": 0,
        "public_v4": "185.62.207.64",
        "public_v6": "",
        "region": "Sto2",
        "request_ids": [],
        "security_groups": [
            {
                "description": "Default security group",
                "id": "e34d6b62-c7e2-4208-9bc1-5c9467362fbe",
                "name": "default",
                "security_group_rules": [
                    {
                        "direction": "ingress",
                        "ethertype": "IPv4",
                        "id": "1556a93d-839e-4788-b3d1-5678f848a17b",
                        "port_range_max": null,
                        "port_range_min": null,
                        "protocol": null,
                        "remote_ip_prefix": "::/0",
                        "security_group_id": "e34d6b62-c7e2-4208-9bc1-5c9467362fbe"
                    },
                    {
                        "direction": "ingress",
                        "ethertype": "IPv4",
                        "id": "f5eb44a4-8d2a-4a26-9086-04a42824c2ab",
                        "port_range_max": null,
                        "port_range_min": null,
                        "protocol": null,
                        "remote_ip_prefix": "0.0.0.0/0",
                        "security_group_id": "e34d6b62-c7e2-4208-9bc1-5c9467362fbe"
                    }
                ]
            }
        ],
        "status": "ACTIVE",
        "tenant_id": "XXXXXXX",
        "updated": "2016-11-16T19:42:32Z",
        "user_id": "XXXXX",
        "volumes": []
    },
    "server": {
        "HUMAN_ID": true,
        "NAME_ATTR": "name",
        "OS-DCF:diskConfig": "MANUAL",
        "OS-EXT-AZ:availability_zone": "nova",
        "OS-EXT-STS:power_state": 1,
        "OS-EXT-STS:task_state": null,
        "OS-EXT-STS:vm_state": "active",
        "OS-SRV-USG:launched_at": "2016-11-16T19:42:32.000000",
        "OS-SRV-USG:terminated_at": null,
        "accessIPv4": "185.62.207.64",
        "accessIPv6": "",
        "addresses": {
            "test": [
                {
                    "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:33:30:f3",
                    "OS-EXT-IPS:type": "fixed",
                    "addr": "10.2.0.4",
                    "version": 4
                },
                {
                    "OS-EXT-IPS-MAC:mac_addr": "de:ad:be:ef:be:ef",
                    "OS-EXT-IPS:type": "floating",
                    "addr": "185.62.207.64",
                    "version": 4
                }
            ]
        },
        "adminPass": "XXXX",
        "az": "nova",
        "cloud": "citycloud",
        "config_drive": "",
        "created": "2016-11-16T19:42:28Z",
        "flavor": {
            "id": "8e00bc89-f2b0-40d3-96d4-05bd67f6e6bf",
            "name": "1C-0.5GB"
        },
        "hostId": "009db600992e8b83c0e90f9f48e50d0810e57a524ea597cf58a9c81b",
        "human_id": "test",
        "id": "936ef73b-3866-4f14-a3f4-8157ac421c4a",
        "image": {
            "id": "f3a5855a-eb28-4806-bb2c-0090b889782f",
            "name": "Ubuntu 16.04 Xenial Xerus"
        },
        "interface_ip": "185.62.207.64",
        "key_name": "launcher",
        "metadata": {
            "bootstrapped": "false",
            "type": "foo"
        },
        "name": "test",
        "networks": {
            "test": [
                "10.2.0.4"
            ]
        },
        "os-extended-volumes:volumes_attached": [],
        "private_v4": "10.2.0.4",
        "progress": 0,
        "public_v4": "185.62.207.64",
        "public_v6": "",
        "region": "Sto2",
        "request_ids": [],
        "security_groups": [
            {
                "description": "Default security group",
                "id": "e34d6b62-c7e2-4208-9bc1-5c9467362fbe",
                "name": "default",
                "security_group_rules": [
                    {
                        "direction": "ingress",
                        "ethertype": "IPv4",
                        "id": "1556a93d-839e-4788-b3d1-5678f848a17b",
                        "port_range_max": null,
                        "port_range_min": null,
                        "protocol": null,
                        "remote_ip_prefix": "::/0",
                        "security_group_id": "e34d6b62-c7e2-4208-9bc1-5c9467362fbe"
                    },
                    {
                        "direction": "ingress",
                        "ethertype": "IPv4",
                        "id": "f5eb44a4-8d2a-4a26-9086-04a42824c2ab",
                        "port_range_max": null,
                        "port_range_min": null,
                        "protocol": null,
                        "remote_ip_prefix": "0.0.0.0/0",
                        "security_group_id": "e34d6b62-c7e2-4208-9bc1-5c9467362fbe"
                    }
                ]
            }
        ],
        "status": "ACTIVE",
        "tenant_id": "XXXXXX",
        "updated": "2016-11-16T19:42:32Z",
        "user_id": "XXXXXX",
        "volumes": []
    }
}

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=2    unreachable=0    failed=0
```

_From @j2sol on November 16, 2016 20:40_

needs_info

_From @michalmedvecky on November 21, 2016 6:36_

I can confirm this issue:

    ansible==2.2.0.0
    shade==1.13.1
    python-openstackclient==3.4.0

I have been facing this issue since trying against openstack Mitaka (I've been testing my playbooks against Liberty). I can't tell you if it depends on openstack version or not.

I've found out, that `image` parameter does not propagate into `kwargs` for `ServerCreate` in shade's `openstackcloud.py` (https://github.com/openstack-infra/shade/blob/master/shade/openstackcloud.py#L4950). When I manually add `image="my-image-id` into this line, module starts working.

Ask me for any other information.
_From @michalmedvecky on November 21, 2016 6:43_

@Thingee I also observe a slight difference between my and yours `-vvvv` output:

My is a string:

    "image": "66ae409c-f2ea-4a8c-a25c-3859d79f9f33",

Your is a dict:

    "image": {
            "id": "f3a5855a-eb28-4806-bb2c-0090b889782f",
            "name": "Ubuntu 16.04 Xenial Xerus"
        },

Task definitions do not differ (except you're using image name instead of id and I have no idea where your id got into the output)

_From @michalmedvecky on December 7, 2016 4:14_

@j2sol ping
_From @ansibot on December 7, 2016 19:12_

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the <a href="http://docs.ansible.com/ansible/dev_guide/repomerge.html#move-issues-and-prs-to-new-repo">repomerge</a> page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

<!-- boilerplate: repomerge -->
cc @shrews, @thingee
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
@bryfry, @michalmedvecky, thanks for your patience. I was on leave for a bit. Yeah I don't think the image name/id input would cause an issue here. I'll see about testing this on a cloud running liberty.
@mordred attempted the playbook on united stack cloud which is running liberty and it worked. Is there a public environment that I may be able to replicate this?
needs_info
I think if I remember back that this happens if the image name requested doesn't exist.  As the original post indicated, the error doesn't covey any of that information, instead it just reports the incomprehensible shade error.   I think this could be fixed with some extra logic around os_server to check for prerequisites to the server create api call.  E.g: go get the list of images and ensure the requested image is available. 
@bryfry thanks for the information. I was able to reproduce this error with a random image name value. I agree this shouldn't be giving the vague it's giving now, and will look into to making this more clear.

Resolving patch:
diff --git a/lib/ansible/modules/cloud/openstack/os_server.py b/lib/ansible/modules/cloud/openstack/os_server.py
--- a/lib/ansible/modules/cloud/openstack/os_server.py
+++ b/lib/ansible/modules/cloud/openstack/os_server.py
@@ -447,6 +447,9 @@ def _create_server(module, cloud):
     if not module.params['boot_volume']:
         image_id = cloud.get_image_id(
             module.params['image'], module.params['image_exclude'])
+        if not image_id:
+            module.fail_json(msg="Could not find image %s" %
+                             module.params['image'])
 
     if flavor:
         flavor_dict = cloud.get_flavor(flavor)


Test patch: