Creating a Windows Service for
Spectrum Virtualize IP Quorum
for Windows Server x64
by
Richard HEFFEL
rheffel@us.ibm.com
© Copyright IBM Corp. 2008-2023. All Rights Reserved.
Note: The end-user will need to perform the following instructions with Administrator privileges on their Windows Server ! These actions may require opening up a CMD Window (aka DOS Box) with "Run as Adminstrator" rights.
- First, IBM recommends you read entirely the Knowledge Center article at URL:
https://www.ibm.com/support/knowledgecenter/STVLF4_8.2.1/spectrum.virtualize.821.doc/svc_ipquorumconfig.html
- Second, IBM suggests you download the IP Quorum jar file "ip_quorum.jar" mentioned in Step #1 in the section entitled "Installing IP quorum".
You may go directly to the SETTINGS/SYSTEM screen by entering into the browser:
https://<ipaddress>/gui#config-general
and then selecting the IP Quorum tab.
- IBM recommends creating the C:\IPQ subdirectory to store the "ip_quorum.jar" file that you will need to download from the Storage device's GUI.
MD C:\IPQ
- Next, you should determine which JAVA Runtime is installed on your Windows Server.
Table #1 describes which JAVA Runtimes are supported for IP Quorum at URL: https://www.ibm.com/support/knowledgecenter/STVLF4_8.2.1/spectrum.virtualize.821.doc/svc_ipquorumconfig.html
- You should attempt to test the IP Quorum by invoking the JAVA Runtime with the proper parameters to ensure the command works ***BEFORE*** attempting to create the IPqSVC Windows Service described further down in this article.
https://www.ibm.com/support/knowledgecenter/STVLF4_8.2.1/spectrum.virtualize.821.doc/svc_ipquorumconfig.html
Please NOTE that it will be very important to know the FULLY Qualified Pathname to the java.exe file. You can enter the following "where" command in a CMD Window (DOS box) or at the PowerShell prompt to find the path to the java.exe executable.
where.exe java
Now that one knows the full path to the java.exe executable file, one can test the entire command line to determine whether it works as expected. In this instance, it shows the use of IBM's JAVA product.
"C:\Program Files (x86)\IBM\Java70\jre\bin\java.exe" –jar C:\IPQ\ip_quorum.jar
But as is explained at the webpage found at the URL: indicated in Step #1, there are a variety of JREs that are supported on different platforms. Not only are there a variety of JREs from different vendors, there are also different versions such as IBM JAVA Runtime Environments 7.1 ; 7.1+ ; 8 ; 8.1+ versions and likewise with the Oracle Levels.
- Once the "java –jar ip_quorum.jar" command is shown to work above, then one can tackle creating a Windows Service that can be STARTed automatically. That process is described below.
- According to the website at URL: http://nssm.cc/download , nssm is public domain though IBM makes does not guarantee that statement. In other words, it is up to the end-user to determine the licensing requirement of that nssm software.
- Should you choose to use that nmms software, one will need to download the nmms software package and UnZip it. After unpacking the zip file, then copy the 64-bit version of the nmms.exe file to the %SYSTEMROOT%\SYSTEM32 subdirectory.
- Download the file "ip_quorum.jar" from the Spectrum Virtualize device.
If you had followed the recommendations above, then the file "ip_quorum.jar" should already be installed on your server in the C:\IPQ subdirectory
https://<ipaddress>/gui#config-general
- The example below shows the use of Oracle's JRE.
where.exe java
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
java –version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
- Create the Windows Service with the following one-line command. The "-jar" and "C:\IPQ\ip_quorum.jar" parameters were separated with more than one space to emphasize that these values are indeed parameters.
nssm.exe install IPqSVC "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe" -jar C:\IPQ\ip_quorum.jar
- Verify the Windows Service IPqSVC was created by executing the command in a CMD Windows (DOS Box).
reg.exe QUERY HKLM\SYSTEM\CurrentControlSet\services\IPqSVC
and
reg.exe QUERY HKLM\SYSTEM\CurrentControlSet\services\IPqSVC\Parameters
- Start the IPqSVC Windows Service.
sc.exe START IPqSVC
- You can START, QUERY, and STOP this new Windows Service.
- sc.exe START IPqSVC
- sc.exe QUERY IPqSVC
- sc.exe QC IPqSVC
- sc.exe STOP IPqSVC
- Verify the IP Quorum is working as explained at URL:
https://www.ibm.com/support/knowledgecenter/STVLF4_8.2.1/spectrum.virtualize.821.doc/svc_ipquorumconfig.html
I quote the author verbatim below:
"To verify that the IP quorum application is installed and active, select Settings > System > IP Quorum. The new IP quorum application is displayed in the table of detected applications. The system automatically selects MDisks for quorum disks. In a HyperSwap configuration with IP quorum, the system automatically selects an MDisk from both sites. These MDisks store metadata that are used for system recovery.If you want to select specific MDisk to use as quorum disks, select MDisk by Pools and right-click the MDisk and select Quorum > Modify Quorum Disk. You can also use the lsquorum command on the system CLI to verify that the IP quorum application is connected and is the active quorum device. If you want to modify the MDisk that are used for quorum by using the command-line interface, use the chquorum command."
Appendix
Appendix A – The BATCH Script to create the IPqSVC Windows Service
C:\IPQ\make_IPqSVC_Windows-x64_Service.bat
@ECHO ON
@ECHO ##########################################################################
@ECHO Licensed Materials - Property of IBM
@ECHO IBM XIV Storage System Software (program number 5639-XXA)
@ECHO (c ) Copyright IBM Corp. 2008-2019. All Rights Reserved.
@ECHO US Government Users Restricted Rights -
@ECHO Use, duplication or disclosure restricted by GSA ADP Schedule
@ECHO Contract with IBM Corporation
@ECHO DISCLAIMER:
@ECHO The following source code is sample code created by IBM Corporation.
@ECHO This sample code is not currently part of any standard IBM product and is provided
@ECHO to you solely for the purpose of assisting you in the development of your
@ECHO applications. The code is provided 'AS IS', without warranty or condition
@ECHO of any kind. IBM shall not be liable for any damages arising out of your
@ECHO use of the sample code, even if IBM has been advised of the possibility of
@ECHO such damages.
@ECHO ##########################################################################
REM Author: Richard HEFFEL
REM Email: rheffel@us.ibm.com
@ECHO.
TITLE %0
REM
REM
ECHO One must specify the correct fully qualified path to the java.exe executable !
REM
nssm.exe install IPqSVC "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe" –jar C:\IPQ\ip_quorum.jar
sc.exe START IPqSVC
sc.exe QUERY IPqSVC
------------------------------
Barry Smith
------------------------------
Original Message:
Sent: Thu September 19, 2024 07:33 AM
From: Alexander Reichle-Schmehl
Subject: Running the SVC IP-Quorum as Windows service
Hi!
We operate several SVC clusters in our subsidiaries virtualizing two storage systems each, and consider introducing the IP-Quorum for that. In each of our Subsidiaries we also have separate physical Server (with access restricted to our Administrators), which we could use for it. However, it is running Windows Server OS. So I'm fiddling to get the IP-Quorum software running as a Windows Service.
What I learned so far (with limited knowledge about Windows Server and Java):
- Downloading the IP-Quorum jar and executing it in cmd with
java -jar ip_quorum.jar
works as expected. - Creating a Windows Sevice via this commands
sc create IP-Quorum binpath= "cmd /c c:\svcquorum\jdk-23\bin\java.exe -jar c:\svcquorum\IP-Quorum\ip_quorum.jar" type= own start= auto error= ignore DisplayName= "SVC Quorum Software"
creates a service, which starts the IP quorum in the background. However, it isn't a proper Windows Service, hence it is not shown as running in the Windows Services view and can't stopped / restarted from there. So while working, not an ideal solution. - A common way to run a Java jar file as a Windows Service seems to be
procrun
Utility from the Apache Commons. My attempts to use that failed so far, because I would need to specify the Java Class to be started in the jar file. And that one I don't know.
Is anyone using the IP-Quorum under Windows? I din't found much documentation about it, just about creating a service under Linux. But our Linux systems I would have available have their storage on SVC, so not suitable for that purpose. Any ideas how to properly run the IP-Quorum as a Windows service, so it get's started / restarted / monitored automatically?
Best regards,
Alexander
------------------------------
Alexander Reichle-Schmehl
------------------------------