IBM FlashSystem

 View Only
  • 1.  Running the SVC IP-Quorum as Windows service

    Posted Thu September 19, 2024 07:33 AM

    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
    ------------------------------


  • 2.  RE: Running the SVC IP-Quorum as Windows service

    Posted Thu September 19, 2024 08:06 AM
    Hi Alexander,
     
    I'm using Task Scheduler to run ipquorum on Windows. It easily provides run at startup capability and setup and forget like usage. 


    ------------------------------
    Nezih Boyacioglu
    ------------------------------



  • 3.  RE: Running the SVC IP-Quorum as Windows service

    Posted Fri September 20, 2024 06:57 AM

    Hi Alexander,

    a while ago I made a note on someone's way using a tool called NSSM to achieve exactly what you are looking for.

    Unfortunately, I failed to note the source URL, but this is what I had saved:

    How to run Spectrum Virtualize IPQuorum app as a Windows service

    There is a free 3rd party tool called NSSM which can register any program as a Windows service, so it is being launched upon startup.
    URL: http://nssm.cc/download
    There are some examples out there how to use it with Java jar applications, e.g.:
    - https://stackoverflow.com/questions/31752759/installing-a-java-service-on-windows-7-with-nssm
    - http://giordanomaestro.blogspot.com/2013/01/running-java-applications-as-windows.html
    - https://www.quora.com/How-do-I-run-the-jar-file-as-a-windows-service
    Also I had mentioned to launch the IPQuorum app with the name parameter, so each instance is tagged with a speaking name which shows up in SVC's lsquorum output.
    Usage example: java -jar ip_quorum.jar -name ipq_site3

    Good luck and best regards,

    Christian Schroeder



    ------------------------------
    Best regards, 

    Christian Schroeder
    IBM Storage Virtualize Support with Passion
    ------------------------------



  • 4.  RE: Running the SVC IP-Quorum as Windows service

    Posted Mon September 23, 2024 10:17 AM
    Edited by Randy Frye Mon September 23, 2024 04:34 PM

    Download:  https://nssm.cc/download

    Add the location of nssm-2.24\win64 to your Windows Path variable.  (I saved nssm in the C:\SWIPQuorum folder in below example, so added C:\SWIPQuorum\nssm-2.24\win64 to my path.)

    Place your IP Quorum jar file on Windows server, in C:\SWIPQuorum for below example.

    Create a batch file (i.e. C:\SWIPQuorum\SWIPQuorum.bat) that's one line: java.exe -jar "C:\SWIPQuorum\ip_quorum.jar"

    Run: nssm install XXX_IPQuorum (XXX_IPQuorum will be the name of the Windows "service").  This will open an "NSSM service installer" GUI.

    On the Application tab, enter C:\SWIPQuorum\SWIPQuorum.bat for the Path, and C:\SWIPQuorum for the Startup directory.  On the details tab, enter Display Name and Description that you want to show up in Windows Services, and set Startup type to Automatic.

    Click the "Install Service" button.

    (Note, below screenshot is from nssm edit V7G3ProdIPQuorum command, to edit the existing nssm service I had previously created.)

    You now have this set up as a Windows service.  You can stop/start/restart the IPQuorum service using the Services plugin.  To upgrade the ipquorum, you just stop the Windows service, replace your ipquorum.jar with the new jar file, and start the service back up.



    ------------------------------
    Randy Frye
    Senior Storage Administrator
    D&H Distributing
    Harrisburg
    7173647948
    ------------------------------



  • 5.  RE: Running the SVC IP-Quorum as Windows service

    Posted Fri September 20, 2024 08:00 AM

    Can't help with the Windows service part directly, but finding the main class run from a Jar file is pretty easy.  Jar files are essentially zip files in a special format, so if you unzip with any means you will find a META-INF directory with a MANIFEST.MF file.  The Main-Class: stanza in that file is the class name that is run when using the -jar syntax.

    Doing this for one of my quorum jars resulting in a class name of "Quorum$App"



    ------------------------------
    Vincent Greene
    IT Consultant
    Technology Expert labs
    IBM
    Vincent.Greene@ibm.com


    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    ------------------------------



  • 6.  RE: Running the SVC IP-Quorum as Windows service

    Posted Mon September 23, 2024 05:04 PM

    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.

    1. 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

    1. 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.

    1. 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

    1. 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

    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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

    1. 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)

    1. 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

    1. 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

    1. Start the IPqSVC Windows Service.

    sc.exe START IPqSVC

    1. You can START, QUERY, and STOP this new Windows Service.
      1. sc.exe START  IPqSVC
      2. sc.exe QUERY IPqSVC
      3. sc.exe QC         IPqSVC
      4. sc.exe STOP     IPqSVC

    1. 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
    ------------------------------



  • 7.  RE: Running the SVC IP-Quorum as Windows service

    Posted Tue September 24, 2024 07:43 AM

    Hello all, thank you for sharing all the detailed instructions, that's definitely helpful and will serve me as future reference.

    @Alexander Reichle-Schmehl Hope you can obtain something helpful for your use case as well. It'd be highly appreciated, if you kindly would share your experiences.



    ------------------------------
    Best regards, 

    Christian Schroeder
    IBM Storage Virtualize Support with Passion
    ------------------------------