We’re encountering an issue while using Packer to build and capture a VHD image in Azure.

Anonymous
2025-10-30T08:16:26.05+00:00

Hi,

We’re encountering an issue while using Packer to build and capture a VHD image in Azure. The process runs for several hours and eventually fails with the following error:

failed to capture OS Disk with err : failed to copy to storage with err : error copying: waiting for file to copy: context deadline exceeded

We’ve tried several steps to resolve this, including:

  • Increasing the waiting timeout (up to 3 hours)

Reducing the VHD size

Testing with a premium storage account

In each case, the build starts successfully, and the image appears in the storage container with the expected size. However, after a few minutes, the size drops to 0 bytes, and the process eventually times out with the error above.

Could you please help us identify the root cause and suggest a fix for this issue?

Here are a few details for reference:

Storage account: h2ovhdimages

Container: vhds

Resource group: H2OIMAGES

Region: East US

  • VM size used for build: Standard

Thank you

Azure Storage
Azure Storage

Globally unique resources that provide access to data management services and serve as the parent namespace for the services.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.