How to Add a probe port

Glenn Maxwell 10,146 Reputation points
2021-12-29T21:30:19.797+00:00

Hi All

I am following the below article to add a probe port, i am getting the error, experts correct me with the script.

https://learn.microsoft.com/en-us/azure/virtual-machines/workloads/sap/sap-high-availability-installation-wsfc-shared-disk#10822f4f-32e7-4871-b63a-9b86c76ce761

$ProbePort = 12345  
$ClusterRoleName = "SAPRole"  
$IPResourceName = "SAP IP" # the IP Address resource name  
$ListenerILBIP = "192.168.10.5"  
$IPResourceClusterParameters = Get-ClusterResource $IPresourceName | Get-ClusterParameter  
$IPAddress = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Address" }).Value  
$NetworkName = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Network" }).Value  
$SubnetMask = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "SubnetMask" }).Value  
$OverrideAddressMatch = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "OverrideAddressMatch" }).Value  
$EnableDhcp = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "EnableDhcp" }).Value  
$OldProbePort = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "ProbePort" }).Value  
$var = Get-ClusterResource | Where-Object { $_.name -eq $IPresourceName }  
Write-Host "Current configuration parameters for SAP IP cluster resource '$IPresourceName' are:" -ForegroundColor Cyan  
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameterWrite-Host  
Write-Host "Current probe port property of the SAP cluster resource '$IPresourceName' is '$OldProbePort'." -ForegroundColor Cyan  
Write-Host  
Write-Host "Setting the new probe port property of the SAP cluster resource '$IPresourceName' to '$ProbePort' ..." -ForegroundColor Cyan  
Write-Host$var | Set-ClusterParameter -Multiple @{"Address"=$IPAddress;"ProbePort"=$ProbePort;"Subnetmask"=$SubnetMask;"Network"=$NetworkName;"OverrideAddressMatch"=$OverrideAddressMatch;"EnableDhcp"=$EnableDhcp}  
Write-Host$ActivateChanges = Read-Host "Do you want to take restart SAP cluster role '$ClusterRoleName', to activate the changes (yes/no)?"if($ActivateChanges -eq "yes"){  
Write-Host  
Write-Host "Activating changes..." -ForegroundColor CyanWrite-Host  
write-host "Taking SAP cluster IP resource '$IPresourceName' offline ..." -ForegroundColor Cyan  
Stop-ClusterResource -Name $IPresourceName  
sleep 5Write-Host "Starting SAP cluster role '$ClusterRoleName' ..." -ForegroundColor Cyan  
Start-ClusterGroup -Name $ClusterRoleNameWrite-Host "New ProbePort parameter is active." -ForegroundColor Green  
Write-HostWrite-Host "New configuration parameters for SAP IP cluster resource '$IPresourceName':" -ForegroundColor Cyan  
Write-Host  
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameter  
}else  
{  
Write-Host "Changes are not activated."  
}  

Where-Object : A positional parameter cannot be found that accepts argument 'Write-Host'.
At line:12 char:30

  • ... rResource | Where-Object { $_.name -eq $IPresourceName }Write-Host "C ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidArgument: (:) [Where-Object], ParameterBindingException
  • FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.WhereObjectCommand

Get-ClusterParameterWrite-Host : The term 'Get-ClusterParameterWrite-Host' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:13 char:45

  • ... lusterResource -Name $IPresourceName | Get-ClusterParameterWrite-Host
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Get-ClusterParameterWrite-Host:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

Current probe port property of the SAP cluster resource 'SAP IP' is '0'.

Setting the new probe port property of the SAP cluster resource 'SAP IP' to '12345' ...
Write-Host$var : The term 'Write-Host$var' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:17 char:1

  • Write-Host$var | Set-ClusterParameter -Multiple @{"Address"=$IPAddres ...
  • ~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Write-Host$var:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

Write-Host "Changes are not activated."

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,202 questions
SAP HANA on Azure Large Instances
SAP HANA on Azure Large Instances
Microsoft branding terminology for an Azure offer to run HANA instances on SAP HANA hardware deployed in Large Instance stamps in different Azure regions.
119 questions
Windows Server Clustering
Windows Server Clustering
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Clustering: The grouping of multiple servers in a way that allows them to appear to be a single unit to client computers on a network. Clustering is a means of increasing network capacity, providing live backup in case one of the servers fails, and improving data security.
962 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,389 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 45,096 Reputation points
    2021-12-29T22:16:11.167+00:00

    Look at line #14 in the code you posted:

    Get-ClusterResource -Name $IPresourceName | Get-ClusterParameterWrite-Host
    

    Remove the trailing "Write-Host" from that line.

    Also check lines 18, 19, 21,25, and 26 for mistakes.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Glenn Maxwell 10,146 Reputation points
    2021-12-29T23:02:23.457+00:00

    i have modified the script but still the probe port is not listening

    $ProbePort = 12345
    $ClusterRoleName = "SAPRole"
    $IPResourceName = "SAP IP" # the IP Address resource name
    $ListenerILBIP = "192.168.10.5"
    $IPResourceClusterParameters = Get-ClusterResource $IPresourceName | Get-ClusterParameter
    $IPAddress = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Address" }).Value
    $NetworkName = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Network" }).Value
    $SubnetMask = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "SubnetMask" }).Value
    $OverrideAddressMatch = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "OverrideAddressMatch" }).Value
    $EnableDhcp = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "EnableDhcp" }).Value
    $OldProbePort = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "ProbePort" }).Value
    $var = Get-ClusterResource | Where-Object { $_.name -eq $IPresourceName }Write-Host "Current configuration parameters for SAP IP cluster resource '$IPresourceName' are:" -ForegroundColor Cyan
    Get-ClusterResource -Name $IPresourceName | Get-ClusterParameter
    Write-Host "Current probe port property of the SAP cluster resource '$IPresourceName' is '$OldProbePort'." -ForegroundColor Cyan
    Write-Host "Setting the new probe port property of the SAP cluster resource '$IPresourceName' to '$ProbePort' ..." -ForegroundColor Cyan
    Write-Host $var | Set-ClusterParameter -Multiple @{"Address"=$IPAddress;"ProbePort"=$ProbePort;"Subnetmask"=$SubnetMask;"Network"=$NetworkName;"OverrideAddressMatch"=$OverrideAddressMatch;"EnableDhcp"=$EnableDhcp}
    Write-Host $ActivateChanges = Read-Host "Do you want to take restart SAP cluster role '$ClusterRoleName', to activate the changes (yes/no)?"if($ActivateChanges -eq "yes"){
    Write-Host "Activating changes..." -ForegroundColor Cyan
    write-host "Taking SAP cluster IP resource '$IPresourceName' offline ..." -ForegroundColor Cyan
    Stop-ClusterResource -Name $IPresourceName
    sleep 5
    Write-Host "Starting SAP cluster role '$ClusterRoleName' ..." -ForegroundColor Cyan
    Start-ClusterGroup -Name $ClusterRoleName
    Write-Host "New ProbePort parameter is active." -ForegroundColor Green
    Write-HostWrite-Host "New configuration parameters for SAP IP cluster resource '$IPresourceName':" -ForegroundColor Cyan
    Get-ClusterResource -Name $IPresourceName | Get-ClusterParameter
    }else
    {
    Write-Host "Changes are not activated."
    }