Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing image fails on an LXD cluster member #47

Open
rnalrd opened this issue Jul 15, 2022 · 0 comments
Open

Publishing image fails on an LXD cluster member #47

rnalrd opened this issue Jul 15, 2022 · 0 comments
Labels

Comments

@rnalrd
Copy link

rnalrd commented Jul 15, 2022

Overview of the Issue

Publishing an image fails on an LXD cluster member, because the container might not run on the same node where packer is running. The images are replicated between cluster nodes but there's an obvious lag. Packer does not wait for the image to be replicated before checking if it was successfully published.

Another possible approach would be to add an "lxc launch" option "--target" where you can specify where to run the container, in the same node where you are running packer.

Reproduction Steps

Just build any image on an LXD cluster member and wait for it to be built and published

Plugin and Packer version

Packer: 1.8.2
packer-plugin-lxd_v1.0.1

Simplified Packer Buildfile

Operating system and Environment details

Log Fragments and crash.log files

2022/07/15 14:23:26 ui: ==> lxd.debian-ubuntu-base: Publishing container...
2022/07/15 14:23:26 packer-plugin-lxd_v1.0.1_x5.0_linux_amd64 plugin: 2022/07/15 14:23:26 Executing lxc command: []string{"publish", "packer-debian-ubuntu-base", "", "--alias", "ubuntu-focal-base", "name=ubuntu-focal-base-x86_64", "os=ubuntu", "release=focal", "serial=2022071500", "architecture=x86_64", "description=ubuntu focal base image"}
Publishing instance: Image pack: 100% (15.54MB/s) linux_amd64 plugin: 2022/07/15 14:24:53 stdout: Publishing instance: Image pack: 1% (11.69MB/s)
2022/07/15 14:24:53 packer-plugin-lxd_v1.0.1_x5.0_linux_amd64 plugin: 2022/07/15 14:24:53 stderr: Error: Failed syncing image between nodes: Failed to get nodes for the image synchronization: No such object
2022/07/15 14:24:53 ui error: ==> lxd.debian-ubuntu-base: Error publishing container: LXD command error: Error: Failed syncing image between nodes: Failed to get nodes for the image synchronization: No such object
2022/07/15 14:24:53 ui: ==> lxd.debian-ubuntu-base: Unregistering and deleting deleting container...

@rnalrd rnalrd added the bug label Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant