# Packer v1.8.5 takes almost three times the build time compared to v1.8.0

**URL:** <https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238>\
**Category:** Packer\
**Created:** [December 22, 2022, 1:22am UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238 "2022-12-22T01:22:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cofiem](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/cofiem/32/32735_2.png) [@cofiem](https://discuss.hashicorp.com/u/cofiem)\
**Post date:** [December 22, 2022, 1:22am UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/1 "2022-12-22T01:22:30Z")

</div>

I’m looking to update the packer version we use to build images from v1.8.0 to v1.8.5.  
However, the build takes almost three times as long using the `amazon` `ebs` builder. It is using the same base AMI and provisioners, the only difference is the packer build version. Other builders (e.g. openstack) take the same approximate time to build the image.

For example,  
using v1.8.0 (so amazon plugin v1.0.8): `Build 'amazon-ebs.aws_instance' finished after 10 minutes 37 seconds.`  
using v1.8.5 (using amazon plugin v1.1.6): `Build 'amazon-ebs.aws_instance' finished after 28 minutes 55 seconds.`

We use ansible to provision the image, and we’ve turned on the `ansible.posix.profile_tasks` callback to see where the time is spent.

For v1.8.0, almost all tasks took less than 1 second, often fractions of a second.  
For v1.8.5, most tasks take at least 1 second, often more than 1 second.  
So the increase in time is spread across the ansible provisioner tasks.

Any hints as to why the build takes so much more time?  
Were there changes to the SSH communicator in packer or the amazon plugin that could cause this?

---

<div class="post-metadata">

**Author:** ![mickael.philippon](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mickael.philippon/32/24097_2.png) [@mickael.philippon](https://discuss.hashicorp.com/u/mickael.philippon)\
**Post date:** [March 2, 2023, 3:02pm UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/2 "2023-03-02T15:02:48Z")

</div>

Hi Cofiem,

I made the same observation as you

---

<div class="post-metadata">

**Author:** ![mickael.philippon](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mickael.philippon/32/24097_2.png) [@mickael.philippon](https://discuss.hashicorp.com/u/mickael.philippon)\
**Post date:** [March 2, 2023, 3:05pm UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/3 "2023-03-02T15:05:40Z")

</div>

Me it’s between 1.6.6 and 1.8.6, a yum update under centos who take 7 minutes under 1.6.6 take 26 minutes under 1.8.6.  
how is it possible such a difference ?

---

<div class="post-metadata">

**Author:** ![mickael.philippon](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mickael.philippon/32/24097_2.png) [@mickael.philippon](https://discuss.hashicorp.com/u/mickael.philippon)\
**Post date:** [June 15, 2023, 8:25am UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/4 "2023-06-15T08:25:58Z")

</div>

Hello,

Did you find the reason ?

---

<div class="post-metadata">

**Author:** ![cofiem](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/cofiem/32/32735_2.png) [@cofiem](https://discuss.hashicorp.com/u/cofiem)\
**Post date:** [June 28, 2023, 7:44am UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/5 "2023-06-28T07:44:22Z")

</div>

I haven’t worked out a cause for sure, but it looks like it might be related to ansible, see [fix various Jinja plugin caching issues by nitzmahone · Pull Request #79781 · ansible/ansible · GitHub](https://github.com/ansible/ansible/pull/79781)

---

<div class="post-metadata">

**Author:** ![mickael.philippon](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mickael.philippon/32/24097_2.png) [@mickael.philippon](https://discuss.hashicorp.com/u/mickael.philippon)\
**Post date:** [September 20, 2023, 5:27pm UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/6 "2023-09-20T17:27:00Z")

</div>

Hi Cofiem,

Thanks to answer me first of all, but i did not understand well the issue .  
How the problem is fixed ?  
I am in ansible 2.15.4 and Python 3.9.17 and i 've still the problem

Regards  
Mickaël

---

<div class="post-metadata">

**Author:** ![cofiem](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/cofiem/32/32735_2.png) [@cofiem](https://discuss.hashicorp.com/u/cofiem)\
**Post date:** [September 20, 2023, 10:25pm UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/7 "2023-09-20T22:25:33Z")

</div>

Hi Mickael,

It looks like the [commit](https://github.com/ansible/ansible/commit/dd79c49a4de3a6dd5bd9d31503bd7846475e8e57) is not yet in a release / tag.

---

<div class="post-metadata">

**Author:** ![mickael.philippon](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mickael.philippon/32/24097_2.png) [@mickael.philippon](https://discuss.hashicorp.com/u/mickael.philippon)\
**Post date:** [September 21, 2023, 7:06am UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/8 "2023-09-21T07:06:54Z")

</div>

Hi Cofiem,

Ok it’s on the devel branch thanks again.

Regards  
Mickaël

---

<div class="post-metadata">

**Author:** ![cofiem](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/cofiem/32/32735_2.png) [@cofiem](https://discuss.hashicorp.com/u/cofiem)\
**Post date:** [October 30, 2023, 12:05am UTC](https://discuss.hashicorp.com/t/packer-v1-8-5-takes-almost-three-times-the-build-time-compared-to-v1-8-0/48238/9 "2023-10-30T00:05:26Z")

</div>

It looks like the fix for this issue is included in ansible [v2.14.11](https://github.com/ansible/ansible/releases/tag/v2.14.11) and [v2.15.5](https://github.com/ansible/ansible/releases/tag/v2.15.5). However, the fix introduced [an error loading custom filters](https://github.com/ansible/ansible/pull/82002), so watch out for that if you’re using custom filters.
