ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
814 stars 1.49k forks source link

proxmox_kvm: VM created with OVMF BIOS are invalid #1638

Closed jqueuniet closed 2 years ago

jqueuniet commented 3 years ago
SUMMARY

EFI virtual machines created with proxmox_kvm don't work, the EFI disk is missing and the boot order is missing the disks.

ISSUE TYPE
COMPONENT NAME

proxmox_kvm

ANSIBLE VERSION
ansible 2.10.4
  config file = /home/johann/blade/ansible/ansible.cfg
  configured module search path = ['/home/johann/blade/ansible/library/modules', '/home/johann/blade/ansible/.imported_roles/lae.proxmox/library']
  ansible python module location = /home/johann/.local/lib/python3.9/site-packages/ansible
  executable location = /home/johann/.local/bin/ansible
  python version = 3.9.1+ (default, Jan 10 2021, 15:42:50) [GCC 10.2.1 20201224]

❯ ansible-galaxy collection list

# /home/johann/blade/ansible/.imported_collections/ansible_collections
Collection           Version
-------------------- -------
ansible.netcommon    1.4.1  
ansible.posix        1.1.1  
community.general    1.3.3  
community.kubernetes 1.1.1  
google.cloud         1.0.1  
netbox.netbox        1.2.0  
CONFIGURATION
CACHE_PLUGIN(/home/johann/blade/ansible/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/home/johann/blade/ansible/ansible.cfg) = /tmp/facts_cache
CACHE_PLUGIN_TIMEOUT(/home/johann/blade/ansible/ansible.cfg) = 7200
COLLECTIONS_PATHS(/home/johann/blade/ansible/ansible.cfg) = ['/home/johann/blade/ansible/.imported_collections', '/home/johann/.ansible/coll>
COMMAND_WARNINGS(/home/johann/blade/ansible/ansible.cfg) = True
DEFAULT_BECOME(/home/johann/blade/ansible/ansible.cfg) = False
DEFAULT_FILTER_PLUGIN_PATH(/home/johann/blade/ansible/ansible.cfg) = ['/home/johann/blade/ansible/library/filters']
DEFAULT_FORKS(/home/johann/blade/ansible/ansible.cfg) = 10
DEFAULT_GATHERING(/home/johann/blade/ansible/ansible.cfg) = smart
DEFAULT_LOOKUP_PLUGIN_PATH(/home/johann/blade/ansible/ansible.cfg) = ['/home/johann/blade/ansible/library/lookup']
DEFAULT_MODULE_PATH(/home/johann/blade/ansible/ansible.cfg) = ['/home/johann/blade/ansible/library/modules', '/home/johann/blade/ansible/.im>
DEFAULT_MODULE_UTILS_PATH(/home/johann/blade/ansible/ansible.cfg) = ['/home/johann/blade/ansible/.imported_roles/lae.proxmox/module_utils']
DEFAULT_ROLES_PATH(/home/johann/blade/ansible/ansible.cfg) = ['/home/johann/blade/ansible/.imported_roles', '/home/johann/blade/ansible/role>
DEPRECATION_WARNINGS(/home/johann/blade/ansible/ansible.cfg) = True
HOST_KEY_CHECKING(/home/johann/blade/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/home/johann/blade/ansible/ansible.cfg) = auto_legacy_silent
SYSTEM_WARNINGS(/home/johann/blade/ansible/ansible.cfg) = True
TRANSFORM_INVALID_GROUP_CHARS(/home/johann/blade/ansible/ansible.cfg) = silently
OS / ENVIRONMENT

Targeted Proxmox server is running 6.3-3

STEPS TO REPRODUCE
- name: Create KVM instances
  proxmox_kvm:
    api_host: "{{ proxmox.api_host }}"
    api_user: "root@pam"
    api_password: "{{ proxmox.password }}"
    state: present
    name: "{{ item.name }}"
    description: "{{ item.description }}"
    node: "{{ item.node }}"
    boot: "cn"
    ostype: "{{ item.ostype }}"
    cores: "{{ item.cpu_cores }}"
    memory: "{{ item.memory }}"
    balloon: 0
    net: "{{ item.net | items2dict }}"
    scsi: "{{ item.disks }}"
    scsihw: virtio-scsi-pci
    agent: yes
    bios: ovmf
    machine: q35
    vga: qxl
    serial: '{"serial0": "socket"}'
    cpu: "{{ proxmox.cpu_type }}"
    cpuunits: 1000
    kvm: yes
    acpi: yes
    autostart: yes
  loop: "{{ proxmox_admin_kvm }}"
proxmox:
  api_user: automation@pve
  api_password: YYYYYYYYYY
  api_host: XXXXXXXXXXXXX
  node: XXXX
  searchdomain: "{{ ansible_domain }}"
  password: ZZZZZZZZZZZZ
  cpu_type: EPYC

proxmox_admin_kvm:
- name: smtp1
  description: SMTP relay
  ostype: l26
  node: XXXX
  cpu_cores: 1
  memory: 1024
  net:
    - key: net0
      value: virtio,bridge=vmbr101
  disks: {"scsi0": "local:15,format=qcow2"}

I stripped the bootstrap part, but short story, we're using qemu args to start debian-installer images with direct boot and preseed parameters.

EXPECTED RESULTS

VM is created with a valid specification

ACTUAL RESULTS

The VM specification has two issues:

ansibullbot commented 3 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 years ago

cc @Aversiste @Thulium-Drake @helldorado @joshainglis @karmab click here for bot help

ansibullbot commented 2 years ago

cc @Ajpantuso click here for bot help