Baking Clouds Ltd

Baking Clouds provide tailored IT consultancy services to small and medium-sized companies; we cover all aspects of IT without any hidden costs.

Fix: Unable to register plugin vRealize Operations Tenant App for VMware Cloud Director

Hello readers!! You might come across the following issue after you upgrade the vRealize Tenant App spend hours trying to figure out how to fix it! Hopefully, this problem is resolved in the next release or a KB in VMware soon, in the meantime here are the steps on how to register the plugin in VMware Cloud Director.

Always make sure all your components are compatible. Our environment configuration as follows:

  • vRealize Operations Manager 8.4
  • Management Pack for vCloud Director 5.5
  • vRealize Tenant App 2.6
  • Cloud Director 10.2.2

Note: This fix also applies to version 2.5

Problem

Issue occurs when from Tenant App UI the plugin is configured to use VMware Cloud Director Public URL.
Tenant’s view when opening Operations Manager plugin:

To see Tenant App logs

  • SSH Tenant App appliance using root credentials
  • Run docker ps
  • Take note of the container ID of vmware/vrops-vcd-tenant-app-plugin
  • Run docker logs “container id”
docker logs 0cadb2ddda23
HTTPSConnectionPool(host='vcd-bakingclouds.com', port=443): Max retries exceeded with url: /api/sessions (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd8a744f610>: Failed to establish a new connection: [Errno 110] Connection timed out',))
Traceback (most recent call last):
  File "/etc/vmware/bin/vcd_extension.py", line 247, in login
    loginUrl, headers=headers, data=json.dumps(requestBody), verify=False)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='vcd-bakingclouds', port=443): Max retries exceeded with url: /api/sessions (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd8a744f610>: Failed to establish a new connection: [Errno 110] Connection timed out',))

Install.log errors (location: /data/logs/plugin/install.log):

ype="application/octet-stream"
2021-01-27 17:21:52,543 - install - ERROR - HTTPSConnectionPool(host='vcd-bakingclouds.com', port=443): Max retries exceeded with url: /transfer/8d014e9d-532f-494b-9f99-50ab02208f4d/plugin.zip (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fd8448b6e50>: Failed to establish a new connection: [Errno 110] Connection timed out',))
Traceback (most recent call last):
  File "publish.py", line 153, in upload
    data=fin.read(), verify=False)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 124, in put
    return request('put', url, data=data, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 500, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 621, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='vcd-bakingclouds.com', port=443): Max retries exceeded with url: /transfer/8d014e9d-532f-494b-9f99-50ab02208f4d/plugin.zip (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fd8448b6e50>: Failed to establish a new connection: [Errno 110] Connection timed out',))

Solution

At your own risk!! If you are going to attempt this make sure you have the same symptoms, take snapshot of your appliance. We highly recommend to contact VMware Support for further assistance.

  • Go to /opt/vmware/plugin and edit publish.py
  • Add/modify the following lines highlighted in red:
def upload(token, link):
    logger.info("uploading to " + link)
    url = link.split('>')[0].strip('<').strip('>').strip()
    mod_url = "https://"+args.host+url[url.index("/transfer"):]
    try:
        headers = {"Content-Type": "application/zip",
                   "x-vcloud-authorization": token}
        fin = open('plugin.zip', 'rb')
        response = requests.put(mod_url, headers=headers,
                                data=fin.read(), verify=False)
        fin.close()
        logger.info("Uploaded Successfully")
  • The second thing you need to do, is to find all files with the name of ” vcd_extension.py” and add the following parameters:

root@vrealize-tenant [ ~ ]# find / -name vcd_extension.py
/var/lib/docker/overlay2/0d8aa1ac6bf9e58c7c7caa9eb48e2863a244b4cbb28b636223b6c3275dac34f6/diff/etc/vmware/bin/vcd_extension.py
/var/lib/docker/overlay2/8c5abc00e8333563f6556d0805b07f7a67396c1b440556def6f0c4479bbf9e0b/merged/etc/vmware/bin/vcd_extension.py

mod_triggerUrl =  'https://'+args.vcdhost+triggerUrl[triggerUrl.index("/api"):]
            mod_apiFilterUrl =  'https://'+args.vcdhost+apiFilterUrl[apiFilterUrl.index("/api"):]
            mod_longLiveTokenUrl =  'https://'+args.vcdhost+longLiveTokenUrl[longLiveTokenUrl.index("/cloudapi"):]
            if(len(mod_triggerUrl) != 0):
                setTriggerEndpoint(token,mod_triggerUrl,mod_apiFilterUrl,mod_longLiveTokenUrl,extensionId,listen_topic, respond_topic)
  • Save the changes and reconfigure the plugin from the UI using vCloud Director IP address

Additional Resources

VMware Product Interoperability Matrices

We hope this post is useful. If you want more information, send us your comment using the button below.

Disclaimer
Last updated: May 17, 2018
The information contained on www.bakingclouds.com website (the “Service”) is for general information purposes only.
Baking Clouds assumes no responsibility for errors or omissions in the contents on the Service.
In no event shall Baking Clouds be liable for any special, direct, indirect, consequential, or incidental damages or any damages whatsoever, whether in an action of contract, negligence or other tort, arising out of or in connection with the use of the Service or the contents of the Service.  Baking Clouds reserves the right to make additions, deletions, or modification to the contents on the Service at any time without prior notice.

Fix: Unable to register plugin vRealize Operations Tenant App for VMware Cloud Director

2 thoughts on “Fix: Unable to register plugin vRealize Operations Tenant App for VMware Cloud Director

Comments are closed.

Scroll to top