简体   繁体   中英

Packer-built OpenStack instance stuck in “Spawning” state

I'm trying to build a new Debian image with Packer, but the building process halts at ==> openstack: Waiting for server to become ready... , while Packers building instance is stuck in the Spawning state.

( Edit: My last test build was stuck for ~45 minutes, and exited with this error message: Build 'openstack' errored: Error waiting for server ({uuid}) to become ready: unexpected state 'ERROR', wanted target '[ACTIVE]' )

The source image is a cloud image of Debian , and my template file looks like this:

{
    "variables": {
        "os_auth_url": " ( Keystone URL ) ",
        "os_domain_name": " ( Domain Name ) ",
        "os_tenant_name": " ( Project Name ) ",
        "os_region_name": " ( Region Name ) "
    },

    "builders": [
        {
            "type": "openstack",
            "flavor": "b.tiny",
            "image_name": "packer-openstack-{{timestamp}}",
            "source_image": "cd8da3bf-66cd-4847-8970-447533b86b30",
            "ssh_username": "debian",

            "username": "{{user `username`}}",
            "password": "{{user `password`}}",
            "identity_endpoint": "{{user `os_auth_url`}}",
            "domain_name": "{{user `os_domain_name`}}",
            "tenant_name": "{{user `os_tenant_name`}}",
            "region": "{{user `os_region_name`}}",

            "floating_ip_pool": "internet",
            "security_groups": [
                "deb_test_uni"
            ],
            "networks": [
                "a4151f4e-fd88-4df8-97e1-2b113f149ef8",
                "71b10496-2617-47ae-abbc-36239f0863bb"
            ]
        }
    ]
}

The username and password fields are being added by a separate file, located on the ( Jenkins ) build server.


The building process managed to get past this at one point, but exited with a ssh timeout error. I have no idea why that happened, and why only then.

Is there anything blindingly obvious that I'm missing? Or has anyone else suffered the same problem, but managed to find a solution?

Thanks in advance!

It turns out that, in my case, there was nothing I (personally) could do. It was neither the Packer template nor the environment variables (as I had a suspicion it could be), but a fault in the server-side configuration.

I'm sorry that I don't know what the bug or fix was, as I wasn't the one who found or fixed the problem, but knowing that it could be good idea to double-check the server setup might help someone in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM