aphexlog
aphexlog

Reputation: 1775

Building out custom images (not just pulling a prebuilt image) in a cloud agnostic manor

I need to be able to build my own images using {some_tool} alongside Terraform. I had been looking into using packer for this, but it seems to me that it just pulls a prebuilt AMI and configures it.

Basically, I need to build a windows or Linux OS image that will build then deploy with Terraform on any cloud (AWS, VMWARE, OCI, Google, where ever).

Looking for a tool to use this way. Also, I'm not sure how packer is necessary alongside Terraform sense it seems to me that Terraform has the same exact built-in functionality.

Thanks all :)

Upvotes: 0

Views: 514

Answers (2)

Rickard von Essen
Rickard von Essen

Reputation: 4278

it seems to me that it just pulls a prebuilt AMI and configures it.

You can build AMI's from scratch with the amazon-ebssurrogate or amazon-chroot builders or use any of the local builders and the amazon-import post-processor, but all these options require a lot of understanding of the prerequisites of running the OS on AWS and how to automatically install it from scratch.

Basically, I need to build a windows or Linux OS image that will build then deploy with Terraform on any cloud (AWS, VMWARE, OCI, Google, where ever).

There is no such thing a cloud agnostic images. Each cloud requires the correct kernel options, drivers, and tools installed to operate optimally or even at all.

I'm not sure how packer is necessary alongside Terraform sense it seems to me that Terraform has the same exact built-in functionality.

A big difference is that Terraform doesn't handle the lifecycle of creating a AMI. Terraform is not a good tool for creating images from source code, that isn't what it was built for. HashiCorp created these two tools to complement each other.

Upvotes: 0

VimalKumar
VimalKumar

Reputation: 1850

Hashcorp's Packer is the perfect tool for this. We build various machine images and deploy them to AWS. Basically packer boots an instance (using the provided base image) in the selected provider, installs the dependencies/requirements as mentioned in your provisioner and create the final image out of it.

So to start the instance, it needs a base image to start with.. So the issue that you mentioned is not an issue at all and it is the way tool works. Hope it helps.

Upvotes: 1

Related Questions