DSCConfiguration update error while using xHyper-v resource to create HV Switch

This topic contains 10 replies, has 2 voices, and was last updated by Profile photo of Shruthin Shruthin 3 weeks, 2 days ago.

  • Author
    Posts
  • #56818
    Profile photo of Shruthin
    Shruthin
    Participant

    I ran a DSC script to install Hyperv/Failover Cluster and configure a internal switch. It generated a Mof file, i have assigned a GUID and Checksumed the configuration.Mof. When i am trying to update the configuration iam seeing the error which i have attached below. I configured an SMB Pull server where i am saving my configuration.Mof files. I have set the LCM of my physical host to pull the configuration from the SMB pull server. I have xHyper-v and xPSDesiredStateConfiguration modules with NuGet on my Management workstation's C:\Program Files\WindowsPowerShell\Modules directory

    Error Message:

    The file \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip is not found.
    + CategoryInfo : ObjectNotFound: (\\pull-Server\D...r-V_3.5.0.0.zip:String) [], CimException
    + FullyQualifiedErrorId : DSCFileFileNotFound,Microsoft.PowerShell.DesiredStateConfiguration.DownloadManager.FileGetModuleComman
    d
    + PSComputerName : DSC-Hyperv4

    Configuration Script I am using:

    configuration HyperVbuild
    
    {
    
         param (
    
               [string]$NodeName = 'DSC-Hyperv4'
    
         )
    
         Import-DscResource -ModuleName xHyper-V
    
         node $NodeName {
    
               WindowsFeature 'Hyper-V' {
    
                    Ensure='Present'
    
                    Name='Hyper-V'
    
               }
    
               WindowsFeature 'Hyper-V-Powershell' {
    
                    Ensure='Present'
    
                    Name='Hyper-V-Powershell'
    
               }
    
               WindowsFeature FullGUI {
                Name = 'Server-Gui-Shell'
                Ensure = 'Present'
                }
    
    
               File VMsDirectory
    
               {
    
                    Ensure = 'Present'
    
                    Type = 'Directory'
    
                    DestinationPath = "$($env:SystemDrive)\VMs"
    
               }
    
               xVMSwitch LabSwitch {
    
                    DependsOn = '[WindowsFeature]Hyper-V'
    
                    Name = 'LabSwitch'
    
                    Ensure = 'Present'
    
                    Type = 'Internal'
                }
    
                WindowsFeature FM {
                Name = 'Failover-Clustering'
                Ensure = 'Present'
                }
    
                WindowsFeature FMMGMT {
                Name = 'RSAT-Clustering'
                Ensure = 'Present'
                DependsOn = '[WindowsFeature]FM'
    
     }
    
     }
    
    }
    
    HyperVBuild -outputpath \\pull-server\dscsmb
    

    My Configuration MOf:

    /*
    @TargetNode='DSC-Hyperv4'
    @GeneratedBy=administrator
    @GenerationDate=11/03/2016 11:40:19
    @GenerationHost=SR-MGMT01
    */
    
    instance of MSFT_RoleResource as $MSFT_RoleResource1ref
    {
    ResourceID = "[WindowsFeature]Hyper-V";
     Ensure = "Present";
     SourceInfo = "::15::12::WindowsFeature";
     Name = "Hyper-V";
     ModuleName = "PsDesiredStateConfiguration";
    
    ModuleVersion = "1.0";
    
     ConfigurationName = "HyperVbuild";
    
    };
    instance of MSFT_RoleResource as $MSFT_RoleResource2ref
    {
    ResourceID = "[WindowsFeature]Hyper-V-Powershell";
     Ensure = "Present";
     SourceInfo = "::23::12::WindowsFeature";
     Name = "Hyper-V-Powershell";
     ModuleName = "PsDesiredStateConfiguration";
    
    ModuleVersion = "1.0";
    
     ConfigurationName = "HyperVbuild";
    
    };
    instance of MSFT_RoleResource as $MSFT_RoleResource3ref
    {
    ResourceID = "[WindowsFeature]FullGUI";
     Ensure = "Present";
     SourceInfo = "::31::12::WindowsFeature";
     Name = "Server-Gui-Shell";
     ModuleName = "PsDesiredStateConfiguration";
    
    ModuleVersion = "1.0";
    
     ConfigurationName = "HyperVbuild";
    
    };
    instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref
    {
    ResourceID = "[File]VMsDirectory";
     Type = "Directory";
     Ensure = "Present";
     DestinationPath = "C:\\VMs";
     ModuleName = "PSDesiredStateConfiguration";
     SourceInfo = "::37::12::File";
    
    ModuleVersion = "1.0";
    
     ConfigurationName = "HyperVbuild";
    
    };
    instance of MSFT_xVMSwitch as $MSFT_xVMSwitch1ref
    {
    ResourceID = "[xVMSwitch]LabSwitch";
     Type = "Internal";
     Ensure = "Present";
     SourceInfo = "::49::12::xVMSwitch";
     Name = "LabSwitch";
     ModuleName = "xHyper-V";
     ModuleVersion = "3.5.0.0";
    
    DependsOn = {
    
        "[WindowsFeature]Hyper-V"};
    
     ConfigurationName = "HyperVbuild";
    
    };
    instance of MSFT_RoleResource as $MSFT_RoleResource4ref
    {
    ResourceID = "[WindowsFeature]FM";
     Ensure = "Present";
     SourceInfo = "::60::13::WindowsFeature";
     Name = "Failover-Clustering";
     ModuleName = "PsDesiredStateConfiguration";
    
    ModuleVersion = "1.0";
    
     ConfigurationName = "HyperVbuild";
    
    };
    instance of MSFT_RoleResource as $MSFT_RoleResource5ref
    {
    ResourceID = "[WindowsFeature]FMMGMT";
     Ensure = "Present";
     SourceInfo = "::65::13::WindowsFeature";
     Name = "RSAT-Clustering";
     ModuleName = "PsDesiredStateConfiguration";
    
    ModuleVersion = "1.0";
    
    DependsOn = {
    
        "[WindowsFeature]FM"};
    
     ConfigurationName = "HyperVbuild";
    
    };
    instance of OMI_ConfigurationDocument
    
    
                        {
     Version="2.0.0";
     
    
                            MinimumCompatibleVersion = "1.0.0";
     
    
                            CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"};
     
    
                            Author="administrator";
     
    
                            GenerationDate="11/03/2016 11:40:19";
     
    
                            GenerationHost="SR-MGMT01";
     
    
                            Name="HyperVbuild";
    
    
                        };
    
  • #56819
    Profile photo of Don Jones
    Don Jones
    Keymaster

    The error's pretty much all you need to know:

    The file \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip is not found.

    The node running the MOF doesn't have the xHyperV module. It's looking for it on your pull server, in the filename shown, along with a corresponding checksum file. It isn't sufficient to just have the module on your workstation; the node can't get it from there. It defaults to getting modules from the same pull server as its configuration MOF.

  • #56821
    Profile photo of Shruthin
    Shruthin
    Participant

    Here is how my environment is setup and i have copied all the required modules on all the host involved except my client which is pulling the configuration. I see the same error all the time. I even tried to copy the xHyper-v zip file to SMB share and the result is same

    SR-Mgmt- This is my Management workstation and here are all my DSC scripts and i am executing the scripts from here and it has xHyper-v/xPSDesiredStateConfiguration Module's copied into its C:\Program Files\WindowsPowerShell\Modules directory.

    SMB Pull-server- I have my SMB pull server setup on a VM and the VM has the modules copied into its C:\Program Files\WindowsPowerShell\Modules directory

    DSC-Hyperv4- Is the physical host whose LCM is configured to pull the configuration from SMB PUll server

    Thanks for your quick response

  • #56824
    Profile photo of Shruthin
    Shruthin
    Participant

    Everything is working fine if i exclude the xVMSwitch configuration from the above script. The error is only seen which i add xVMSwitch configuration to the script

    xVMSwitch LabSwitch {
    
                    DependsOn = '[WindowsFeature]Hyper-V'
    
                    Name = 'LabSwitch'
    
                    Ensure = 'Present'
    
                    Type = 'Internal'
                }
    
  • #56830
    Profile photo of Don Jones
    Don Jones
    Keymaster

    That's because xVMSwitch is the only resource you're using that requires the xHyper-V module. Removing it removes the need for the module.

    The problem is that DSC-Hyperv4 is not able to find \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip and \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip.checksum. You said:

    SMB Pull-server- I have my SMB pull server setup on a VM and the VM has the modules copied into its C:\Program Files\WindowsPowerShell\Modules directory

    But that is not where DSC-Hyperv4 is looking. It is expecting the ZIP and checksum file to be at this UNC: \\pull-Server\DSCSMB\.

    You could also manually deploy the xHyper-V module to DSC-Hyper4, just by copying its files from your workstation. It would go in the same location under Program Files.

  • #56834
    Profile photo of Shruthin
    Shruthin
    Participant

    The problem is that DSC-Hyperv4 is not able to find \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip and \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip.checksum. You said:

    I am a little confused on this. I have to checksum the Configuration.MOF file right? But the Hyper-v_3.5.0.0.zip is the DSC Resource module and i dont understand why do we need to checksum the resource module. I dont even know if that can be done

    Thanks for you response Don

  • #56836
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Checksums are required. New-DscChecksum can produce a checksum for any file, not just a MOF. The LCM requires a checksum for resource module ZIP files, and for MOF files. You have to do both.

    https://blogs.msdn.microsoft.com/powershell/2013/12/05/how-to-deploy-and-discover-windows-powershell-desired-state-configuration-resources/ discusses this, as does the formal DSC documentation.

  • #56924
    Profile photo of Shruthin
    Shruthin
    Participant

    Thanks for the help Don. I copied the xHyper-v resource to my hyper-v host and everything started working fine and i could see the internal Switch created. I will look into the configuration again to see if something is blocking the hyper-v host to Pull the Resources from the Pull Server

  • #57661
    Profile photo of Shruthin
    Shruthin
    Participant

    Hi Don i have verified the process to see if checksuming the xHyper resource will resolve the error which i am seeing and the result is negative. I have placed both checksum and the xHyperv resource in the SMB pull server directory where the client is looking to pull the resources from as shown in the error message below and also i have placed the Checksum with xHyperv in the resources folder on the pull server and still seeing same error

    The file \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip is not found.
    + CategoryInfo : ObjectNotFound: (\\pull-Server\D...r-V_3.5.0.0.zip:String) [], CimException
    + FullyQualifiedErrorId : DSCFileFileNotFound,Microsoft.PowerShell.DesiredStateConfiguration.DownloadManager.FileGetModuleComman
    d
    + PSComputerName : DSC-Hyperv4

    The only workaround for this is to copy the xHyperv resource to the client. Is that the right way to do it? doesn't it beat the whole purpose of DSC if i have to copy the resources to all the client nodes

    Also so far i have seen this behavior with only xHyperv resource and not with xPSDesiredStateConfiguration resource module. I Still did not get why the DSC behavior is different for both the resource modules

    Thanks in advance and i would really appreciate your feedback on this behavior

  • #57662
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Can you, from a Windows client computer, hit Windows+R, enter \\pull-Server\DSCSMB\xHyper-V_3.5.0.0.zip, and get the file?

    If you do Windows+R, enter \\pull-Server\DSCSMB\, and hit OK, what do you see?

  • #57790
    Profile photo of Shruthin
    Shruthin
    Participant

    Yes when i hit Windows+R, and Entered \\pull-server\DSCSMB\Hyper-v_3.5.0.0.zip i can get into the xHyper-v_3.5.0.0 directory on SMB pull server from client and i can see that there are other sub-directories in xHyper-v_3.5.0.0 directory

    I am seeing this new error attached below when i checksumed the xHyper-v_3.5.0.0.zip file. The reason why i saw the "File not found error" yesterday even after checksuming is because the zip file extension was spelled twice.

    Module file xHyper-V did not contain a module with required version 3.5.0.0.
    + CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : ModuleFileVersionValidation
    + PSComputerName : NHV-1

    Also when i executed get-module command i see the xHyper-v module name and version number 3.5.0.0 but it shows empty list under ExportedCommands. Where as all other modules has ExportedCommands list as shown below

    ModuleType Version Name ExportedCommands
    ———- ——- —- —————-
    Script 1.0 GroupSet {BuildResourceCommonParameters, BuildResourceString, GroupSet}
    Binary 2.0.0.0 Hyper-V {Add-VMAssignableDevice, Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMGpuPartitionAdapter...}
    Script 1.0.0.0 ISE {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
    Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
    Manifest 3.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature...}
    Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
    Manifest 3.0.0.0 Microsoft.WSMan.Management {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP...}
    Binary 1.0.0.1 PackageManagement {Find-Package, Find-PackageProvider, Get-Package, Get-PackageProvider...}
    Script 1.0.0.1 PowerShellGet {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability...}
    Script 1.0 ProcessSet {BuildResourceCommonParameters, BuildResourceString, ProcessSet}
    Manifest 1.1 PSDesiredStateConfiguration {Invoke-DscResource, Publish-DscConfiguration, Set-DscLocalConfigurationManager, Start-DscConfiguration...}
    Script 2.0.0.0 ServerManager {Get-WindowsFeature, Install-WindowsFeature, Uninstall-WindowsFeature, Disable-ServerManagerStandardUserRemoting...}
    Script 1.0 ServiceSet {BuildResourceCommonParameters, BuildResourceString, ServiceSet}
    Script 1.0 WindowsFeatureSet {BuildResourceCommonParameters, BuildResourceString, WindowsFeatureSet}
    Script 1.0 WindowsOptionalFeatureSet {BuildResourceCommonParameters, BuildResourceString, WindowsOptionalFeatureSet}
    Script 1.0 xFileUpload xFileUpload
    Script 0.1.0.0 xGroupSet {New-ResourceCommonParameterString, New-ResourceString, xGroupSet}
    Manifest 3.5.0.0 xHyper-V
    Script 0.1.0.0 xProcessSet {New-ResourceCommonParameterString, New-ResourceString, xProcessSet}
    Script 0.1.0.0 xServiceSet {New-ResourceCommonParameterString, New-ResourceString, xServiceSet}
    Script 0.1.0.0 xWindowsFeatureSet {New-ResourceCommonParameterString, New-ResourceString, xWindowsFeatureSet}
    Script 0.1.0.0 xWindowsOptionalFeatureSet {New-ResourceCommonParameterString, New-ResourceString, xWindowsOptionalFeatureSet}

You must be logged in to reply to this topic.