XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Ansible e XCP-NG - Erro ao criar Vm através de uma playbook

    Scheduled Pinned Locked Moved Portuguese (Português)
    1 Posts 1 Posters 481 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      thiago.dantas
      last edited by

      Olá pessoal!
      Estou enfrentando o seguinte problema. Realizo algumas automações com o Ansible para criar VMs e gerenciar os servidores no XCP-NG. Meu ambiente de testes é na versão do XCP-NG é a 8.2.0, mas meu ambiente do produção está na versão 8.2.1.
      A playbook que criei no ambiente de testes (versão 8.2.0), não obteve erro, mas ao executar a playbook no ambiente de produção, esta apresentou o seguinte erro:
      fatal: [localhost]: FAILED! => {"changed": false, "msg": "XAPI ERROR: ['HANDLE_INVALID', 'host', 'OpaqueRef:45ceb5df-0d7f-4485-98b5-af8439f6cbd2 ']"}

      Ao verificar os logs, as seguintes mensagens de erros foram econtradas:

      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] host.get_record D:74f5c816f7e9 failed with exception Db_exn.DBCache_NotFound("missing row", "host", "OpaqueRef:45ceb5df-0d7f-4485-98b5-af8439f6cbd2")
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] Raised Db_exn.DBCache_NotFound("missing row", "host", "OpaqueRef:45ceb5df-0d7f-4485-98b5-af8439f6cbd2")
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 1/9 xapi Raised at file ocaml/database/db_cache_impl.ml, line 135
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 2/9 xapi Called from file ocaml/xapi/db_actions.ml, line 8160
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 3/9 xapi Called from file ocaml/xapi/rbac.ml, line 197
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 4/9 xapi Called from file ocaml/xapi/rbac.ml, line 205
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 5/9 xapi Called from file ocaml/xapi/server_helpers.ml, line 92
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 6/9 xapi Called from file ocaml/xapi/server_helpers.ml, line 113
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 7/9 xapi Called from file lib/xapi-stdext-pervasives/pervasiveext.ml, line 24
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 8/9 xapi Called from file map.ml, line 135
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace] 9/9 xapi Called from file src/sexp_conv.ml, line 156
      Apr 29 15:32:53 xcp-ng-r740 xapi: [error||1967426 :::80||backtrace]

      Alguém consegue me auxiliar com esta questão?

      Playbook


      • name: Tentativa de criação VM
        hosts: localhost
        vars_files: /home/teste/ansible/vars/xen_localhost_vars.yml
        tasks:
        • name: Criando VM
          community.general.xenserver_guest:
          hostname: "{{ xenserver }}"
          username: "{{ xenserver_username }}"
          password: "{{ xenserver_password }}"
          #validate_certs: false
          #home_server:
          folder: /teste/vm
          name: teste
          state: poweredon
          #template: Debian11_Disk30G
          template_uuid: "{{ templete_vm }}"
          disks:
          • size_gb: 40
            sr_uuid: xxxxxx-xxxx-xxxxx-xxxxx-xxxxxxxxxxxxx
            hardware:
            num_cpus: 1
            num_cpu_cores_per_socket: 1
            memory_mb: 1024
            #cdrom:
            #type: iso
            #iso_name: guest-tools.iso
            networks:
          • name: network0
            #mac: aa:bb:dd:aa:00:18
            #wait_for_ip_address: true
            #delegate_to: localhost
            register: deploy
        • name: deploy
          debug:
          msg: "{{ deploy }}"
          ...
      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post