Closed lbytnar closed 6 years ago
cc @ChrisLundquist
I'll take a look tonight
On Tue, Oct 17, 2017 at 11:48 AM SwampDragons notifications@github.com wrote:
cc @ChrisLundquist https://github.com/chrislundquist
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hashicorp/packer/issues/5377#issuecomment-337330846, or mute the thread https://github.com/notifications/unsubscribe-auth/AALECByM98l07XtpB2q7nj9KvY9JbdAhks5stPaXgaJpZM4Pg71M .
Hmm:
# git rev-parse HEAD
f3c64ce81aca9391fc11571a56e4e1b1f5f1a100
Using lxd.json
as:
{
"builders": [
{
"type": "lxd",
"name": "u1",
"image": "ubuntu-daily:xenial"
}
]
}
Running the build with it:
# ./bin/packer build lxd.json
u1 output will be in this color.
==> u1: Creating container...
==> u1: Stopping container...
==> u1: Publishing container...
==> u1: Created image: 21e13ca5d84239b9dbeac3acb879893859683f97130ca8763acdc8691aa9e430
==> u1: Unregistering and deleting deleting container...
Build 'u1' finished.
==> Builds finished. The artifacts of successful builds are:
--> u1: image: 21e13ca5d84239b9dbeac3acb879893859683f97130ca8763acdc8691aa9e430
Looks happy?
# lxc image list
+---------------+--------------+--------+-------------------------------------------+--------+----------+------------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE |
+---------------+--------------+--------+-------------------------------------------+--------+----------+------------------------------+
| packer-u1 | 21e13ca5d842 | no | | x86_64 | 195.01MB | Oct 18, 2017 at 4:13am (UTC) |
@lbytnar what more can you tell me?
Update: I tried checking out v1.1.0 to see if it was fixed somehow between the version, but I have success on that version as well. I'm building on golang 1.8, and yours was built on 1.9 I don't think that would cause an issue like this.
One thing I'm not testing at the moment are interactions with provisioners.
@lbytnar Would you be able to try my above lxd.json
and see what happens on your end?
Hi @ChrisLundquist,
This seems to be partially fixed in 1.1.0. See below :
Version 1.1.0 without -only
# /usr/local/bin/packer_1.1.0 build packer.json
u1 output will be in this color.
==> u1: Creating container...
==> u1: Stopping container...
==> u1: Publishing container...
==> u1: Created image: de816aab8d80a167802f21b00b12d46d089cbfbdd0190baafac354771c41a722
==> u1: Unregistering and deleting deleting container...
Build 'u1' finished.
==> Builds finished. The artifacts of successful builds are:
--> u1: image: de816aab8d80a167802f21b00b12d46d089cbfbdd0190baafac354771c41a722
Version 1.1.0 with -only
# /usr/local/bin/packer_1.1.0 build -only lxd packer.json
==> Builds finished but no artifacts were created.
Version 1.0.0 without -only
# /usr/local/bin/packer_1.0.0 build packer.json
Failed to initialize build 'u1': builder type not found: lxd
u1 output will be in this color.
==> Builds finished but no artifacts were created.
Version 1.0.0 with -only
# /usr/local/bin/packer_1.0.0 build -only lxd packer.json
==> Builds finished but no artifacts were created.
So it seems to be narrow down to the -only
parameter, otherwise looks good. Thank you for checking and testing.
Ah, when the name
is defined then -only
parameter checks the it rather than the type
:
# /usr/local/bin/packer_1.1.0 build -only u1 packer.json
u1 output will be in this color.
==> u1: Creating container...
==> u1: Stopping container...
==> u1: Publishing container...
==> u1: Created image: a565b6242939b4efc1619294c391aa891ebafc7d0c453a4f7c476f55f2ce7e00
==> u1: Unregistering and deleting deleting container...
Build 'u1' finished.
==> Builds finished. The artifacts of successful builds are:
--> u1: image: a565b6242939b4efc1619294c391aa891ebafc7d0c453a4f7c476f55f2ce7e00
It doesn't work in 1.0.0.
edit
I wrongly assumed that it should be the type
instead of the name
. The default name is lxd
that is why it worked without parameter.
Sorry for time wasted, you can close this issue.
👍 thanks for taking a look @ChrisLundquist
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Affected versions: Packer 1.1.0 Host platform: Ubuntu 16.04.3 LTS Builder: lxd Provisioner: ansible-local with Ansible v2.3.2.0
Below packer config fails to produce any artifacts
Here is the output
If I remove
name
leaving justThen all works as expected