pyvcloud icon indicating copy to clipboard operation
pyvcloud copied to clipboard

vApp creation from template fails

Open nirkal opened this issue 5 years ago • 2 comments

Python 3.7.4 vcd-cli 22.0.0 pyvcloud 20.1.1.dev26

Trying to create a vApp from a template, the following error is observed.

fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": ":18: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses\n/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\n InsecureRequestWarning,\n/usr/local/lib/python3.7/site-packages/urllib3/connect ced-usage.html#ssl-warnings\n InsecureRequestWarning,\n/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\n InsecureRequestWarning,\n/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\n InsecureRequestWarning,\nTraceback (most recent call last):\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/main.py", line 282, in instantiate\n File "/usr/local/lib/python3.7/site-packages/pyvcloud/vcd/vdc.py", line 148, in get_vapp\n return self.client.get_resource(self.get_resource_href(name))\n File "/usr/local/lib/python3.7/site-packages/pyvcloud/vcd/vdc.py", line 115, in get_resource_href\n raise EntityNotFoundException('vApp named \'%s\' not found' % name)\npyvcloud.vcd.exceptions.EntityNotFoundException: vApp named 'test_vapp' not found\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/main.py", line 482, in main\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/main.py", line 225, in manage_states\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/main.py", line 319, in create\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/main.py", line 304, in instantiate\n File "/usr/local/lib/python3.7/site-packages/pyvcloud/vcd/vdc.py", line 231, in instantiate_vapp\n media_type).href\n File "/usr/local/lib/python3.7/site-packages/pyvcloud/vcd/client.py", line 1619, in find_link\n raise MissingLinkException(resource.get('href'), rel, media_type)\npyvcloud.vcd.exceptions.MissingLinkException: ('https://vim-portal.nfv.teliasonera.net/api/vdc/4e768ce5-4f54-4999-a214-cf6c05002211', <RelationType.UP: 'up'>, 'application/vnd.vmware.vcloud.org+xml'); href: https://vim-portal.nfv.teliasonera.net/api/vdc/4e768ce5-4f54-4999-a214-cf6c05002211, rel: RelationType.UP, mediaType: application/vnd.vmware.vcloud.org+xml\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "", line 114, in \n File "", line 106, in _ansiballz_main\n File "", line 49, in invoke_module\n File "/usr/local/lib/python3.7/imp.py", line 234, in load_module\n return load_source(name, filename, file)\n File "/usr/local/lib/python3.7/imp.py", line 169, in load_source\n module = _exec(spec, sys.modules[name])\n File "", line 630, in _exec\n File "", line 728, in exec_module\n File "", line 219, in _call_with_frames_removed\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/main.py", line 496, in \n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/main.py", line 490, in main\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/ansible_vcd_vapp_payload.zip/ansible/module_utils/basic.py", line 2067, in fail_json\n File "/tmp/ansibl pp_payload.zip/ansible/module_utils/basic.py", line 418, in remove_values\n File "/tmp/ansible_vcd_vapp_payload_ksaaiavc/ansible_vcd_vapp_payload.zip/ansible/module_utils/basic.py", line 401, in _remove_values_conditions\nTypeError: Value of unknown type: <class 'pyvcloud.vcd.exceptions.MissingLinkException'>, ('https://vim-portal.nfv.teliasonera.net/api/vdc/4e768ce5-4f54-4999-a214-cf6c05002211', <RelationType.UP: 'up'>, 'application/vnd.vmware.vcloud.org+xml'); href: https://vim-portal.nfv.teliasonera.net/api/vdc/4e768ce5-4f54-4999-a214-cf6c05002211, rel: RelationType.UP, mediaType: application/vnd.vmware.vcloud.org+xml\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

nirkal avatar Sep 22 '19 20:09 nirkal

Can you please upgrade urllib3 then try. If you will still face issue then please let us know. We will fix it.

kkkothari avatar Sep 23 '19 07:09 kkkothari

Hi! I am not sure if the issue is related to urllib3. But i have observed one thing now. If i perform "vcd login" with system account, vApp creation works.

Regards, Niru

nirkal avatar Sep 23 '19 13:09 nirkal