Skip to content

LXD build fails when using HCL syntax #8932

@artyomturkin

Description

@artyomturkin

Overview of the Issue

WHen using hcl syntax with lxd source. Build fails with error

Reproduction Steps

Packer version

Packer v1.5.4

Simplified Packer Buildfile

source "lxd" "seed-aa" {
    image = "ubuntu-minimal:bionic"
    output_image = "cloud-seed"
    
    publish_properties {
        description = "description"
    }
}

build {
    sources = [ "source.lxd.seed-aa"]

    provisioner "shell" {
        inline = ["apt-get update"]
    }
}

Operating system and Environment details

Ubuntu 19.10

Log Fragments and crash.log files

==> lxd: Creating container...
2020/03/22 15:33:43 packer-builder-lxd plugin: Executing lxc command: []string{"launch", "--ephemeral=false", "--profile=default", "ubuntu-minimal:bionic", "packer-"}
2020/03/22 15:33:43 packer-builder-lxd plugin: stdout: Creating packer-
2020/03/22 15:33:43 packer-builder-lxd plugin: stderr: Error: Failed instance creation: Invalid instance name: Name must not end with "-" character
==> lxd: Error creating container: LXD command error: Error: Failed instance creation: Invalid instance name: Name must not end with "-" character
2020/03/22 15:33:43 packer-builder-lxd plugin: Executing lxc command: []string{"delete", "--force", "packer-"}
==> lxd: Unregistering and deleting deleting container...
2020/03/22 15:33:43 packer-builder-lxd plugin: stdout:
==> lxd: Error deleting container: LXD command error: Error: not found
2020/03/22 15:33:43 packer-builder-lxd plugin: stderr: Error: not found
2020/03/22 15:33:43 [INFO] (telemetry) ending 
Build 'lxd' errored: Error creating container: LXD command error: Error: Failed instance creation: Invalid instance name: Name must not end with "-" character
2020/03/22 15:33:43 machine readable: error-count []string{"1"}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions