dsccommunity / DFSDsc

DSC Resource for configuring Windows Distributed File System (Replication and Namespaces)
MIT License
23 stars 19 forks source link

Local Path not being set correctly when using Replication Groups #66

Closed jonathangrice84 closed 6 years ago

jonathangrice84 commented 6 years ago

Details of the scenario you tried and the problem that is occurring: Trying to deploy DSC across two servers (then will add in another 3) in Azure both of which have E:\ attached (its part of the DSC). I don't think I have the right Local Path configuration but feel I have tried every way of writing the local E:!

Below is a screenshot of the Replication Group once completed, notice the Local path?

image

I get the below error when running the dsc but trust me the folder in question exists!

image

We then have the below error when running the diag tool in DFS

image

The DSC configuration that is using the resource (as detailed as possible): The below is an extract from our dsc configuration. Its for the node in the settings file which has a role of DFSPRimary, so this is only for the primary server.

 xDFSReplicationGroup dfsGroup {
                GroupName            = $node.DFSGroupName
                Ensure               = 'Present'  
                Members              = ($allNodes.Where{ $_.NodeRole -contains "Cloud" }).NodeName
                Folders              = 'E:\inetpub'
                Topology             = 'FullMesh'
                PsDscRunAsCredential = $dfsCredential
                DependsOn            = '[WindowsFeature]installDFSMGMT','[File]iisRootFolder'
            }

            xDFSReplicationGroupFolder dfsFolder {
                GroupName              = $node.DFSGroupName
                FolderName             = 'inetpub'
                DirectoryNameToExclude = 'Logs'
                PSDSCRunAsCredential   = $dfsCredential
                DependsOn              = '[xDFSReplicationGroup]dfsGroup'
            }

            xDFSReplicationGroupMembership dfsFolderMembership {
                GroupName            = $node.DFSGroupName
                FolderName           = 'inetpub'
                ComputerName         = ($node.NodeName)
                ContentPath          = 'E:\inetpub'
                PrimaryMember        = $true
                PSDSCRunAsCredential = $dfsCredential
                DependsOn            = "[xDFSReplicationGroupFolder]dfsFolder"
            }

Version of the Operating System and PowerShell the DSC Target Node is running: Windows Server 2016

Version of the DSC module you're using, or 'dev' if you're using current dev branch:

PlagueHO commented 6 years ago

Hi @jonathangrice84 - what seems very strange here is the ReplicatedFolder in the second screenshot is actually showing the "ContentPath" value. I think this is because the Folders in the first resource is wrong - it should actually be 'inetpub'. E.g.

xDFSReplicationGroup dfsGroup {
                GroupName            = $node.DFSGroupName
                Ensure               = 'Present'  
                Members              = ($allNodes.Where{ $_.NodeRole -contains "Cloud" }).NodeName
                Folders              = 'inetpub'
                Topology             = 'FullMesh'
                PsDscRunAsCredential = $dfsCredential
                DependsOn            = '[WindowsFeature]installDFSMGMT','[File]iisRootFolder'
            }

Give that a try and let me know if it resolves the issue.

jonathangrice84 commented 6 years ago

Thanks. That kind of worked. I also lowered the case of the folder path which brought it in!

Thanks for the help!

PlagueHO commented 6 years ago

Awesome! Thanks @jonathangrice84 !