ansible-collections / community.general

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

community.proxmox_kvm #8847

Open Xyz00777 opened 2 months ago

Xyz00777 commented 2 months ago

Summary

when i want to do an full clone operation from one vm to a new one and the cloning task takes too long, like more than (it feels like 30 sec) than the tasks failes with the following message based on slow drives: "msg": "Reached timeout while waiting for creating VM. Last line in task before timeout: [{'n': 1, 't': 'create full clone of drive efidisk0 (local-lvm:vm-9002-disk-0)'}]"

Issue Type

Bug Report

Component Name

community.proxmox_kvm

Ansible Version

$ ansible --version
ansible [core 2.14.16]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 9.3.0  

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 6.6.2

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

debian 12

Steps to Reproduce

    - name: Clone VM from template
      proxmox_kvm:
        api_user: "{{ user }}"
        api_password: "{{ password }}"
        api_host: "127.0.0.1"
        api_port: "8006"
        node: "ds9"
        newid: "{{ item.vm_newid }}"
        clone: "{{ item.template_name }}"
        name: "{{ item.vm_name }}"
        full: true
        storage: "{{ item.vm_storage }}"
        state: 'present'
      loop: "{{ vm_list }}"
      register: clone_tasks
      timeout: 500

Expected Results

it should wait until the task is really finished or the timeout option who is used with clone in the documentation examples should be working.... i even used local connection 127.0.0.1 so it cant be a network connection problem....

Actual Results

TASK [Clone VM from template if not exists] ********************************************************************************************************************************
task path: /root/ansible/pve.yml:168                                                                                                                                        
redirecting (type: modules) ansible.builtin.proxmox_kvm to community.general.proxmox_kvm                                                                                    
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root                                                                                                                       
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'                                                                                                                         
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1725810416.6395702-4006357-54424961610532 `" && echo ansible-tmp-1725810416.6395702-4006357-54424961610532="` ech
o /root/.ansible/tmp/ansible-tmp-1725810416.6395702-4006357-54424961610532 `" ) && sleep 0'                                                                                 
redirecting (type: modules) ansible.builtin.proxmox_kvm to community.general.proxmox_kvm                                                                                    
Using module file /root/.ansible/collections/ansible_collections/community/general/plugins/modules/proxmox_kvm.py                                                           
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-4005721ub6drs03/tmp9_fasg56 TO /root/.ansible/tmp/ansible-tmp-1725810416.6395702-4006357-54424961610532/AnsiballZ_proxmox_kvm.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1725810416.6395702-4006357-54424961610532/ /root/.ansible/tmp/ansible-tmp-1725810416.6395702-4006357-54424961610532/AnsiballZ_proxmox_kvm.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1725810416.6395702-4006357-54424961610532/AnsiballZ_proxmox_kvm.py && sleep 0'                 
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1725810416.6395702-4006357-54424961610532/ > /dev/null 2>&1 && sleep 0'                                
failed: [localhost] (item={'vm_newid': 201, 'template_name': 'ubuntutemplate', 'vm_name': 'jellyfinai', 'vm_onboot': False, 'vm_bios': 'ovmf', 'vm_storage_size': 40, 'vm_storage': 'nocrypt-data', 'vm_hotplug': 'network,disk,cpu,memory,usb', '
vm_agent': 'true', 'vm_numa_enabled': 'true', 'vm_ostype': 'l26', 'vm_memory': 10240, 'vm_balloon': 1024, 'vm_cores': 10, 'vm_cpu': 'host', 'vm_machine': 'q35,viommu=virtio', 'ciuser': 'adm-jellyfin', 'cipassword': 'XXXX', 'vm_net': {'net0': 
'bridge=vmbr0,tag=200,virtio=DE:AD:BE:EF:00:03'}, 'sshkeys': None, 'vm_hostpci': {'hostpci0': 'mapping=intelarc770,pcie=1,rombar=1'}}) => {                                  
    "ansible_loop_var": "item",                                                                                                                                             
    "changed": false,                                                                                                                                                       
    "invocation": {                                                                                                                                                         
        "module_args": {                                                                                                                                                    
            "acpi": null,
            "agent": null, 
            "api_host": "127.0.0.1",
            "api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",                                                       
            "api_port": 8006,
            "api_token_id": null,   
            "api_token_secret": null,                                                 
            "api_user": "root@pam",
            "archive": null,     
            "args": null,            
            "autostart": null,     
            "balloon": null,   
            "bios": null,             
            "boot": null,     
            "bootdisk": null,
            "cicustom": null,
            "cipassword": null,
            "citype": null,  
            "ciuser": null,  
            "clone": "ubuntutemplate",
            "cores": null,  
            "cpu": null,           
            "cpulimit": null,         
            "cpuunits": null,       
            "delete": null,
            "description": null,
            "digest": null,  
            "efidisk0": null,
            "force": null,      
            "format": null,
            "freeze": null,  
            "full": true, 
            "hookscript": null,
            "hostpci": null,     
            "hotplug": null,
            "hugepages": null,            
            "ide": null,    
            "ipconfig": null,
            "keyboard": null, 
            "kvm": null,
            "localtime": null,
            "lock": null,    
            "machine": null,
            "memory": null,   
            "migrate": false,
            "migrate_downtime": null,
            "migrate_speed": null,
            "name": "jellyfinai",                           
            "net": null,                                    
            "newid": 201,                                   
            "node": "ds9",                                  
            "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": "nocrypt-data",                      
            "tablet": null,                                 
            "tags": null,                                   
            "target": null,                                 
            "tdf": null,                                    
            "template": null,                               
            "timeout": 30,                                  
            "tpmstate0": null,                              
            "update": false,                                
            "update_unsafe": false,                         
            "usb": null,                                    
            "validate_certs": false,                        
            "vcpus": null,                                  
            "vga": null,                                    
            "virtio": null,                                 
            "vmid": null,                                   
            "watchdog": null                                
        }                                                   
    },                                                      
    "item": {                                               
        "cipassword": "XXXX",                               
        "ciuser": "adm-jellyfin",                           
        "sshkeys": null,                                    
        "template_name": "ubuntutemplate",                  
        "vm_agent": "true",                                 
        "vm_balloon": 1024,                                 
        "vm_bios": "ovmf",                                  
        "vm_cores": 10,                                     
        "vm_cpu": "host",                                   
        "vm_hostpci": {                                     
            "hostpci0": "mapping=intelarc770,pcie=1,rombar=1"                                                            
        },                                                  
        "vm_hotplug": "network,disk,cpu,memory,usb",                                                                     
        "vm_machine": "q35,viommu=virtio",                  
        "vm_memory": 10240,                                 
        "vm_name": "jellyfinai",                            
        "vm_net": {                                         
            "net0": "bridge=vmbr0,tag=200,virtio=DE:AD:BE:EF:00:03"                                                      
        },                                                  
        "vm_newid": 201,                                    
        "vm_numa_enabled": "true",                          
        "vm_onboot": false,                                 
        "vm_ostype": "l26",                                 
        "vm_storage": "nocrypt-data",                       
        "vm_storage_size": 40                               
    },                                                      
    "msg": "Reached timeout while waiting for creating VM. Last line in task before timeout: [{'t': 'create full clone of drive efidisk0 (local-lvm:vm-9002-disk-0)', 'n': 1}]"
}                                                           

Code of Conduct

ansibullbot commented 2 months ago

Files identified in the description: None

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