Questions tagged [packer]
Packer is a tool which automates building and provisioning of VM and Docker images.
73
questions
11
votes
1
answer
12k
views
Is there any way to provision bare-metal with Packer?
Can Packer be used to install and provision a bare metal server? Packer provides webserver with repository packages and preseed/kickstart and can run some other provision softwares(ansible,puppet, ...
9
votes
3
answers
7k
views
Passing variables to use in the preseed file for a Debian Jessie installation
Is it possible to add a variable via the boot prompt to the Debian installer, so that variable can be used in a preseed file?
In particular, I'm trying to solve the following problem:
We have a ...
7
votes
1
answer
8k
views
Packer won't correctly use private key for SSH auth in provisioning step
I use Packer to build VirtualBox images, with the Ansible provisioner to set up the images. The builder step creates a temporary user (ssh_username and ssh_password). The Ansible provisioner runs ...
6
votes
2
answers
6k
views
Active Directory, create user just for adding computers to the domain
I'm a linux admin by trade, and my new job has me managing windows servers.
I'm trying to create a windows server 2012 base image using packer. As part of the provisioning, the VM needs to be ...
6
votes
2
answers
3k
views
How to use terraform.io to change the image of a stateful server without downtime or data loss?
Say I have application servers, database servers, and a few dns-round-robin load balancers. All this powered by images created with Packer with deployment managed with Terraform. How do I change the ...
6
votes
1
answer
9k
views
cloud-init does not grow the partition nor the filesystem
I am currenty preparing OpenStack-ready images of CentOS 7 and Ubuntu 14.04.
For the "automation" I use Packer, which is provided by you with a JSON-template. Packer then starts the installation ...
5
votes
3
answers
2k
views
inconsistent `apt-get update` behaviour on official Ubuntu AWS AMI
I get various and inconsistent errors with apt on the official Ubuntu images (ami-83e769fb). I'm using Packer to build my AMI and it fails about 40% of the time. Rerunning the script succeeds.
My ...
5
votes
3
answers
13k
views
Packer unable to pack aws image into VPC
I am trying to make a packer image, but on our amazon account we DO NOT have a default VPC. It has been removed. And have been getting this error when trying to pack the image:
==> amazon-instance:...
4
votes
2
answers
16k
views
Extremely slow qemu storage performance with qcow2 images
I'm running some images using libvirt on a small Openstack cluster. Storage performance on these machines is extremely poor: my monitoring tool shows 100% utilisation (usually on writes but sometimes ...
4
votes
1
answer
131
views
Why are Puppet effects disappearing after Packer post-process?
I decided to learn Packer by putting together a FreeBSD Vagrant box. The whole setup is on GitHub. Everything works well until the post-processing stage. Actually, that stage likewise claims to ...
3
votes
3
answers
3k
views
Removing install user with Packer
When a VM is first created, it gets an install user that is used to run the provisioning. I want to remove this user at the last step because it's not necessarily secure and it's unnecessary. However, ...
3
votes
2
answers
3k
views
Packer - AWS Windows 2016 SysPrep returns exit code 1
When attempting to SysPrep an AWS Windows Server 2016 instance using Packer the following error is thrown:
Build 'amazon-ebs' errored: Script exited with non-zero exit status: 1. Allowed exit codes ...
3
votes
1
answer
416
views
Best practice for unattended upgrades on immutable servers
I use packer to build immutable Ubuntu 20.04 servers.
How can it work smoothly with unattended upgrades?
Since the image is not bundled like it was in the past the updates do not apply to new ...
3
votes
2
answers
2k
views
Sysprepping with packer.io returns exit 1, packer doesn't create AMI
I'm trying to build a Windows AMI with packer.io.
In the powershell file I have run the following command as the last command of the provisioning step:
Write-Host "Running the EC2Config.exe file ...
3
votes
0
answers
3k
views
What the best way to export a Vagrant box to OVF?
My goal was to create a Virtual Machine programmatically like you would do for a container with docker and be able to export it in an OVF.
So I used Vagrant to create the VM. Combining Vagrant and ...
3
votes
0
answers
4k
views
How to pass environment variables to packer in AWS?
I am building a custom AMI in AWS using packer and bash + salt provisioning. However, I am in need of being able to pass some variables from my local environment to the build system and I don't really ...
3
votes
0
answers
1k
views
Qemu packer ssh failed connection reset by peer
I am trying to get packer to create a qemu/kvm image. I feel like it should be fairly straightforward but my build keeps failing on ssh. Here are the relevant files
template.json:
{
"builders": [
{
...
3
votes
1
answer
3k
views
How do I set locale when building an Ubuntu Docker image with Packer?
I'm using Packer to build a Docker image based on Ubuntu 14.04, i.e., in my Packer template I have:
"builders": [{
"type": "docker",
"image": "ubuntu",
"commit": true
}],
and I build it ...
2
votes
4
answers
4k
views
Using Packer with Google Cloud and getting an SSH connection issue w/ Debian Build
Here's my Packer file.
{
"variables": {
"account_json": "{{env `packer_account_json`}}"
},
"builders": [
{
"type": "googlecompute",
"account_file": "{{user ...
2
votes
2
answers
5k
views
How to debug "Select and install software" issue with unattended Ubuntu install (14.04)
I am using Packer to build a VirtualBox image for Ubuntu 14.04. I have a Packer script here, which used to work, but then for some reason (and several VirtualBox updates later) started failing. The ...
2
votes
1
answer
860
views
Amazon Linux builds using Packer?
I've been trying to chase this down but evidently have not found the right documentation. It it possible (and how) to build Amazon Linux machines with Packer? Would this be just mirror AMI's that are ...
2
votes
1
answer
3k
views
Replace WinRM with OpenSSH on Windows for use with Ansible on AWS
Currently when running extended builds (Packer/Ansible based) on Windows we have found that WinRM has errors so frequently as to be unusable and have had to fall back to running some large build jobs ...
2
votes
1
answer
1k
views
Building an AMI using Packer with a shell provisioner
I'm trying to create an AMI (based on ubuntu; ami-2d39803a) that I can reuse for a project with the a set of components installed. I'm using packer to achieve this with a shell script that gets ...
2
votes
2
answers
954
views
Any way to re-run the chef-solo provisioner on a packer built machine?
I'm building VirtualBox machines using Packer and the chef-solo provisioner. Is there a way to re-run chef from within the VM as recipes are updated without needing to re-run packer build?
2
votes
2
answers
2k
views
Proxmox & Packer: VM quit/powerdown failed during a Packer build. Anyone have any ideas why?
I am trying to create a Proxmox VM template using Packer. However I am getting a Proxmox error saying Build 'proxmox' errored: Error converting VM to template, could not stop: VM quit/powerdown failed ...
2
votes
1
answer
1k
views
Packer failing sysprep on AWS windows 2016 AMI
Packer seems to fail at the Amazon Scripts to sysprep the machine. I have tried a bunch of different things. Putting the scripts in their own script, running, them 'inline' like many people show but ...
2
votes
1
answer
8k
views
How to create a Docker image by downloading an ISO using Packer?
It is possible to create images from scratch using Packer by downloading an ISO from the internet.
Aim: to create Docker images by downloading an ISO using Packer
Attempts
Attempt 1
It is ...
1
vote
1
answer
701
views
What is the best workflow to build and test your aws opsworks chef cookbooks locally?
For months I've been struggling to find the best workflow for building and testing my aws opsworks cookbooks locally prior to pushing to opsworks.
After a lot of stalled attempts I found a blog post ...
1
vote
1
answer
1k
views
Packer with amazon-ebs VS amazon-instance
I am looking into using Packer to generate some of our VMs, and I have been working thorough the example here. When I try to run the packer build command I get the following error:
==> amazon-ebs: ...
1
vote
2
answers
2k
views
Adding a machine to a domain fails with internal error
I've enabled winrm, disabled firewall, enable remoting, GPOs for winrm, enabled SMBv1 and completed updates first as troubleshooting but I still get the error. I can ping the DC as well.
The error I ...
1
vote
1
answer
2k
views
Packer with ansible from local works but from another server ask for root permissions
For a bit of context, I'm using packer with an ansible provisioner to create AMI images on AWS.
The relevant parts of the packer and ansible:
packer.json
"provisioners": [{
"type": "shell",
"...
1
vote
3
answers
2k
views
Can't connect to Windows EC2 instance built by Packer via SSM Agent
I'm using Packer to set up a Windows VM on the free tier of AWS EC2. The image is properly set up and I'm able to launch it, but I can't connect to it with SSM. Here's my Packer template:
{
"...
1
vote
1
answer
998
views
How to provide ssh_username when using packer to build a windows AMI
When I run packer build -var aws_access_key=$AWS_ACCESS_KEY_ID -var aws_secret_key=$AWS_SECRET_ACCESS_KEY windows-2012.json
I got this error:
1 error(s) occurred:
* An ssh_username must be ...
1
vote
1
answer
489
views
Running VMWare Workstation 14 on a VM [closed]
I have set up VMWare Workstation on a esxi 6.0 hosted VM. (Ubuntu 16.04.05)
I am trying to run some packer builds that use the specific (VMWare Workstation) hypervisor.
The builds get stuck ...
1
vote
1
answer
140
views
windows 2019 unattended install on kvm via libvirt can't find licence error
I'm trying to install windows server 2019 with autounattend.xml configuration on kvm via libvirt.
Installation fail on dialog with sign: "Can't find microsoft software license terms"
Despite ...
1
vote
0
answers
341
views
Unwanted partition after partman-auto configuration
I have an issue while i'm trying to automate the creation for my debian VM template.
I tried to create a specific disk partitioning with lvm, everything goes on correctly.
But after boot, I see that I ...
1
vote
0
answers
639
views
Force non-interactive setup on Debian/Ubuntu
I'm using packer to update an RStudio image that I maintain (https://marketplace.digitalocean.com/apps/rstudio), this is something I do for the community. The 1st script in the pipeline starts with ...
1
vote
0
answers
345
views
Run script in Windows Azure VM after launch during packer build to configure WinRM and the firewall
Background: Apparently Packer has major issues configuring WinRM on Azure VMs created from the Microsoft Windows Server publisher. This is only one of the several issues and threads I've found on this ...
1
vote
0
answers
334
views
How to end-to-end provision a virtual machine including OS on ESXi standalone using Terraform?
For a small environment I'm tasked to create automated infrastructure deployment for a couple of virtual machines running on a single ESXi host (without vCenter). The VMs should run CentOS 8 and I ...
1
vote
1
answer
175
views
OpenVPN AMI's built with packer incorrectly use the old public IP from the build in generated config files
When I build AMI's using Hashicorp Packer, based off the AWS OpenVPN AMI, the public ip address from the first instance performing the build will persist in later usage of the AMI when it should ...
1
vote
0
answers
638
views
Heisenbug: ansible.windows.win_user fails with "Illegal operation attempted on a registry key that has been marked for deletion."
Using Packer to build an AMI based on Windows Server 2019, and Ansible as provisioner.
This is the provisioners part of my packer-build.json:
"provisioners": [
{
&...
1
vote
1
answer
267
views
Partially Immutable infrastructure in AWS with Packer?
I'm a very young systems engineer/contractor sysadmin with a bandwidth-heavy workload that just moved to an area where I get 2mbps download and 20 upload on my internet connection. I'm moving my ...
1
vote
1
answer
1k
views
Packer errors with qemu-system-aarch64
I have some success creating Vagrant base boxes with Packer for x86 and x86_64 guests, including VirtualBox, VMware, and qemu hypervisors. Now, I want to start making ARM guests with Packer and qemu, ...
1
vote
0
answers
1k
views
Packer Works Locallly but fails in Gitlab CI/CD w/ executable file not found in $PATH
Here is a snippet of my JSON file for packer. Pretty much running packer build example.json via adhoc - it works smoothly and builds the AMI out in AWS. When i execute this in my GitLabCI Pipeline, it ...
1
vote
0
answers
69
views
Data disappears after launching EC2 instance from AMI
I am launching an EC2 instance out of an AMI that i am building using packer . In packer build i specify a provisioning shell script which will mount the drives as well as get some files from S3 ...
1
vote
0
answers
2k
views
Deploy packer images on bare metal server?
How can I match my dev and production bare metal box?
The hosting provider does not allow or have a process to install custom images and only provides a selection from all the latest popular ...
0
votes
2
answers
3k
views
Advices on automating installation for Debian 11
I'm currently trying to automate Debian 11 template creation through Packer for Nutanix environment and need some advices about preseeding/automating Debian installation.
First of all, after reading ...
0
votes
1
answer
446
views
journalctl stops working randomly after boot on DigitalOcean droplet
I am building servers from a custom image I made using Packer on DigitalOcean, and I'm having a recurring issue where journalctl doesn't have any logs:
# journalctl
No journal files were found.
...
0
votes
1
answer
2k
views
Disconnected NIC on customized & deployed Ubuntu 18.04 templates
Within my vSphere 6.7 U3 environment, I have an Ubuntu 18.04 template generated by packer which I am then using Terraform to deploy two copies of. I am running into an issue where the deployed VMs ...
0
votes
1
answer
39
views
Where does Packer look for scripts?
I have a packer template that I'm trying to run. It generally does what I want it to do in that it creates an Azure VM, generalizes it and uploads it to a compute gallery. I'm now trying to expand it ...