New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxmox builder - Error getting SSH address 500 QEMU guest agent is not running #91
Comments
I don't know if you found a solution to the problem already if not, but packer is not able to determine the VMs IP address.
For the 1st solution, you tell Packer the VMs IP manually by setting the As for the 2nd solution I recommend reading about how to use |
I agree with @paginabianca . To be honest I find the second option the easiest. There are several repo's here on github that should get you a working setup. |
@paginabianca (Andreas) thanks for your comments. There are a couple of issues that I have been wrestling with that impact your suggested options. When Proxmox launches the VMs, they obtain their IP via DHCP. I don't want to have a fixed IP because that has implications for other automated provisioning. So setting ssh_host isn't really an option I don't think. I did try exactly that at one point but the IP I set didn't actually get assigned so I will try your suggestion for setting the mac_address in network_adapters. I might come back to this one if option 2 continues to be problematic. The VMs I am launching are Ubuntu 20.04 which has deprecated preseed in favour of autoinstall (which IMO is a cleaner approach). I have tried configuring cloud-config to install the qemu-guest-agent following some other examples but this has been unsuccessful to-date (see below). TBH, I have tried so many variants its hard to remember them all, but if you can see anything else that is missing or shouldn't be there I can give it another try ? Right now I'm using Terraform to do all the provisioning at launch time using a very basic base image. That works fine however there are a few things that I would prefer to bake at build time (the un-ending debate around build vs. launch-time provisioning aka: bake vs. fry) Kind Regards Fraser
|
Hi @goffinf
You may continue to get the same error at first run time. If you are sure that Qemu_agent is installed in the VM and the service is started, you should see that the IP part changes after a while when you check it through proxmox. |
For anyone who stumbles upon this exact issue, I've managed to get it to work with I'll include the minimal reproduction code below, starting with the packer template {
"variables": {
"proxmox_template_name": "ubuntu-20.04",
"ubuntu_iso_file": "ubuntu-20.04.3-live-server-amd64.iso"
},
"builders": [{
"type": "proxmox",
"proxmox_url": "<fill_out_your_url>:8006/api2/json",
"username": "{{ user `proxmox_username` }}",
"password": "{{ user `proxmox_password` }}",
"node": "proxmox",
"network_adapters": [{
"bridge": "vmbr0"
}],
"disks": [{
"type": "scsi",
"disk_size": "20G",
"storage_pool": "local-lvm",
"storage_pool_type": "lvm"
}],
"iso_file": "local:iso/{{ user `ubuntu_iso_file` }}",
"unmount_iso": true,
"boot_wait": "5s",
"memory": 8192,
"cores": 4,
"scsi_controller": "virtio-scsi-single",
"qemu_agent": true,
"template_name": "{{ user `proxmox_template_name` }}",
"http_directory": "http",
"boot_command": [
"<esc><wait><esc><wait><f6><wait><esc><wait>",
"<bs><bs><bs><bs><bs>",
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ",
"-- <enter>"
],
"ssh_username": "ubuntu",
"ssh_password": "ubuntu",
"ssh_timeout": "20m"
}],
"provisioners": [{
"type": "shell",
"inline": [
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Awaiting cloud-init...'; sleep 1; done"
]
}]
} Create {
"proxmox_username": "packer@pve",
"proxmox_password": "<your_password>"
} Create the #cloud-config
autoinstall:
version: 1
locale: en_US
keyboard:
layout: eu
identity:
hostname: ubuntu-server
username: ubuntu
password: "$6$FhcddHFVZ7ABA4Gi$9ME1/XEiFHYx8Qh01w6CPqZZE7EDSf2tOc9Ugs89beYrUMyCyCxXzyBovoRwjN/6ipRnxCKeG/3PmJb1zvMAp/"
ssh:
install-server: true
allow-pw: true
packages:
- qemu-guest-agent
late-commands:
- curtin in-target --target=/target -- systemctl start qemu-guest-agent
- curtin in-target --target=/target -- systemctl enable qemu-guest-agent Run with The important part are the I hope that helps someone :) |
@oliviermichaelis ITS WORKING mAN! you made my day thnax |
I've got the same problem as described by @goffinf I tried serving the I stumbled on this issue by doing some research which might be interesting, but honestly I tried so much things that I don't really know what to do anymore |
For those interested, I found a workaround for provisioning the auto-install files to Ubuntu 20.04 without using Packer HTTP server.
Of course the downside of this, is that each time you need to tweak your |
God this one took me forever to solve... thank you @oliviermichaelis for the late-commands hint! @m4dh4t tipped me off to this. Spin up a full Ubuntu VM somewhere and run packer from there. Works like a charm. As to why WSL wont host the http folder? No idea. Windows Firewall? Too happy its working to try to figure it out edit: This thread probably holds the answer: hashicorp/packer#10168 |
Did you find a solution on this? |
@AntonioBriPerez for me the problem was that the server couldn't reach the host packer was running from (it was connected trough a VPN). I created a bastion host in my Proxmox environment and ran packer from there. |
hashicorp/packer#9115
This issue relates to much of the discussion in the one linked above, however, at present I have a very specific issue which I think is worth separating out.
Packer version:
Builder: proxmox
Proxmox version:
I am trying to run a Packer build using the ubuntu-20.04-live-server-amd64.iso, but when the boot_command runs the build just hangs waiting to get an SSH connection to the launched instance. When the ssh_timeout is reached the build fails and the VM is destroyed.
The Packer log reports that the SSH address cannot be obtained because the QEMU guest agent isn't running. Clearly that is not installed on a fresh ISO. I also set the communicator to ssh, disabled the qemu_agent, and configured an alternate ssh_port, so I'm not sure why this is happening ?
packer log:
build times-out:
From the related thread:
I have tried using a different ssh_port (2222 in the example below), but that had no effect.
For completeness, the boot_command, does result in the newly launched VM entering the correct autoinstall process (rather than the standard install dialogue) as evidenced by the following screen shots taken during a Packer debug build:
I have copied the complete Packer build file and the user-data below.
Any guidance on how to ensure that the Packer build uses ssh rather than the qemu agent would be much appreciated (or anything else you think might be the culprit).
Kind Regards
Fraser.
host.json:
user-data:
The text was updated successfully, but these errors were encountered: