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