Skip to content

Instantly share code, notes, and snippets.

@necr0n
Last active April 9, 2023 12:28
Show Gist options
  • Save necr0n/098bab585dee446c1282d5a7a92af6af to your computer and use it in GitHub Desktop.
Save necr0n/098bab585dee446c1282d5a7a92af6af to your computer and use it in GitHub Desktop.
OpenSM Windows service
#
# Check if we have OpenSM service
#
Get-Service op*
#
# If it's present and running, stop and remove this service.
# There's Remove-Service available with PowerShell 6.0, which you likely don't have.
# Use sc.exe delete OpenSM or command below
#
Stop-Service 'OpenSM'; Get-CimInstance -ClassName Win32_Service -Filter "Name='OpenSM'" | Remove-CimInstance
#
# Then, create a new OpenSM service
#
New-Service -Name "OpenSM" -BinaryPathName "`"C:\Program Files\Mellanox\MLNX_VPI\IB\Tools\opensm.exe`" --service -P `"C:\Program Files\OFED\OpenSM\partitions.conf`" -L 128" -DisplayName "OpenSM" -Description "OpenSM for IB subnet" -StartupType Automatic
#
# Start service
#
Start-Service OpenSM
#
# Check if the service is running:
#
Get-Service OpenSM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment