Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Can't connect to vcd #197

Open
davbeny opened this issue Oct 19, 2021 · 1 comment
Open

Can't connect to vcd #197

davbeny opened this issue Oct 19, 2021 · 1 comment

Comments

@davbeny
Copy link

davbeny commented Oct 19, 2021

Hello,

I want to get informations for a specific VM in a organisation.

I'm not able to connect to VCD using ansible-playbook 2.10.15 & ansible-module-vcloud-directory and VCD 10.3.1 using the following play :


  • hosts: localhost
    gather_facts: false
    connection : local
    tasks:
    • name: get metadata for vm
      vcd_vapp:
      user: "david"
      password: "************"
      accept_all_eulas: "false"
      verify_ssl_certs: "false"
      host: "myvcdserver.org.com"
      org: "MYTESTORG"
      vapp_name: "BAS_TEST_O1"
      vdc: "MYTESTORG"
      vm_name: "BA-XS-01"
      operation: "get_meta"

I get :

fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1634892399.1068623-4070-240004511659771/AnsiballZ_vcd_vapp.py", line 102, in \n _ansiballz_main()\n File "/root/.ansible/tmp/ansible-tmp-1634892399.1068623-4070-240004511659771/AnsiballZ_vcd_vapp.py", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/root/.ansible/tmp/ansible-tmp-1634892399.1068623-4070-240004511659771/AnsiballZ_vcd_vapp.py", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.vcd_vapp', init_globals=None, run_name='main', alter_sys=True)\n File "/usr/lib/python3.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File "/usr/lib/python3.8/runpy.py", line 87, in _run_code\n exec(code, run_globals)\n File "/tmp/ansible_vcd_vapp_payload_8milogn7/ansible_vcd_vapp_payload.zip/ansible/modules/vcd_vapp.py", line 652, in \n File "/tmp/ansible_vcd_vapp_payload_8milogn7/ansible_vcd_vapp_payload.zip/ansible/modules/vcd_vapp.py", line 629, in main\n File "/tmp/ansible_vcd_vapp_payload_8milogn7/ansible_vcd_vapp_payload.zip/ansible/modules/vcd_vapp.py", line 245, in init\nAttributeError: 'NoneType' object has no attribute 'get'\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1

Thank you for your help

@mukultaneja
Copy link
Collaborator

@davbeny, as per the error message, somehow your VDC is not part of the given org. While trying to fetch the VDC information from org, it is returning None.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants