Select to view content in your preferred language

ArcGIS Server site creation using SSM

315
3
Jump to solution
3 weeks ago
MikaelJ
Regular Contributor

Hey,

 

currently we are exploring the options of automatic deployments of ArcGIS Enterprise in AWS.

For some internal regulations we cannot use Powershell DSC, Cloudformation, AMIs, Chefcookbooks.

 

We've decided to try with PowerShell scripts and SSM.

 

Currently via SSM I am failing with running createsite.bat. It won't work.

I am able to create with the same PowerShell snippet locally running from RDP or just via regular browser.

 

Does anyone have any insights what may be causing this?

 

Specs:

ArcGIS Server 11.5

AWS EC2

service account running the ags service: LocalSystem

 

Regards,

MJ

0 Kudos
1 Solution

Accepted Solutions
MikaelJ
Regular Contributor

Hey @GlenterpriseUK  @ArchitSrivastava ,

 

yes, I've tried with properties files as an argument the result was exactly the same.

I was able to move on, with rest/admin HTTP call to create ArcGIS Site.

Right now, I am observing similar situation, but with ArcGIS DataStore.

Can you shed the light how one can troubleshoot SSM in ArcGIS Enterprise context?

edit:

--- STDOUT ---
"Error: AGSDATASTORE variable is not set."

 

After setting the value:
$env:AGSDATASTORE = $InstallDir

it ran flawlessly, so SSM was missing this env setting which is regularly being set during the installation process.

 

Thank you for your commitment @ArchitSrivastava  @GlenterpriseUK 

Regards,

MJ

View solution in original post

0 Kudos
3 Replies
GlenterpriseUK
Esri Contributor

Hi @MikaelJ,

What is the error that you get via SSM?

Have you tried runnning createsite.bat with the following parameters [-u <arg>] [-p <arg>] [-d <arg>] [-c <arg>] or have you also tried with the option of having a createsite.properties file containing parameters as specified here: https://enterprise.arcgis.com/en/server/11.5/install/windows/silently-install-arcgis-server.htm#:~:t...

I have a feeling that the issue you are observing is likely happening because SSM runs your script in a non-interacive session under the system account which behaves differently from an RDP session.

Regards,

Glen

MikaelJ
Regular Contributor

Hey @GlenterpriseUK  @ArchitSrivastava ,

 

yes, I've tried with properties files as an argument the result was exactly the same.

I was able to move on, with rest/admin HTTP call to create ArcGIS Site.

Right now, I am observing similar situation, but with ArcGIS DataStore.

Can you shed the light how one can troubleshoot SSM in ArcGIS Enterprise context?

edit:

--- STDOUT ---
"Error: AGSDATASTORE variable is not set."

 

After setting the value:
$env:AGSDATASTORE = $InstallDir

it ran flawlessly, so SSM was missing this env setting which is regularly being set during the installation process.

 

Thank you for your commitment @ArchitSrivastava  @GlenterpriseUK 

Regards,

MJ

0 Kudos
ArchitSrivastava
Frequent Contributor

Hello @MikaelJ ,

I agree with @GlenterpriseUK point about the SSM session context is where I would start as well.

Since the same script works when you run it from RDP, or when you create the site through the browser, it feels like the issue may be less about createsite.bat itself and more about how the command is being run through SSM.

A few things I would check:

  • What account the SSM command is actually running under, likely NT AUTHORITY\SYSTEM
  • Whether that account has the permissions you expect
  • Whether you are calling createsite.bat using the full path
  • Whether the script sets the working directory before running createsite.bat
  • Whether the config store and server directories paths already exist
  • Whether the account running the command can create or write to those folders
  • Whether any path uses a mapped drive, since those usually do not exist in a non-interactive SSM session
  • Whether passwords or special characters are being handled differently when passed through SSM/PowerShell
  • Whether stdout, stderr, and the exit code are being written to a log file

I would also try using a createsite.properties file instead of passing everything directly in the SSM command. That might make the test cleaner and avoid some quoting or escaping issues, especially with passwords and folder paths.

For example:

Set-Location "C:\Program Files\ArcGIS\Server\tools\createsite"
.\createsite.bat -f "C:\Temp\createsite.properties" *> "C:\Temp\createsite_ssm.log"

If the same properties file works from RDP but fails through SSM, that would help narrow it down to the SSM execution context, permissions, working directory, or folder access, rather than the site creation parameters themselves.

Hope it helps!