Skip to content
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

Creating Proxmox VMs Fails Agent Wrong Format #5360

Closed
1 task done
fritterhoff opened this issue Oct 14, 2022 · 5 comments
Closed
1 task done

Creating Proxmox VMs Fails Agent Wrong Format #5360

fritterhoff opened this issue Oct 14, 2022 · 5 comments
Labels
bug This issue/PR relates to a bug cloud module module plugins plugin (any type) traceback

Comments

@fritterhoff
Copy link

Summary

Creating new proxmox vms fails due to wrong ansible agent format.

Issue Type

Bug Report

Component Name

proxmox_kvm

Ansible Version

ansible --version
ansible [core 2.13.5]
  config file = /Users/florian/sources/server-deployment/ansible.cfg
  configured module search path = ['/Users/florian/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/florian/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)]
  jinja version = 3.1.2
  libyaml = True

Community.general Version

ansible-galaxy collection list community.general

# /Users/florian/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 5.7.0

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

- name: Test
  hosts: 
    - proxmox-hw08
  tasks:
    - name: Create VM
      proxmox_kvm: 
        name: test
        node: proxmox-hw08
        api_host: "{{ pm_api_url }}"
        proxmox_default_behavior: no_defaults
        api_user: "{{ pm_user }}"
        api_token_id: "{{ pm_token_id }}"
        api_token_secret: "{{ pm_token_secret }}"
        agent: true

Expected Results

VM gets created

Actual Results

The full traceback is:
  File "/tmp/ansible_proxmox_kvm_payload_t6g0fl_7/ansible_proxmox_kvm_payload.zip/ansible_collections/community/general/plugins/modules/cloud/misc/proxmox_kvm.py", line 1252, in main
  File "/tmp/ansible_proxmox_kvm_payload_t6g0fl_7/ansible_proxmox_kvm_payload.zip/ansible_collections/community/general/plugins/modules/cloud/misc/proxmox_kvm.py", line 1018, in create_vm
  File "/usr/local/lib/python3.9/dist-packages/proxmoxer/core.py", line 155, in create
    return self.post(*args, **data)
  File "/usr/local/lib/python3.9/dist-packages/proxmoxer/core.py", line 146, in post
    return self(args)._request("POST", data=data)
  File "/usr/local/lib/python3.9/dist-packages/proxmoxer/core.py", line 123, in _request
    raise ResourceException(
fatal: [proxmox-hw08]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "acpi": null,
            "agent": "1",
            "api_host": "<REDACTED>",
            "api_password": null,
            "api_token_id": "Ansible",
            "api_token_secret": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "api_user": "<REDACTED>",
            "args": null,
            "autostart": null,
            "balloon": null,
            "bios": null,
            "boot": null,
            "bootdisk": null,
            "cicustom": null,
            "cipassword": null,
            "citype": null,
            "ciuser": null,
            "clone": null,
            "cores": null,
            "cpu": null,
            "cpulimit": null,
            "cpuunits": null,
            "delete": null,
            "description": null,
            "digest": null,
            "efidisk0": null,
            "force": null,
            "format": null,
            "freeze": null,
            "full": true,
            "hostpci": null,
            "hotplug": null,
            "hugepages": null,
            "ide": null,
            "ipconfig": null,
            "keyboard": null,
            "kvm": null,
            "localtime": null,
            "lock": null,
            "machine": null,
            "memory": null,
            "migrate_downtime": null,
            "migrate_speed": null,
            "name": "test",
            "net": null,
            "newid": null,
            "node": "proxmox-hw08",
            "numa": null,
            "numa_enabled": null,
            "onboot": null,
            "ostype": null,
            "parallel": null,
            "pool": null,
            "protection": null,
            "proxmox_default_behavior": "no_defaults",
            "reboot": null,
            "revert": null,
            "sata": null,
            "scsi": null,
            "scsihw": null,
            "serial": null,
            "shares": null,
            "skiplock": null,
            "smbios": null,
            "snapname": null,
            "sockets": null,
            "sshkeys": null,
            "startdate": null,
            "startup": null,
            "state": "present",
            "storage": null,
            "tablet": null,
            "tags": null,
            "target": null,
            "tdf": null,
            "template": null,
            "timeout": 30,
            "update": false,
            "validate_certs": false,
            "vcpus": null,
            "vga": null,
            "virtio": null,
            "vmid": null,
            "watchdog": null
        }
    },
    "msg": "creation of qemu VM test with vmid 197 failed with exception=400 Bad Request: Parameter verification failed. - {'agent': \"invalid format - format error\\nagent.enabled: type check ('boolean') failed - got 'True'\\n\"}",
    "vmid": "197"
}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

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

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug cloud module module plugins plugin (any type) traceback labels Oct 14, 2022
@spike77453
Copy link
Contributor

Ran into this as well. git blame spits out this commit: 0be7b6e
I checked and it works as as expected when reverting the change,

@felixfontein
Copy link
Collaborator

See also #5198.

@ansibullbot
Copy link
Collaborator

Files identified in the description:

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

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud module module plugins plugin (any type) traceback
Projects
None yet
Development

No branches or pull requests

4 participants