If DCLI cannot connect to the OpenStack Management Server, you might need to restart the vAPI service.

Problem

When you start DCLI, the following error message is displayed:

ERROR: Unable to connect to the server.

Cause

DCLI cannot connect to the vAPI endpoint because the service is not running.

Solution

  1. Log in to the OpenStack Management Server as viouser.
  2. Check the status of the vAPI service.
    sudo systemctl status vapi

    The service is inactive.

    vapi.service - VIO vAPI
       Loaded: loaded (/etc/systemd/system/vapi.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
  3. Restart the service.
    sudo systemctl restart vapi
  4. Check the status of the vAPI service again.
    sudo systemctl status vapi

    The service has restarted.

    vapi.service - VIO vAPI
       Loaded: loaded (/etc/systemd/system/vapi.service; disabled; vendor preset: enabled)
       Active: active (running) since Wed 2018-06-27 04:46:00 UTC; 1s ago
      Process: 1983 ExecStartPre=/bin/mkdir -p /var/log/vmware/vapi (code=exited, status=0/SUCCESS)
     Main PID: 1985 (twistd)
       CGroup: /system.slice/vapi.service
               └─1985 /usr/bin/python /usr/bin/twistd --nodaemon --pidfile= -n web --port=9449 --wsgi vmware.vapi.wsgi.application
    
    Jun 27 04:46:00 vio-oms-01.mgt.sg.lab systemd[1]: Starting VIO vAPI...
    Jun 27 04:46:00 vio-oms-01.mgt.sg.lab systemd[1]: Started VIO vAPI.
    ...

What to do next

Connect to the OpenStack Management Server again.

dcli +server https://mgmt-server-ip:8443/api +i