How to register OpenSM as a service on the second port of the HCA in Windows2012

Version 1

    Windows2012

    By default, OpenSM will try to run on the first port of the HCA. If port-2 is active and port-1 is down or disconnected, the service will be stuck.

    In order to overcome this issue, the registration of the OpenSm need to be done differently:

    Via CMD:

    1. sc creates OpenSM1 binPath= "c:\Program Files\Mellanox\MLNX_VPI\IB\Tools\opensm.exe --service -g 0x0002c90300455fd2" start=auto
    2. sc start OpenSM1

    Via PowerShell:

    1. New-Service –Name "OpenSM1" –BinaryPathName "`"C:\Program Files\Mellanox\MLNX_VPI\IB\Tools\opensm.exe`" --service -g 0x0002c903000f9957 -L 128" -DisplayName "OpenSM1" –Description "OpenSM for the first IB subnet" -StartupType Automatic
    2. Start-Service OpenSM1

    You can verify the running of the SM by invoking: sminfo -P 2