xSCOM 1.3.3.0 在 Azure VM 上运行 DSC 时引发异常

Posted

技术标签:

【中文标题】xSCOM 1.3.3.0 在 Azure VM 上运行 DSC 时引发异常【英文标题】:xSCOM 1.3.3.0 throws an Exception when running DSC on Azure VM 【发布时间】:2022-01-18 05:04:22 【问题描述】:

全部,

我正在尝试自动化基础架构,其中我使用 Azure DevOps CI/CD 管道部署 VM,并使用 DSC 使用模块 XSCOM 1.3.3.0 配置/安装 SCOM。根据我的同事的说法,以下代码适用于 VMWare 虚拟机。

问题: 对以下错误或以自动化方式在 Azure 机器上安装 SCOM 的任何其他方法有任何想法吗?

DSC 代码:

xSCOMManagementServerSetup "OMMS"

  DependsOn         = @('[Package]ODBCDriver13', '[Package]SQLClient11')
         Ensure     = "Present"
          SourcePath        = $SCM2016Path
          SetupCredential   = $AdminCreds
          #ProductKey       = $Node.SCM2016Key
          ManagementGroupName   = $MgmtGrp
          InstallPath       = $SCM2016InstallPath
          FirstManagementServer = $false
          ActionAccount     = $OpsActionCredential
          DASAccount        = $OpsSDKCredential
          DataReader        = $OpsDRACredential
          DataWriter        = $OpsDWACredential
          SqlServerInstance     = $SCM2016DB
          DatabaseSize      = $DatabaseSize
          DwSqlServerInstance   = $SCM2016DWDB
          DWDatabaseSize    = $DWDatabaseSize
 # UseMicrosoftUpdate   = 
        

xSCOMWebConsoleServerSetup "OMWC"
        
          DependsOn             = '[xSCOMManagementServerSetup]OMMS'
          Ensure            = "Present"
          SourcePath            = $SCM2016Path
          SetupCredential       = $AdminCreds
  InstallPath           = $SCM2016InstallPath
          ManagementServer      = $nodename
  WebSiteName           = "Default Web Site"
  WebConsoleAuthorizationMode   = "Mixed"
  WebConsoleUseSSL      = $false
    

xSCOMConsoleSetup "OMC"
    
         DependsOn      = '[xSCOMWebConsoleServerSetup]OMWC'
          Ensure        = "Present"
          SourcePath        = $SCM2016Path
  InstallPath       = $SCM2016InstallPath
          SetupCredential   = $AdminCreds
       

错误:

Job 94883009-5CFE-11EC-A811-002248041883 :
Message Set-TargetResouce failed
HResult -2146233087
StackTrack    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32& resultStatusHandle, Collection`1& result, ErrorRecord& errorRecord, PSModuleInfo localRunSpaceModuleInfo)

【问题讨论】:

【参考方案1】:

所有 System Center Operations Manager (SCOM) 单个管理组部署要么是“一体式”安装,其中所有功能都加载在单个服务器上,要么是分布式安装。 Deploying System Center Operations Manager 描述了更多相同的内容。

Install-SCOMAgent cmdlet 使用客户端推送安装部署一个或多个 System Center 2019 - Operations Manager 和更高版本的产品代理。下面的代码 sn-p 显示了语法。

Install-SCOMAgent
       [-ActionAccount <PSCredential>]
       [-AgentActionAccount <PSCredential>]
       -DNSHostName <String[]>
       -PrimaryManagementServer <ManagementServer>
       [-NoAPM]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

查看Install-SCOMAgent 文档以获取示例。还要检查Setup and configure Log Analytics using SCOM。

但据我所知,如果不先卸载 Log Analytics/Azure 监控代理,就无法安装 SCOM 管理服务器角色。之后,您应该能够使用 SCOM 代理连接到您的服务器以连接到 Log Analytics 工作区,请查看 Connect Operations Manager to Azure Monitor 了解更多信息。

还要检查此Automate SCOM 2016 installation with PowerShell 以自动在 azure 虚拟机 (Windows Server 2016) 上安装 SCOM。

【讨论】:

以上是关于xSCOM 1.3.3.0 在 Azure VM 上运行 DSC 时引发异常的主要内容,如果未能解决你的问题,请参考以下文章

在Azure中重新部署VM

在 Azure 的 VM 中意外禁用 RDP

Azure 数据科学 VM 和 Azure 深度学习 VM 之间的区别

NEstted Virtualization在Azure VM上不起作用

使用即时VM访问保护Azure VM

使用Azure虚机映像创建VM