Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone fileshare template won't deploy in v3.2.0 #324

Closed
jhevenor opened this issue May 20, 2021 · 5 comments
Closed

Standalone fileshare template won't deploy in v3.2.0 #324

jhevenor opened this issue May 20, 2021 · 5 comments
Assignees
Labels
bug Something isn't working Fixed Label for when an issue is fixed.

Comments

@jhevenor
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request

Module Version

  • 3.2.0

Affected Resource(s)

  • Fileshare

Configuration Files

{
    "AllNodes": [
        {
            "NodeName": "10.100.1.212",
            "Role": [
                "FileShare"
            ]
        }
    ],
    "ConfigData": {
        "Version": "10.8.1",
        "FileShareLocalPath": "F:\\gis-share",
        "FileShareName": "gis-server",
        "Credentials": {
            "ServiceAccount": {
                "Password": "********",
                "UserName": "<machineaccount>",
                "IsDomainAccount": false
            }
        }
    }
}

Expected Behavior

Fileshare is created on the specified machine

Actual Behavior

Receive error:

| Start-DscConfiguration : The computer name was not specified and the configuration directory does not have any configuration files.

Steps to Reproduce

Invoke-ArcGISConfiguration `
  -ConfigurationParametersFile $smbBuiltTemplate `
  -Mode InstallLicenseConfigure `
  -Credential $credential `
  -DebugSwitch

Important Factoids

  • Running on aws/ec2 in region ca-central-1
  • Running without domain using IP addr for node
  • Same templates run on v3.1.1
  • Part of a 3 template deployment (cfn-init, running as SYSTEM initially, same result when I run manually)
    • End result is 1 fileshare VM, 2x GP server, 2x image server

What I've tried

  • If I include a "server" node in that template I get further
  • If I remove the -credential parameter (but running as same user) I get further (fail on Trace-DSCJob access denied)

References

@cameronkroeker
Copy link
Contributor

Hello @jhevenor,

This was an oversight when we added support for gMSA, and will be addressed in a future release. However, in the meantime here is a workaround:

After line 42 in the following location insert the following:

https://github.com/Esri/arcgis-powershell-dsc/blob/master/Modules/ArcGIS/Configurations-OnPrem/ArcGISFileShare.ps1#L42

$DependsOn = @()
        if($null -ne $ServiceCredential){
            if(-not($ServiceCredentialIsDomainAccount) -and -not($ServiceCredentialIsMSA)){
                User ArcGIS_RunAsAccount
                {
                    UserName = $ServiceCredential.UserName
                    Password = $ServiceCredential
                    FullName = 'ArcGIS Run As Account'
                    Ensure = "Present"
                    PasswordChangeRequired = $false
                    PasswordNeverExpires = $true
                }
                $DependsOn += '[User]ArcGIS_RunAsAccount'
            }
        }

Then after this line insert DependsOn = $DependsOn

https://github.com/Esri/arcgis-powershell-dsc/blob/master/Modules/ArcGIS/Configurations-OnPrem/ArcGISFileShare.ps1#L51

So end result should look like the following:

 Node $AllNodes.NodeName 
    {   
        if($Node.Thumbprint){
            LocalConfigurationManager
            {
                CertificateId = $Node.Thumbprint
            }
        }
        
        $DependsOn = @()
        if($null -ne $ServiceCredential){
            if(-not($ServiceCredentialIsDomainAccount) -and -not($ServiceCredentialIsMSA)){
                User ArcGIS_RunAsAccount
                {
                    UserName = $ServiceCredential.UserName
                    Password = $ServiceCredential
                    FullName = 'ArcGIS Run As Account'
                    Ensure = "Present"
                    PasswordChangeRequired = $false
                    PasswordNeverExpires = $true
                }
                $DependsOn += '[User]ArcGIS_RunAsAccount'
            }
        }
        
        ArcGIS_FileShare FileShare
        {
            FileShareName = $FileShareName
            FileShareLocalPath = $FileShareLocalPath
            Ensure = 'Present'
            Credential = $ServiceCredential
            FilePaths = if($FilePaths -and ($FilePaths -ne "")){ $FilePaths }else{ $null }
            IsDomainAccount = $ServiceCredentialIsDomainAccount
            IsMSAAccount = $ServiceCredentialIsMSA
            DependsOn = $DependsOn
        }        
    }

Thanks,
Cameron K.

@cameronkroeker cameronkroeker added bug Something isn't working will fix labels May 20, 2021
@cameronkroeker cameronkroeker self-assigned this May 20, 2021
@cameronkroeker
Copy link
Contributor

Hello @jhevenor,

This issue has been addressed in the latest release, v3.3.0:

https://github.com/Esri/arcgis-powershell-dsc/releases/tag/v3.3.0

Thanks,
Cameron K.

@jhevenor
Copy link
Author

Hi @cameronkroeker , I'm having a run through with the new release and I see what looks to be the same problem as before. Same template (IP address for node name, local machine/non-domain account for service account), same error as above. I had a look and the new code in OnPrem/ArcGISFileShare.ps1 looks like the suggested fix from above.

I never got to implement the suggest fix as I got pulled to other thing, and didn't want to get into managing my own adjusted versions. Sorry, I may have found the problem earlier.

@cameronkroeker
Copy link
Contributor

Hi @cameronkroeker , I'm having a run through with the new release and I see what looks to be the same problem as before. Same template (IP address for node name, local machine/non-domain account for service account), same error as above. I had a look and the new code in OnPrem/ArcGISFileShare.ps1 looks like the suggested fix from above.

I never got to implement the suggest fix as I got pulled to other thing, and didn't want to get into managing my own adjusted versions. Sorry, I may have found the problem earlier.

Hi @jhevenor,

My apologies I had misunderstood the original issue, however, I now realize what is happening. The behavior you are reporting is expected. The FileShare Role won't work in standalone mode because an ArcGIS Component needs to be passed along with it. The error Start-DscConfiguration : The computer name was not specified and the configuration directory does not have any configuration files. is coming from the ArcGISInstall DSC Job since nothing is being passed into it.

Here are two examples that will work.
Example 1:

"AllNodes": [
        {
            "NodeName": "<insert node1 ip or hostname>",
            "Role": [
                "FileShare"
            ]
        },
		{
            "NodeName": "<insert node2 ip or hostname>",
            "Role": [
                "Server"
            ]
        }
    ],
    "ConfigData": {
        "Version": "10.9",
        "ServerContext": "multiserver",
        "FileShareLocalPath": "C:\\share",
        "FileShareName": "share",

Example 2:

"AllNodes": [
        {
            "NodeName": "<insert node1 ip or hostname>",
            "Role": [
                "FileShare",
                "Server"
            ]
        }
    ],
    "ConfigData": {
        "Version": "10.9",
        "ServerContext": "multiserver",
        "FileShareLocalPath": "C:\\share",
        "FileShareName": "share",

Thanks,
Cameron K.

@jhevenor
Copy link
Author

Thanks @cameronkroeker , I'll give this a go at some point this week.

@cameronkroeker cameronkroeker added Fixed Label for when an issue is fixed. and removed will fix labels Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Label for when an issue is fixed.
Projects
None yet
Development

No branches or pull requests

2 participants