SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

bootstrap new system (systemlink client) bring-up

Solved!
Go to solution

OK, what I'd like to do is create a batch file that automates the bring-up of a new clean system (nothing installed but Windows).

 
I'd like to have a batch file that:
 
  1. downloads NIPM
  2. installs NIPM
  3. upgrades anything needing update (feeds, nipm)
  4. installs system link client
  5. sets a system ID/name/serial (so that it's informative to the system link server)
  6. connect system link client to the system link server
  7. from here we can take over on the SystemLink server (since I can push package installs on the new client)
 
#1 & #2, I have a good solution.
#3 produces an error message (when I try to call "nipkg.exe upgrade ni-package-manager-upgrader" it gives me an error saying sqlite had problems)
#4, 5, 6 - I'm not sure how to do this from the command line. When I call "C:\Program Files\National Instruments\Shared\Systems Management\NISystemLinkClient.exe" /? (query for command line options) it just runs the dialog and doesn't seem to have a CLI. 
 
Any guidance on the best way to do this would be appreciated. Thanks.
0 Kudos
Message 1 of 12
(5,851 Views)

BTW, here's the command line I'm trying to execute and the resulting error:

 

C:\>"C:\Program Files\National Instruments\NI Package Manager\nipkg.exe" upgrade --all --yes --accept-eulas

The following packages will be upgraded:
  ni-package-manager-upgrader, ni-package-manager-released-feed
0 to install, 2 to upgrade, 0 to remove, 0 to downgrade
Need to get 3.95 MB of archives.
After this operation, 0 bytes of additional disk space will be used.
Error -125090: A plugin returned one or more errors at the beginning of the transaction.

Additional error information:
Error -125522: There was a problem calling to the database of installed packages (SQL function call 'sqlite3_prepare_v2' returned error code 14 with error message 'unable to open database file').
Error -125522: There was a problem calling to the database of installed packages (SQL function call 'sqlite3_prepare_v2' returned error code 14 with error message 'unable to open database file').
0 Kudos
Message 2 of 12
(5,846 Views)

OK, so it looks like the sqlite3_prepare_v2 errors were due to needing to run the command as an Administrator.

 

Now, I'm running into the fact that I can't seem to install the ni-systemlink-client from the command-line. It says the package cannot be found.

 

C:\Windows\system32>"C:\Program Files\National Instruments\NI Package Manager\nipkg.exe" install ni-systemlink-client

Unable to locate package: ni-systemlink-client

I'm assuming that I need to somehow add a package feed. However, when I use the NI Package Manager GUI, it shows in the search results just fine. How do I add the right feed from the command line?

0 Kudos
Message 3 of 12
(5,843 Views)
Solution
Accepted by topic author Jim_Kring

I'm not sure what is going on for #3, so I'll let someone else comment on that.

 

#4

#5

  • The minion ID automatically defaults to <model name>--SN-<serial number>--MAC-<MAC address> to ensure uniqueness out of the box and be somewhat descriptive.
  • If you want to change it you just need to modify C:\ProgramData\National Instruments\salt\conf\minion_id and then restart the process (net stop nisaltminion && net start nisaltminion) or reboot.

 

#6

  • Modify C:\ProgramData\National Instruments\salt\conf\minion.d\master.conf
  • set "master: <hostname of your server>"
  • set "master_type: str"
  • for more options like how to specify a failover list check out https://docs.saltstack.com/en/latest/ref/configuration/minion.html
  • Restart the service (net stop nisaltminion && net start nisaltminion) or reboot.
Message 4 of 12
(5,842 Views)

One additional note, you can use the Package Repository from the SystemLink Server to "Replicate" the NI SystemLink Client from ni.com to your own local repository.  Then just use that feed URL in #4 instead of the one on ni.com.  This is useful if your SystemLink Server has internet access, but your targets don't.

Message 5 of 12
(5,841 Views)

Thanks much for your post; we are doing the same thing and I was also trying to figure out how to automate the client configuration to set the server name.

 

One additional trick: I found that copying our custom version of the master.conf file over to the C:\ProgramData\National Instruments\salt\conf\minion.d directory before installing the systemLink client made it so that the restart of the service wasn't necessary, and the server found that the client was pending approval immediately after the client installation was complete.

Message 6 of 12
(5,176 Views)

 Also worth noting that if anyone is planning to create an image of a Windows system with the SystemLink Client pre-installed, I would recommend calling C:\Program Files\National Instruments\Shared\salt-minion\salt-minion-cleanup.bat before you to take the image or after you deploy it.

 

This will ensure that every system has a unique minion ID and set of keys.

0 Kudos
Message 7 of 12
(5,173 Views)

How were you able to download and install NIPM from the command line? (#1 and #2 in your original procedure)

0 Kudos
Message 8 of 12
(5,108 Views)

For myself, I already had NIPackageManager19.0.exe downloaded to a network drive so I just needed a batch file to call

start /wait NIPackageManager19.0.exe /Q

If you needed to also download it you could use powershell or some similar scripting engine to download from here: http://download.ni.com/support/softlib/AST/NIPM/NIPackageManager19.0.exe

 

Here's a link that tells how to use powershell: https://blog.jourdant.me/post/3-ways-to-download-files-with-powershell

Message 9 of 12
(5,103 Views)

Putting it all together, this works well.

 

install_nipm.bat:

REM download to nipm.exe
powershell Invoke-WebRequest -Uri http://download.ni.com/support/softlib/AST/NIPM/NIPackageManager19.0.exe -OutFile nipm.exe

REM install it
start /wait nipm.exe /Q
Message 10 of 12
(5,102 Views)