" /> SipServer HA not working - Genesys CTI User Forum

Author Topic: SipServer HA not working  (Read 2888 times)

Offline prempreet

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
SipServer HA not working
« on: January 31, 2013, 12:10:17 PM »
Advertisement
Hi,

We are facing problem in SipServer HA switchover. We have configured backup-sync option & IP Address Take Over HA mechanism as per the document.

Initially the virtual is configured on primary server. If i stop the Primary TServer from SCI, then the virtual ip is releasing from Primary TServer & assigning to BackupTserver.

But after the virtual ip moved to Backup TServer, the virtual ip is not pinging from anywhere. Even the virtual ip is not pinging from Secondary server itself. We couldn't find where is the problem? whether its in genesys configuration or its in network side or its in server itself.

Anyone please help

All the Scripts are mentioned below :

Primary Server Scripts :
-----------------------------
HA_VIP_DOWN.bat
----------------


@set VirtualIP=192.168.0.170
@set VirtualInterface="Local Area Connection"
@echo ********************* HA_IP_OFF ********************** >> Takeover.log
@echo %time% >> Takeover.log
netsh interface ip delete address name=%VirtualInterface% addr=%VirtualIP% >> Takeover.log
@netsh interface ip delete arpcache
@cscript.exe ping.vbs %VirtualIP% //Nologo >> Takeover.log
@echo %time% >> Takeover.log


HA_VIP_UP.bat
--------------

@set VirtualIP=192.168.0.170
@set vipMask=255.255.255.0
@set VirtualInterface="Local Area Connection"
@echo ********************* HA_IP_ON ********************** >> Takeover.log
@echo %time% >> Takeover.log
@rem check if Virtual IP released on Backup host
@cscript.exe vbping.vbs %VirtualIP% //Nologo >> Takeover.log
@if not errorlevel 1 goto ready
@cscript.exe vbping.vbs %VirtualIP% //Nologo >> Takeover.log
@if not errorlevel 1 goto ready
@cscript.exe vbping.vbs %VirtualIP% //Nologo >> Takeover.log

:ready
@rem Add VirtualIP
@netsh interface ip delete arpcache
netsh interface ip add address name=%VirtualInterface% addr=%VirtualIP% mask=%vipMask% >> Takeover.log
@rem check if VirtualIP added succesefully if not do it again
@cscript.exe check_ip.vbs localhost %VirtualIP% //Nologo >> Takeover.log
@if errorlevel 1 goto done
netsh interface ip delete address name=%VirtualInterface% addr=%VirtualIP% >> Takeover.log
netsh interface ip add address name=%VirtualInterface% addr=%VirtualIP% mask=%vipMask% >> Takeover.log
@if errorlevel 1 echo %VirtualIP% not added to %VirtualInterface% >> Takeover.log
:done
@echo %time% >> Takeover.log

check_ip.vbs
-------------

rem check if IP address (arg0 ) can be found on host (arg1 )
On Error Resume Next
if WScript.Arguments.Count > 0 then
strComputer = WScript.Arguments(0)
targetIPAddress = WScript.Arguments(1)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colNicConfigs = objWMIService.ExecQuery _ ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE
IPEnabled = True")
WScript.Echo "Computer Name: " & strComputer & " ip " &
targetIPAddress
For Each objNicConfig In colNicConfigs
For Each strIPAddress In objNicConfig.IPAddress
If InStr(strIPAddress, targetIPAddress) Then
WScript.Echo targetIPAddress & " is found on " &
objNicConfig.Description
wscript.Quit 1
End If
Next
Next
WScript.Echo targetIPAddress & " not found."
wscript.Quit 0
Else
WScript.Echo "traget not specified."
wscript.Quit -1
End If


ping.vbs
---------

rem ping host and return 1 if ping successful 0 if not
On Error Resume Next
if WScript.Arguments.Count > 0 then
strTarget = WScript.Arguments(0)
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("ping -n 2 -w 1000 " & strTarget)
strPingResults = LCase(objExec.StdOut.ReadAll)
If InStr(strPingResults, "reply from") Then
WScript.Echo strTarget & " responded to ping."
wscript.Quit 1
Else
WScript.Echo strTarget & " did not respond to ping."
wscript.Quit 0
End If
Else
WScript.Echo "target is not specified."
wscript.Quit -1
End If


vbping.vbs
------------

Option Explicit

Dim strHost

' Check that all arguments required have been passed.
If Wscript.Arguments.Count < 1 Then
    Wscript.Echo "Arguments <Host> required. For example:" & vbCrLf _
    & "cscript vbping.vbs savdaldc01"
    Wscript.Quit(0)
End If

strHost = Wscript.Arguments(0)

if Ping(strHost) = True then
    Wscript.Echo "Host " & strHost & " contacted"
Else
    Wscript.Echo "Host " & strHost & " could not be contacted"
end if

Function Ping(strHost)

    dim objPing, objRetStatus

    set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
      ("select * from Win32_PingStatus where address = '" & strHost & "'")

    for each objRetStatus in objPing
        if IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
    Ping = False
            'WScript.Echo "Status code is " & objRetStatus.StatusCode
        else
            Ping = True
            'Wscript.Echo "Bytes = " & vbTab & objRetStatus.BufferSize
            'Wscript.Echo "Time (ms) = " & vbTab & objRetStatus.ResponseTime
            'Wscript.Echo "TTL (s) = " & vbTab & objRetStatus.ResponseTimeToLive
        end if
    next
End Function

--------------------------------------------------------------------------------

BackServer Scripts:
--------------------

HA_VIP_DOWN.bat
------------------
@set VirtualIP=192.168.0.170
@set VirtualInterface="Local Area Connection 2"
@echo ********************* HA_IP_OFF ********************** >> Takeover.log
@echo %time% >> Takeover.log
netsh interface ip delete address name=%VirtualInterface% addr=%VirtualIP% >> Takeover.log
@netsh interface ip delete arpcache
@cscript.exe ping.vbs %VirtualIP% //Nologo >> Takeover.log
@echo %time% >> Takeover.log


HA_VIP_UP.bat
---------------

@set VirtualIP=192.168.0.170
@set vipMask=255.255.255.0
@set VirtualInterface="Local Area Connection 2"
@echo ********************* HA_IP_OFF ********************** >> Takeover.log
@echo %time% >> Takeover.log
netsh interface ip delete address name=%VirtualInterface% addr=%VirtualIP% >> Takeover.log
@netsh interface ip delete arpcache
@cscript.exe ping.vbs %VirtualIP% //Nologo >> Takeover.log
@echo %time% >> Takeover.log
@echo ********************* HA_IP_ON ********************** >> Takeover.log
@echo %time% >> Takeover.log
@rem check if Virtual IP released on Backup host
@cscript.exe vbping.vbs %VirtualIP% //Nologo >> Takeover.log
@if not errorlevel 1 goto ready
@cscript.exe vbping.vbs %VirtualIP% //Nologo >> Takeover.log
@if not errorlevel 1 goto ready
@cscript.exe vbping.vbs %VirtualIP% //Nologo >> Takeover.log

:ready
@rem Add VirtualIP
@netsh interface ip delete arpcache
netsh interface ip add address name=%VirtualInterface% addr=%VirtualIP% mask=%vipMask% >> Takeover.log
@rem check if VirtualIP added succesefully if not do it again
@cscript.exe check_ip.vbs localhost %VirtualIP% //Nologo >> Takeover.log
@if errorlevel 1 goto done
netsh interface ip delete address name=%VirtualInterface% addr=%VirtualIP% >> Takeover.log
netsh interface ip add address name=%VirtualInterface% addr=%VirtualIP% mask=%vipMask% >> Takeover.log
@if errorlevel 1 echo %VirtualIP% not added to %VirtualInterface% >> Takeover.log
:done
@echo %time% >> Takeover.log


Ping.vbs
----------
rem ping host and return 1 if ping successful 0 if not
On Error Resume Next
if WScript.Arguments.Count > 0 then
strTarget = WScript.Arguments(0)
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("ping -n 2 -w 1000 " & strTarget)
strPingResults = LCase(objExec.StdOut.ReadAll)
If InStr(strPingResults, "reply from") Then
WScript.Echo strTarget & " responded to ping."
wscript.Quit 1
Else
WScript.Echo strTarget & " did not respond to ping."
wscript.Quit 0
End If
Else
WScript.Echo "target is not specified."
wscript.Quit -1
End If

check_ip.vbs
-------------
rem check if IP address (arg0 ) can be found on host (arg1 )
On Error Resume Next
if WScript.Arguments.Count > 0 then
strComputer = WScript.Arguments(0)
targetIPAddress = WScript.Arguments(1)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colNicConfigs = objWMIService.ExecQuery _ ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE
IPEnabled = True")
WScript.Echo "Computer Name: " & strComputer & " ip " &
targetIPAddress
For Each objNicConfig In colNicConfigs
For Each strIPAddress In objNicConfig.IPAddress
If InStr(strIPAddress, targetIPAddress) Then
WScript.Echo targetIPAddress & " is found on " &
objNicConfig.Description
wscript.Quit 1
End If
Next
Next
WScript.Echo targetIPAddress & " not found."
wscript.Quit 0
Else
WScript.Echo "traget not specified."
wscript.Quit -1
End If


vbping.vbs
-------------
Option Explicit

Dim strHost

' Check that all arguments required have been passed.
If Wscript.Arguments.Count < 1 Then
    Wscript.Echo "Arguments <Host> required. For example:" & vbCrLf _
    & "cscript vbping.vbs savdaldc01"
    Wscript.Quit(0)
End If

strHost = Wscript.Arguments(0)

if Ping(strHost) = True then
    Wscript.Echo "Host " & strHost & " contacted"
Else
    Wscript.Echo "Host " & strHost & " could not be contacted"
end if

Function Ping(strHost)

    dim objPing, objRetStatus

    set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
      ("select * from Win32_PingStatus where address = '" & strHost & "'")

    for each objRetStatus in objPing
        if IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
    Ping = False
            'WScript.Echo "Status code is " & objRetStatus.StatusCode
        else
            Ping = True
            'Wscript.Echo "Bytes = " & vbTab & objRetStatus.BufferSize
            'Wscript.Echo "Time (ms) = " & vbTab & objRetStatus.ResponseTime
            'Wscript.Echo "TTL (s) = " & vbTab & objRetStatus.ResponseTimeToLive
        end if
    next
End Function





Regards
Prem


Offline bublepaw

  • Sr. Member
  • ****
  • Posts: 283
  • Karma: 10
Re: SipServer HA not working
« Reply #1 on: February 06, 2013, 12:07:16 AM »
First before starting SIP Server trying running script from command line:

on first server VIP_ON and on second server VIP_OFF - check from third machine if virtual IP is pingable
after this run VIP_OFF on first server and VIP_ON on second server, again check from same third machine if virtual IP is pingable

If virtual ip address is pingable in both cases it is something with Genesys configuration - logs from SCS will tell You what is problem - usual source of problems are:
- scripts in wrong directory
- not enough rights for LCA to execute scripts modifying network
- alarms configured in wrong way (usually doing copy/paste with all those scripts can cause some problems)

If after one of commands virtual IP is not pingable problems is either with network or with scripts. In network case it can be problem with switch not refreshing MAC-IP mapping or security configuration on switch/router treating change of MAC for IP as spoofing attack or something similar

Pawel

Offline prempreet

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: SipServer HA not working
« Reply #2 on: February 06, 2013, 11:39:21 AM »
Thanks for your help,there was some problem in scripts. After corrected the scripts, switchover is happening as expected.

But still some problem. Below is the detailed scenario

Case 1) Primary TServer is running in primary mode & secondary Tserver is running in backup mode. If i manually stop the Primary TServer from SCI, the current voice call is not disconnecting. And the backup Tserver is starts running in primary mode- No issue here

Case 2) If i reboot the primary server, then also current call is not disconnecting. Backup Tserver starts running in Primary Mode - No issue here

Case 3) Primary TServer is running in primary mode & secondary Tserver is running in backup mode. If i unplug the network cable from Secondary TServer, then there is no sound in the current calls. When i plug the cable into the secondary Tserver again, then only sound is coming back. Till that time, there is no voice path in the current call.

We want to know, In IP Address TakeOver mechanism, can we unplug the network cable & check the HA function? Or IP Address TakeOver mechanism will work only when the server is rebooted or down?

Regards
Prem

Offline bublepaw

  • Sr. Member
  • ****
  • Posts: 283
  • Karma: 10
Re: SipServer HA not working
« Reply #3 on: February 07, 2013, 03:59:52 PM »
Do You have Stream Manager/Media Server installed on same box as SIP Server and did You turn recording because this is only reason why cable disconnection can impact RTP stream.