title: Ansible to Proxmox returning 500 error
body: <p>I am trying to use Ansible to provision some VMs on my newly set up Proxmox VE. I have installed proxmoxer and request with PIP on both my local Mac and Proxmox VE (Python 2 on Proxmox and Python 3 locally). I use Ansible 2.4.3.0, Proxmox version: 5.1-41.</p>
  
  <p>I do have a vm with the id of 100, which was created from a Debian template, the vm is located on <code>local-lvm (pve)</code>.</p>
  
  <p>My full playbook can be found at: <a href="https://github.com/atwright147/ansible-contact-book-proxmox-provisioner" rel="nofollow noreferrer">https://github.com/atwright147/ansible-contact-book-proxmox-provisioner</a>, the specific task is pasted below:</p>
  
  <pre><code>---
  - proxmox_kvm:
      api_user: root@pam
      api_password: REDACTED
      api_host: pve
      vmid: 100
      state: current
  </code></pre>
  
  <p>When running this script via: <code>ansible-playbook -vvv --connection=local -i hosts site.yml</code> I get the following error:</p>
  
  <pre><code>The full traceback is:
  File "/tmp/ansible_TDEJsZ/ansible_module_proxmox_kvm.py", line 1227, in main
      current = getattr(proxmox.nodes(vm[0]['node']), VZ_TYPE)(vmid).status.current.get()['status']
  File "/usr/local/lib/python2.7/dist-packages/proxmoxer/core.py", line 84, in get
      return self(args)._request("GET", params=params)
  File "/usr/local/lib/python2.7/dist-packages/proxmoxer/core.py", line 79, in _request
      resp.content))
  
  fatal: [192.168.0.22]: FAILED! =&gt; {
      "changed": false,
      "invocation": {
          "module_args": {
              "acpi": true,
              "agent": null,
              "api_host": "pve",
              "api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
              "api_user": "root@pam",
              "args": null,
              "autostart": false,
              "balloon": 0,
              "bios": null,
              "boot": "cnd",
              "bootdisk": null,
              "clone": null,
              "cores": 1,
              "cpu": "kvm64",
              "cpulimit": null,
              "cpuunits": 1000,
              "delete": null,
              "description": null,
              "digest": null,
              "force": null,
              "format": "qcow2",
              "freeze": null,
              "full": true,
              "hostpci": null,
              "hotplug": null,
              "hugepages": null,
              "ide": null,
              "keyboard": null,
              "kvm": true,
              "localtime": null,
              "lock": null,
              "machine": null,
              "memory": 512,
              "migrate_downtime": null,
              "migrate_speed": null,
              "name": null,
              "net": null,
              "newid": null,
              "node": null,
              "numa": null,
              "numa_enabled": null,
              "onboot": true,
              "ostype": "l26",
              "parallel": null,
              "pool": null,
              "protection": null,
              "reboot": null,
              "revert": null,
              "sata": null,
              "scsi": null,
              "scsihw": null,
              "serial": null,
              "shares": null,
              "skiplock": null,
              "smbios": null,
              "snapname": null,
              "sockets": 1,
              "startdate": null,
              "startup": null,
              "state": "current",
              "storage": null,
              "tablet": false,
              "target": null,
              "tdf": null,
              "template": false,
              "timeout": 30,
              "update": false,
              "validate_certs": false,
              "vcpus": null,
              "vga": "std",
              "virtio": null,
              "vmid": 100,
              "watchdog": null
          }
      },
      "msg": "Unable to get vm None with vmid = 100 status: 500 Internal Server Error: {\"data\":null}"
  }
  </code></pre>
  
  <p>Ansible info:</p>
  
  <pre><code>ansible 2.4.3.0
    config file = /Users/andy/Development/proxmox-playbooks/contact-book/ansible.cfg
    configured module search path = ['/Users/andy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
    executable location = /usr/local/bin/ansible
    python version = 3.6.4 (default, Jan 25 2018, 18:48:20) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.38)]
  </code></pre>
  
  <p>What am I doing wrong?</p>