您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

从 Orchestrator 迁移到 Azure 自动化 (Beta)Migrate from Orchestrator to Azure Automation (Beta)

System Center 2012 - Orchestrator 中的 Runbook 基于专为 Orchestrator 编写的集成包中的活动,而 Azure 自动化中的 Runbook 则基于 Windows PowerShell。Runbooks in System Center 2012 - Orchestrator are based on activities from integration packs that are written specifically for Orchestrator, while runbooks in Azure Automation are based on Windows PowerShell. Azure 自动化中的图形 Runbook 具有的外观类似于其活动用于表示 PowerShell cmdlet、子 Runbook 和资产的 Orchestrator Runbook。Graphical runbooks in Azure Automation have a similar appearance to Orchestrator runbooks, with their activities representing PowerShell cmdlets, child runbooks, and assets. 除了转换 Runbook 本身,还必须将包含 Runbook 所用活动的集成包转换为包含 Windows PowerShell cmdlet 的集成模块。In addition to converting runbooks themselves, you must convert the integration packs with the activities that the runbooks use to integration modules with Windows PowerShell cmdlets.

Service Management Automation (SMA) 在本地数据中心(如 Orchestrator)运行 Runbook,并使用相同的集成模块(如 Azure 自动化)。Service Management Automation (SMA) stores and runs runbooks in your local datacenter like Orchestrator, and it uses the same integration modules as Azure Automation. Runbook 转换器将 Orchestrator Runbook 转换为图形 Runbook,而 SMA 不支持图形 Runbook。The Runbook Converter converts Orchestrator runbooks to graphical runbooks, which are not supported in SMA. 仍可将标准活动模块和 System Center Orchestrator 集成模块安装到 SMA,但是必须手动重新编写 RunbookYou can still install the Standard Activities Module and System Center Orchestrator Integration Modules into SMA, but you must manually rewrite your runbooks.

下载 Orchestrator 迁移工具包Download the Orchestrator migration toolkit

迁移的第一步是下载 System Center Orchestrator 迁移工具包The first step in migration is to download the System Center Orchestrator Migration Toolkit. 此工具包包含有助于将 Runbook 从 Orchestrator 转换为 Azure 自动化的工具。This toolkit includes tools to assist you in converting runbooks from Orchestrator to Azure Automation.

导入标准活动模块Import the Standard Activities module

标准活动模块导入 Azure 自动化中。Import the Standard Activities Module into Azure Automation. 这包括转换后的图形 runbook 可以使用的标准 Orchestrator 活动的转换版本。This includes converted versions of standard Orchestrator activities that converted graphical runbooks can use.

导入 Orchestrator 集成模块Import Orchestrator integration modules

Microsoft 提供集成包用于构建 Runbook 来自动化 System Center 组件和其他产品。Microsoft provides integration packs for building runbooks to automate System Center components and other products. 其中的某些集成包目前基于 OIT,但由于已知的问题,无法转换为集成模块。Some of these integration packs are currently based on OIT but cannot currently be converted to integration modules because of known issues. 针对访问 System Center 的 Runbook 使用的集成包,将 System Center Orchestrator 集成模块导入到 Azure 自动化中。Import System Center Orchestrator Integration Modules into Azure Automation for the integration packs used by your runbooks that access System Center. 此包包含这些集成包的已转换版本,可以将其导入 Azure 自动化和 Service Management Automation。This package includes converted versions of the integration packs that can be imported into Azure Automation and Service Management Automation.

转换集成包Convert integration packs

使用集成包转换器将使用 Orchestrator Integration Toolkit (OIT) 创建的任何集成包转换为可导入到 Azure 自动化或 Service Management Automation 中的基于 PowerShell 的集成模块。Use the Integration Pack Converter to convert any integration packs created using the Orchestrator Integration Toolkit (OIT) to PowerShell-based integration modules that can be imported into Azure Automation or Service Management Automation. 运行集成包转换器时,系统会显示一个向导,可以通过该向导选择集成包 (.oip) 文件。When you run the Integration Pack Converter, you are presented with a wizard that allows you to select an integration pack (.oip) file. 然后,该向导会列出该集成包中包括的活动,并允许选择要迁移的活动。The wizard then lists the activities included in that integration pack and allows you to select which activities to migrate. 完成向导的操作后,向导会创建一个集成模块,其中包含原始集成包中每个活动的相应 cmdlet。When you complete the wizard, it creates an integration module that includes a corresponding cmdlet for each of the activities in the original integration pack.

备注

不能使用集成包转换器转换未使用 OIT 创建的集成包。You can't use the Integration Pack Converter to convert integration packs that were not created with OIT. 另外还有一些 Microsoft 提供的集成包目前无法使用此工具转换。There are also some integration packs provided by Microsoft that can't currently be converted with this tool. 已支持下载这些集成包的已转换版本,以便将其安装在 Azure 自动化或 Service Management Automation 中。Converted versions of these integration packs are provided for download so that they can be installed in Azure Automation or Service Management Automation.

参数Parameters

集成包中活动的任何属性都将转换为集成模块中相应 cmdlet 的参数。Any properties of an activity in the integration pack are converted to parameters of the corresponding cmdlet in the integration module. Windows PowerShell cmdlet 有一组可以用于所有 cmdlet 的通用参数Windows PowerShell cmdlets have a set of common parameters that can be used with all cmdlets. 例如,-Verbose 参数会导致 cmdlet 输出关于其操作的详细信息。For example, the -Verbose parameter causes a cmdlet to output detailed information about its operation. cmdlet 的参数与通用参数不能有相同的名称。No cmdlet may have a parameter with the same name as a common parameter. 如果某个活动的属性与通用参数具有相同的名称,向导会提示为参数提供另一个名称。If an activity does have a property with the same name as a common parameter, the wizard prompts you to provide another name for the parameter.

监视活动Monitor activities

在 Orchestrator 中监视 Runbook 以监视活动开头,并会持续运行,等待被特定事件调用。Monitor runbooks in Orchestrator start with a monitor activity and run continuously waiting to be invoked by a particular event. Azure 自动化不支持监视 Runbook,因此集成包中的任何监视活动都不会进行转换。Azure Automation does not support monitor runbooks, so any monitor activities in the integration pack is not converted. 与之相反,系统会在集成模块中为监视活动创建一个占位符 cmdlet。Instead, a placeholder cmdlet is created in the integration module for the monitor activity. 此 cmdlet 没有任何功能,但可以通过它来安装使用它的任何已转换 Runbook。This cmdlet has no functionality, but it allows any converted runbook that uses it to be installed. 此 Runbook 将不能在 Azure 自动化中运行,但可以进行安装,因此可以对其进行修改。This runbook is not able to run in Azure Automation, but it can be installed so that you can modify it.

Orchestrator 包括一组标准活动,这些活动未包括在集成包中,而是由多个 Runbook 使用。Orchestrator includes a set of standard activities that are not included in an integration pack but are used by many runbooks. “标准活动”模块是一个集成模块,其中包含每个此类活动的 cmdlet 等效项。The Standard Activities module is an integration module that includes a cmdlet equivalent for each of these activities. 在导入任何使用标准活动的已转换 Runbook 之前,必须在 Azure 自动化中安装此集成模块。You must install this integration module in Azure Automation before importing any converted runbooks that use a standard activity.

除了支持转换后的 Runbook,标准活动模块中的 cmdlet 还可由熟悉 Orchestrator 的人用来在 Azure 自动化中构建新的 Runbook。In addition to supporting converted runbooks, the cmdlets in the standard activities module can be used by someone familiar with Orchestrator to build new runbooks in Azure Automation. 虽然可以使用 cmdlet 来执行所有标准活动的功能,但这些活动可能会以不同方式运行。While the functionality of all of the standard activities can be performed with cmdlets, they may operate differently. 转换后的标准活动模块中的 cmdlet 的工作方式与其相应活动的工作方式相同,并使用相同的参数。The cmdlets in the converted standard activities module work in the same way as their corresponding activities and use the same parameters. 这可以帮助你过渡到 Azure 自动化 runbook。This can help you in transitioning to Azure Automation runbooks.

转换 Orchestrator runbookConvert Orchestrator runbooks

Orchestrator Runbook 转换器将 Orchestrator Runbook 转换为可导入 Azure 自动化的图形 RunbookThe Orchestrator Runbook Converter converts Orchestrator runbooks into graphical runbooks that can be imported into Azure Automation. Runbook 转换器是作为 PowerShell 模块实现的,其 cmdlet ConvertFrom-SCORunbook 用于进行转换。The Runbook Converter is implemented as a PowerShell module with the cmdlet ConvertFrom-SCORunbook that makes the conversion. 安装转换器时,它会创建加载 cmdlet 的 PowerShell 会话的快捷方式。When you install the converter, it creates a shortcut to a PowerShell session that loads the cmdlet.

以下是转换 runbook 并将其导入 Azure 自动化的基本步骤。Here are the basic steps to convert a runbook and import it into Azure Automation. 本节稍后将提供有关使用 cmdlet 的详细信息。Details of using the cmdlet are provided later in this section.

  1. 从 Orchestrator 导出一个或多个 Runbook。Export one or more runbooks from Orchestrator.
  2. 获取 Runbook 中所有活动的集成模块。Obtain integration modules for all activities in the runbook.
  3. 转换所导出文件中的 Orchestrator Runbook。Convert the Orchestrator runbooks in the exported file.
  4. 查看日志中的信息,以验证转换并确定任何所需的手动任务。Review information in logs to validate the conversion and to determine any required manual tasks.
  5. 将转换的 Runbook 导入 Azure 自动化。Import converted runbooks into Azure Automation.
  6. 在 Azure 自动化中创建任何所需的资产。Create any required assets in Azure Automation.
  7. 在 Azure 自动化中编辑 Runbook,以修改任何所需的活动。Edit the runbook in Azure Automation to modify any required activities.

ConvertFrom-SCORunbook 的语法为:The syntax for ConvertFrom-SCORunbook is:

ConvertFrom-SCORunbook -RunbookPath <string> -Module <string[]> -OutputFolder <string>
  • RunbookPath - 包含要转换的 Runbook 的导出文件的路径。RunbookPath - Path to the export file containing the runbooks to convert.
  • Module - 包含 Runbook 中活动的集成模块的逗号分隔列表。Module - Comma delimited list of integration modules containing activities in the runbooks.
  • OutputFolder - 用于创建要转换的图形 Runbook 的文件夹的路径。OutputFolder - Path to the folder to create converted graphical runbooks.

以下示例命令在名为 MyRunbooks.ois_export 的导出文件中转换 Runbook。The following example command converts the runbooks in an export file called MyRunbooks.ois_export. 这些 Runbook 使用 Active Directory 和 Data Protection Manager 集成包。These runbooks use the Active Directory and Data Protection Manager integration packs.

ConvertFrom-SCORunbook -RunbookPath "c:\runbooks\MyRunbooks.ois_export" -Module c:\ip\SystemCenter_IntegrationModule_ActiveDirectory.zip,c:\ip\SystemCenter_IntegrationModule_DPM.zip -OutputFolder "c:\runbooks"

使用 Runbook 转换器日志文件Use Runbook Converter log files

Runbook 转换器在与转换的 Runbook 所在的相同位置创建以下日志文件。The Runbook Converter create the following log files in the same location as the converted runbook. 如果文件已存在,则以最后一个转换的信息进行覆盖。If the files already exist, they are overwritten with information from the last conversion.

文件File 目录Contents
Runbook 转换器 - Progress.logRunbook Converter - Progress.log 转换的详细步骤,包括成功转换的每个活动的信息,以及未转换的每个活动的警告。Detailed steps of the conversion including information for each activity successfully converted and warning for each activity not converted.
Runbook 转换器 - Summary.logRunbook Converter - Summary.log 最后一个转换的摘要,包括任何警告,以及需要执行的后续任务,例如,创建转换的 Runbook 所需的变量。Summary of the last conversion including any warnings and follow up tasks that you need to perform such as creating a variable required for the converted runbook.

从 Orchestrator 导出 RunbookExport runbooks from Orchestrator

Runbook 转换器可以处理 Orchestrator 中包含一个或多个 Runbook 的导出文件。The Runbook Converter works with an export file from Orchestrator that contains one or more runbooks. 它为导出文件中的每个 Orchestrator Runbook 创建相应的 Azure 自动化 Runbook。It creates a corresponding Azure Automation runbook for each Orchestrator runbook in the export file.

要从 Orchestrator 导出 Runbook,请在 Runbook 设计器中右键单击 Runbook 名称,并选择“导出”。To export a runbook from Orchestrator, right-click the name of the runbook in Runbook Designer and select Export. 要导出文件夹中的所有 Runbook,请右键单击文件夹名称,并选择“导出”。To export all runbooks in a folder, right-click the name of the folder and select Export.

转换 runbook 活动Convert runbook activities

Runbook 转换器将 Orchestrator Runbook 中的每个活动转换成 Azure 自动化中的相应活动。The Runbook Converter converts each activity in the Orchestrator runbook to a corresponding activity in Azure Automation. 对于无法转换的活动,会在 Runbook 中创建占位符活动,并提供警告文本。For those activities that can't be converted, a placeholder activity is created in the runbook with warning text. 将转换的 Runbook 导入 Azure 自动化之后,必须将这些活动替换为可执行所需功能的有效活动。After you import the converted runbook into Azure Automation, you must replace any of these activities with valid activities that perform the required functionality.

将转换标准活动模块中的所有 Orchestrator 活动。Any Orchestrator activities in the Standard Activities Module are converted. 不过,此模块中有一些标准 Orchestrator 活动不会转换。There are some standard Orchestrator activities that are not in this module though and are not converted. 例如,Send Platform Event 没有 Azure 自动化对等项,因为该事件特定于 Orchestrator。For example, Send Platform Event has no Azure Automation equivalent since the event is specific to Orchestrator.

监视活动不会转换,因为它们在 Azure 自动化中没有对等项。Monitor activities are not converted since there is no equivalent to them in Azure Automation. 异常是已转换集成包中的监视活动,会将其转换成占位符活动。The exceptions are monitor activities in converted integration packs that are converted to the placeholder activity.

如果使用 modules 参数提供集成模块路径,将转换来自已转换集成包的任何活动。Any activity from a converted integration pack is converted if you provide the path to the integration module with the modules parameter. 对于 System Center 集成包,可以使用 System Center Orchestrator 集成模块。For System Center Integration Packs, you can use the System Center Orchestrator Integration Modules.

管理 Orchestrator 资源Manage Orchestrator resources

Runbook 转换器仅转换 Runbook,而不转换其他 Orchestrator 资源,例如计数器、变量或连接。The Runbook Converter only converts runbooks, not other Orchestrator resources such as counters, variables, or connections. Azure 自动化不支持计数器。Counters are not supported in Azure Automation. 支持变量和连接,但必须手动创建它们。Variables and connections are supported, but you must create them manually. 日志文件会通知 Runbook 是否需要此类资源,并指定需要在 Azure 自动化中创建哪些相应资源,才能让转换后的 Runbook 正常运行。The log files inform you if the runbook requires such resources and specify corresponding resources that you need to create in Azure Automation for the converted runbook to operate properly.

例如,Runbook 可能使用变量来填充活动中的特定值。For example, a runbook may use a variable to populate a particular value in an activity. 已转换的 Runbook 会转换该活动,并以与 Orchestrator 变量名称相同的名称指定 Azure 自动化中的变量资产。The converted runbook converts the activity and specifies a variable asset in Azure Automation with the same name as the Orchestrator variable. 此操作记录在转换后创建的文件“Runbook 转换器 - Summary.log”中。This action is noted in the Runbook Converter - Summary.log file that is created after the conversion. 在使用 Runbook 之前,必须在 Azure 自动化中手动创建此变量资产。You must manually create this variable asset in Azure Automation before using the runbook.

使用 Orchestrator 输入参数Work with Orchestrator input parameters

Orchestrator 中的 Runbook 接受具有 Initialize Data 活动的输入参数。Runbooks in Orchestrator accept input parameters with the Initialize Data activity. 如果要转换的 Runbook 包含此活动,则在 Azure 自动化 Runbook 中为活动中的每个参数创建输入参数If the runbook being converted includes this activity, then an input parameter in the Azure Automation runbook is created for each parameter in the activity. 在检索并返回每个参数的转换 Runbook 中创建工作流脚本控制活动。A Workflow Script control activity is created in the converted runbook that retrieves and returns each parameter. Runbook 中使用输入参数的任何活动将引用此活动的输出。Any activities in the runbook that use an input parameter refer to the output from this activity.

使用此策略的原因是能够最好地镜像 Orchestrator Runbook 中的功能。The reason that this strategy is used is to best mirror the functionality in the Orchestrator runbook. 新的图形 Runbook 中的活动应使用 Runbook 输入数据源直接引用输入参数。Activities in new graphical runbooks should refer directly to input parameters using a Runbook input data source.

调用 Runbook 活动Invoke Runbook activity

Orchestrator 中的 Runbook 使用 Invoke Runbook 活动来启动其他 Runbook。Runbooks in Orchestrator start other runbooks with the Invoke Runbook activity. 如果要转换的 Runbook 包含此活动,并且设置了 Wait for completion 选项,则在转换后的 Runbook 中为其创建 Runbook 活动。If the runbook being converted includes this activity and the Wait for completion option is set, then a runbook activity is created for it in the converted runbook. 如果未设置 Wait for completion选项,则创建使用 Start-AzAutomationRunbook 的工作流脚本活动来启动 Runbook。If the Wait for completion option is not set, then a Workflow Script activity is created that uses Start-AzAutomationRunbook to start the runbook. 将转换的 Runbook 导入 Azure 自动化之后,必须以活动中指定的信息修改此活动。After you import the converted runbook into Azure Automation, you must modify this activity with the information specified in the activity.

创建 Orchestrator 资产Create Orchestrator assets

Runbook 转换器不转换 Orchestrator 资产。The Runbook Converter does not convert Orchestrator assets. 必须在 Azure 自动化中手动创建任何必需的 Orchestrator 资产。You must manually create any required Orchestrator assets in Azure Automation.

配置混合 Runbook 辅助角色Configure Hybrid Runbook Worker

Orchestrator 将 runbook 存储在数据库服务器上,并在本地数据中心的 runbook 服务器上运行它们。Orchestrator stores runbooks on a database server and runs them on runbook servers, both in your local datacenter. Azure 自动化中的 Runbook 存储在 Azure 云中,并可使用混合 Runbook 辅助角色运行在本地数据中心。Runbooks in Azure Automation are stored in the Azure cloud and can run in your local datacenter using a Hybrid Runbook Worker. 配置工作进程以运行从 Orchestrator 转换过来的 Runbook,因为这些 runbook 设计为在本地服务器上运行并访问本地资源。Configure a worker to run your runbooks converted from Orchestrator, since they are designed to run on local servers and access local resources.