Skip to content

proxmox: module is trying to start an already started instance #9696

Open
@chemnic

Description

Summary

I upgraded to version 10.3 from 8.6, and now the the proxmox module fails
when state=started and instance is already started.

I tried with 10.3 and main branch.

Issue Type

Bug Report

Component Name

proxmox

Ansible Version

ansible [core 2.18.2]
  config file = /home/chestrada/repos/vfmsa_ansible/ansible.cfg
  configured module search path = ['/home/chestrada/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/chestrada/py_ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /home/chestrada/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/chestrada/py_ansible/bin/ansible
  python version = 3.11.11 (main, Dec  4 2024, 08:55:08) [GCC 9.4.0] (/home/chestrada/py_ansible/bin/python)
  jinja version = 3.1.5
  libyaml = True

Community.general Version

# /home/chestrada/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 10.4.0 

# /home/chestrada/py_ansible/lib/python3.11/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 10.3.0 

Configuration

CACHE_PLUGIN(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = ~/ansible_cache_vfmsa
CACHE_PLUGIN_TIMEOUT(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = 3600
CONFIG_FILE() = /home/chestrada/repos/vfmsa_ansible/ansible.cfg
DEFAULT_CALLBACK_PLUGIN_PATH(env: ANSIBLE_CALLBACK_PLUGINS) = ['/home/chestrada/py_ansible/lib/python3.11/site-packages/ara/plugins/callback']
DEFAULT_FILTER_PLUGIN_PATH(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = ['/home/chestrada/repos/chem/ansible/plugins/filter', '/home/chestrada/repos/v>
DEFAULT_FORKS(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = 20
DEFAULT_GATHERING(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = smart
DEFAULT_INTERNAL_POLL_INTERVAL(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = 0.001
DEFAULT_LOOKUP_PLUGIN_PATH(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = ['/home/chestrada/repos/chem/ansible/plugins/lookup']
DEFAULT_PRIVATE_KEY_FILE(env: ANSIBLE_PRIVATE_KEY_FILE) = /home/chestrada/.ssh/ansible
DEFAULT_REMOTE_USER(env: ANSIBLE_REMOTE_USER) = admin_remote
DEFAULT_ROLES_PATH(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = ['/home/chestrada/repos/vfmsa_roles', '/home/chestrada/repos/chem_roles', '/home/chest>
DEFAULT_TIMEOUT(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = 50
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/chestrada/.ansible_vault_vfmsa
DIFF_ALWAYS(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = True
EDITOR(env: EDITOR) = vim
HOST_PATTERN_MISMATCH(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = ignore
INJECT_FACTS_AS_VARS(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = False
INVENTORY_CACHE_ENABLED(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = True
PERSISTENT_COMMAND_TIMEOUT(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = 200
PERSISTENT_CONNECT_TIMEOUT(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = 200
RETRY_FILES_SAVE_PATH(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = /home/chestrada/.ansible-retry
USE_PERSISTENT_CONNECTIONS(/home/chestrada/repos/vfmsa_ansible/ansible.cfg) = True

OS / Environment

Target server: Proxmox 8.3.3

Controller: Ubuntu 20.04

Steps to Reproduce

- name: Make sure LXC container is started
  community.general.proxmox:
    api_host: 192.168.1.11"
    api_user: root@pam
    api_password: somepassword
    validate_certs: false
    state: started
    vmid: 924
  delegate_to: localhost

Expected Results

Ansible should be idempotent and not fail when the instance is already started.

Actual Results

fatal: [test1 -> localhost]: FAILED! => 
    changed: false
    msg: 'An error occurred: 500 Internal Server Error: CT 924 already running'

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions