Issue when customizing cloud-init images on Proxmox 9
I upgraded to Proxmox 9
in the homelab last year without any noticeable issues. It was only when I
started the upgrade process of my Ansible playbook for the Proxmox hosts
that I ran into problems. The role for creating cloud-init VM templates failed
during the task which installs the qemu-guest-agent:
- name: Install qemu-guest-agent in all images in directory "{{ pvesm_local_storage_path }}/{{ pvesm_local_storage_iso_subpath }}"
loop: "{{ iso_images_to_download }}"
ansible.builtin.command: |
virt-customize \
-a "{{ pvesm_local_storage_path }}/{{ pvesm_local_storage_iso_subpath }}/{{ item.filename }}" \
--install qemu-guest-agent
Error messages indicated DNS problems, similar to those in
this forum post. There is already a
GitHub issue on this in
libguestfs. A suggested solution is to install dhcpcd-base prior to running
virt-customize. I added it to the playbook:
- name: Install dhcpcd-base
ansible.builtin.apt:
name: dhcpcd-base
- name: Install qemu-guest-agent in all images in directory "{{ pvesm_local_storage_path }}/{{ pvesm_local_storage_iso_subpath }}"
loop: "{{ iso_images_to_download }}"
ansible.builtin.command: |
virt-customize \
-a "{{ pvesm_local_storage_path }}/{{ pvesm_local_storage_iso_subpath }}/{{ item.filename }}" \
--install qemu-guest-agent
And then I had a working VM template again:

Resources: