os_server fails with "Error in creating instance (Inner Exception: create() takes at least 4 non-keyword arguments (2 given))"

206 views
Skip to first unread message

Richard Eggert

unread,
Sep 26, 2016, 6:11:32 PM9/26/16
to Ansible Project
I managed to get the os_server_facts module working, but when I try to use the os_server module to create a new VM instance, I get the following error:

Error in creating instance (Inner Exception: create() takes at least 4 non-keyword arguments (2 given))

No other meaningful diagnostic information is provided (even with "-v -v -v"), so I have no idea where to look. I couldn't find anything specific to Ansible when I looked up the error message via Google. I couldn't finding any direct calls to a method named "create" in os_server.py, either.

David Shrewsbury

unread,
Sep 27, 2016, 10:29:42 AM9/27/16
to Ansible Project
This is likely from the lower level python-novaclient library. Given all of your issues with
version dependency hell, you've probably got some mix of libraries that just don't gel
together.  If it's possible, I'd highly recommend against using any Centos-based system.

Richard Eggert

unread,
Sep 27, 2016, 12:57:49 PM9/27/16
to Ansible Project
Unfortunately, I don't have a choice in this case.

Richard Eggert

unread,
Sep 27, 2016, 1:24:10 PM9/27/16
to Ansible Project
Is there any way to obtain the stack trace of the original exception, so I could at least determine where the mismatch is occurring?

Rich


On Monday, September 26, 2016 at 6:11:32 PM UTC-4, Richard Eggert wrote:

Richard Eggert

unread,
Sep 27, 2016, 2:54:51 PM9/27/16
to Ansible Project
After digging through the source code, I believe I've tracked the problem down to the following call in _tasks.py in Shade:

class ServerCreate(task_manager.Task):
    def main(self, client):
        return client.nova_client.servers.create(**self.args)

This appears to be calling the following method from servers.py in novaclient:

def create(self, name, image, flavor, meta=None ... and a bunch more parameters with default values)

I can only assume that self.args is only expanding into two values instead of the expected minimum 4.

I don't know where the value of self.args comes from, however. I'm definitely passing a "name", "flavor", and "image" to the os_server module.


Rich


On Monday, September 26, 2016 at 6:11:32 PM UTC-4, Richard Eggert wrote:

Richard Eggert

unread,
Sep 27, 2016, 3:25:39 PM9/27/16
to Ansible Project
I think I found the problem.

Over time, a line in Shade's openstackcloud.py changed from this (in v1.1 and v1.2):
server = self.manager.submitTask(_tasks.ServerCreate(
name=name, image=image, flavor=flavor, **kwargs))
to this (in v1.3-v1.11):
server = self.manager.submitTask(_tasks.ServerCreate(
name=name, flavor=flavor, **kwargs))
to this (in v1.12+):
server = self.manager.submit_task(_tasks.ServerCreate(
name=name, **kwargs))
Downgrading to Shade 1.11.1 seems to have fixed the problem. 

I finally managed to create a VM instance. Yay.

~Rich
Reply all
Reply to author
Forward
0 new messages