This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

vRealize: vRO Workflow

As part of one of our projects, we deployed vRealize on one of our servers (Server 1). We also have in our infrastructure, a PowerShell Server (Server 2) and a Solarwinds Server (Server 3).

What we would like to implement is a vRO workflow that runs on Server 1 and calls the PowerShell script on Server 2. The PowerShell script needs to connect to Solarwinds and run a query. For connecting to Solarwinds, we are using Orion SDK.

The PowerShell script connects to Solarwinds using the following command:

#Connect to the SolarWinds Server

$Swis = Connect-Swis –V2 -Trusted -Hostname $Server 

#build the SWQL query

$Query = "SELECT R.Address as SubnetAddress, R.CIDR, R.FriendlyName, R.PercentUsed, (SELECT TOP 1 I2.IpAddress FROM IPAM.IPNode as I2 WHERE I2.Status=$($IPStatusAvailable) AND I2.SubnetId = R.GroupID) AS FreeIpAddress FROM IPAM.GroupReport as R WHERE R.CIDR='$($CIDR)' AND SubnetAddress = '$($Network)'";

#retrieve the IP

$AddressesWithSubnets = Get-SwisData $Swis $Query;

There are two scenarios we tested:

• Someone connected using Remote Desktop on the PowerShell server and executed the PowerShell script. Everything went well, and the script returned the results we were expecting.

• Someone executed the VRA workflow (which connects to the PowerShell server and runs the script).

ServerConfiguration.PNG

The script fails with the following error:

  1. System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9530496'. ---> System.IO.IOException: The write operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9530496'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)

   at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)

   --- End of inner exception stack trace ---

   at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)

   at System.ServiceModel.Channels.BufferedConnection.WriteNow(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, BufferManager bufferManager)

   at System.ServiceModel.Channels.BufferedConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)

   at System.ServiceModel.Channels.ConnectionStream.Write(Byte[] buffer, Int32 offset, Int32 count)

   at System.Net.Security.NegotiateStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

   --- End of inner exception stack trace ---

   at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.NegotiateStream.Write(Byte[] buffer, Int32 offset, Int32 count)

   at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)

   --- End of inner exception stack trace ---

Some things we did to troubleshot the error:

• Ensure the users have access on Solarwinds

• Configured WINRS

• Opened all the port on Solarwinds server

Our investigation revealed that Solarwinds resets the connection for some reason.

Could you please help us troubleshoot this problem?

  • Jbrozek,

    Quick question for you, how are you authenticating to PowerShell host from vRO and what kind of Session are you using Shared or Per User?

  • 1. Try changing the script to run with an Orion username and password instead of the -Trusted switch.

    2. Try connecting to SWISv3 instead of SWISv2 (just remove the "-v2" switch from the Connect-Swis line).

    3. Look in the SWIS log to see if there are additional details. If you are connecting to SWISv2, that's C:\ProgramData\SolarWinds\InformationService\v2.0\Orion.InformationService.log. If connecting to SWISv3, then it is C:\ProgramData\SolarWinds\InformationService\v3.0\Orion.InformationService.log.