Skip to content

qcow2 image creation  #31

Open
Open

Description

@pmandreoli

Hi, I'm trying to create openstack qcow2 images using packer.
Everything goes well, the image was created and i was able to create instances using default opensztack options.

The problem is that the instanced launched using this image fail if created using --boot-from-volume in the command for the server creation openstack server create.

Error:
error: build of instance <instance-id> aborted: volume <volume-id> did not finish being created even after we waited 181 seconds or 19 attempts. and its status is error

This does not happen if the image is first created in raw format and then converted to qcow2 later using qemu-img convert.

{
    "builders": [
        {
            "type": "openstack",
            "username": "*****",
            "password": "******",
            "identity_endpoint": "******",
            "region": "<region>",
            "tenant_id": "<id>",
            "domain_name":"<domain-name>",
            "image_name": "centos7-packer-test",
            "ssh_username": "centos",
            "source_image": "<centos7-image-id>",
            "availability_zone": "nova",
            "flavor": "4",
            "ssh_ip_version": "4",
            "use_blockstorage_volume": "true",
            "volume_size": "10",
            "volume_availability_zone": "nova",
            "image_disk_format": "qcow2",
            "networks": [
                "<network-id>"
            ]
        }
    ],
    "provisioners": [
            {
                    "type": "shell",
                    "inline": ["sudo yum install -y vim"]
                    }

    ]
}

I wanted to ask, I need to set some additional variables in the json to enable the image to be launched using --boot-from-volume ? or is a error in the image format conversion in packer?

Activity

  1. pmandreoli commented on Jul 20, 2021

    @pmandreoli
    Author

    The image works if converted to qcow2 using Quemu image converter.

    raw to qcow2 conversion

    • Install quemu sudo apt install quemu-utils
    • Download the openstack image using the openstack client
    • Convert image from raw to qcow2 cmd: qemu-img convert -f raw -O qcow2 image.img image.qcow2
    • Upload the image to openstack: openstack image create
  2. ramki88 commented on Mar 22, 2024

    @ramki88

    Had the same issue, if anyone faces this still then here's the solution.. removing signature_verified property from the image post it is uploaded seems to fix the issue.

    glance image-update <image_id> --remove-property signature_verified

  3. evelineraine commented on Apr 10, 2025

    @evelineraine

    The issue is supposedly fixed in updates to a couple of latest OpenStack releases. See here for more info: https://bugs.launchpad.net/cinder/+bug/1823445

    I haven't had a chance to test it yet, so using a combination of manifest and shell-local Post Provisioners to openstack image unset --property=signature_verified <ID> for each newly-built image. It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions