Error "Unable to connect to vCloud Server 'https://<vcd_address>/api/'. The server returned the following: NotAcceptable: ''" when attempting to use Connect-CIServer cmdlet
search cancel

Error "Unable to connect to vCloud Server 'https://<vcd_address>/api/'. The server returned the following: NotAcceptable: ''" when attempting to use Connect-CIServer cmdlet

book

Article ID: 385548

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Unable to connect to Cloud Director with PowerShell using PowerCLI and VMware.VimAutomation.Cloud.
  • In PowerShell the Connect-CIServer cmdlet throws an error of the form:

Connect-CIServer : <timestamp>  Connect-CIServer                Unable to connect to vCloud Server
'https://<vcd_address>:443/api/'. The server returned the following: NotAcceptable: ''.
At line:1 char:1
+ Connect-CIServer -server <vcd_address> -User <vcd_user> -Password <vcd_password> ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-CIServer], CIException
    + FullyQualifiedErrorId : Cloud_ConnectivityServiceImpl_ConnectCloudServer_ConnectError,VMware.VimAutomation.Cloud
   .Commands.Cmdlets.ConnectCIServer

  • The /opt/vmware/vcloud-director/logs/vcloud-container.debug.log files on the Cloud Director Cells show an error of the form:

<timestamp>  | DEBUG    | pool-jetty-###             | RequestApiVersionResolver      | Invalid Accept header version. The accept header must contain version parameter [<valid_vcd_api_versions>] with one of values: {2} | requestId=########-####-####-####-############,request=POST https://<vcd_address>/api/sessions,requestTime=<request_time>,remoteAddress=<remote_address_and_port>,userAgent=PowerCLI,accept=application/*+xml; version <invalid_vcd_api_version>

Environment

  • VMware Cloud Director 10.5.x
  • VMware Cloud Director 10.6.x
  • VMware PowerCLI

Cause

This issue occurs if the version of VMware PowerCLI is incompatible with the VMware Cloud Director version.

PowerCLI is attempting to connect to the Cloud Director API with an API version that is not supported.

Resolution

To resolve the issue, ensure that the VMware PowerCLI version in use is compatible with the VMware Cloud Director version as per the Product Interoperability Matrix.

Additional Information

For information on installing and upgrading VMware PowerCLI see the documentation here, PowerCLI Installation Guide.