
The recommended solution for this is to “pre-bake” your environment into a box, and then reference this box in your Vagrantfile. If Vagrant development enviroments are meant to be truly disposable, and re-buildable, they should be easy to dispose and re-build. You can track progress with: aws ec2 describe-import-image-tasks The AMI will appear in your Private AMI list when it's done.Spinning up a Vagrant machine usually involves starting from a base Debian or Ubuntu image, then provisioning it with shell scripts or something like Ansible or Chef.ĭepending on how much there is to provision, this can end up taking quite a bit of time, which means there’s more of a downside to halting or destroying a running machine to save on disk space. (This part can take a long time 30 min - 1 hour).

You will use the aws ec2 import-image command for this. aws s3 cp command.ĥ.) Register the OVA as an ami. You will also reference the bucket's name for the policy.ģ.) Build a VM with VirtualBox using packer's virtualbox-iso builder and have it output an image in ova format.Ĥ.) use aws-cli with your aws account to upload the OVA to the bucket you created. You'll need this to register a private AMI. Create 'vmimport' IAM role and policy as well as X509 key and cert pair in case you don't have it. Then you can use vagrant to reference the new AMI for ec2 based development and use the vagrant-aws plugin to create new ami's out of your trusted base ami.ġ.) Create an S3 bucket for image imports.Ģ.) Set up your AWS account.

Packer doesn't have a post-processor for this unfortunately. All you need to do is clone it and tweak it for your use case.īut since you're looking for packer like I was then what you need is the virtualbox-iso builder in packer and some aws-cli commands to upload and create an AMI out of the OVA.

If you don't mind using veewee there's an awesome post using veewee instead of packer here: veewee It's all setup for CentOS. You want to install from scratch locally first and import that to ec2 as a trusted private AMI. When you say from ISO that tells me you're looking to create a trusted base VM.
