Packer: Azure Packer Images >> Multiple Regions

Created on 25 Apr 2018  路  10Comments  路  Source: hashicorp/packer

Hello,

Is there any chance that we could get the same functionality that is offered with ami_regions added into packer-azure? https://www.packer.io/docs/builders/amazon-ebs.html#ami_regions

Customers that are in multiple regions on azure today have to build a image in each region and update images in each region which is a extreme amount of overhead. Having the ability to create the image once and then having packer copy that image would be HUGE!

Thank you,
Brandon

buildeazure enhancement

Most helpful comment

Same issue for Azure subscriptions.
It would be very useful to have the ability to output the captured image to multiple subscriptions.

We are unable to do after the fact because the image's source VM and source disk(s) are deleted by Packer, so we cannot even use a snapshot as an intermediary artifact which we would copy to other subscriptions.

All 10 comments

Same issue for Azure subscriptions.
It would be very useful to have the ability to output the captured image to multiple subscriptions.

We are unable to do after the fact because the image's source VM and source disk(s) are deleted by Packer, so we cannot even use a snapshot as an intermediary artifact which we would copy to other subscriptions.

Agreed. This would be a very useful feature. To be able to export an up to date image to both a prod and non-prod subscription.

Since, as mentioned above, these cannot be copied once the source vm has been deleted.

any progress for this?

As a workaround, we can use this new Azure service/feature :
Shared Image Gallery
This allows to share managed images across multiple subscriptions and replicate them to specified regions.
Note : not all regions are available right now (see link above for the list of regions).

@MathieuBuisson - My understanding is that Packer doesn't support writing directly to Shared Image Gallery. Has that been fixed?

Hi @rohrerb ,
I haven't actually tried it.
As Packer doesn't know anything about this new Azure feature, I suspect that Packer can create a managed image used as a base image for creating "shared image versions".

But I don't think Packer can help you for anything beyond that, meaning : you would need to create shared image versions yourself.

Correct. There is no explicit support in Packer for publishing, but Shared Image Gallery appears to be the best way to achieve a multi region image. Packer can consume Shared Image Gallery images, but not publish.

I recommend you use the shell post-processor, and publish the your managed image until there is explicit support. See the Shared Image Gallery announcement for details.

Thank you @boumenot . When do we anticipate explicit support?

I have no ETA to share at this time.

I tried using the az image copy extension, but it fails because that extension depends on the source disk, which is deleted by Packer, to create the snapshot before copying to target regions and creating a new managed image there from the snapshot. I'm able to perform the copy if I do packer build -debug and pause before deleting the temporary resources. I'm still looking for a way to automate this because -debug is interactive. The image gallery looks promising.

Was this page helpful?
0 / 5 - 0 ratings