内容生命周期管理

内容生命周期管理允许您在更新生产客户端之前自定义和测试软件包。如果您需要在有限的维护时段内应用更新,此功能将特别有用。

内容生命周期管理允许您选择软件通道作为源、根据环境的需要调整软件通道,并在安装到生产客户端之前对其进行全面的测试。

虽然您无法直接修改供应商通道,但可以克隆它们,然后通过添加或去除软件包和自定义补丁来修改克隆版本。可以将这些克隆的通道指派到测试客户端,以确保它们按预期工作。

By default, cloned vendor channels match the original vendor channel and automatically select the dependencies. You can disable the automatic selection for cloned channels by adding the following option in /etc/rhn/rhn.conf:

java.cloned_channel_auto_selection = false

然后,当所有测试都通过后,您可以将克隆的通道升级为生产服务器。

此功能是通过一系列环境实现的,软件通道在其生命周期内可以在这些环境之间转移。大多数环境生命周期至少包括测试和生产环境,但您可以创建任意所需数量的环境。

本章介绍基本的内容生命周期过程以及可用的过滤器。有关更具体的示例,请参见 内容生命周期管理示例

1. 创建内容生命周期项目

要设置内容生命周期,需要从一个项目开始。该项目定义软件通道源、用于查找软件包的过滤器,以及构建环境。

过程:创建内容生命周期项目
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  项目并单击 创建项目

  2. In the Label field, enter a label for your project. The Label field only accepts lowercase letters, numbers, periods, hyphens, and underscores.

  3. In the Name field, enter a descriptive name for your project.

  4. 单击 创建 按钮以创建项目并返回项目页面。

  5. 单击 关联源/解除源关联

  6. In the Sources dialog, select the source type, and select a base channel for your project. 此时会显示所选基础通道的可用子通道,包括有关通道是必需通道还是建议通道的信息。

  7. 选中所需的子通道,然后单击 保存 返回项目页面。 您选择的软件通道现在应会显示出来。

  8. 单击 关联过滤器/解除过滤器关联

  9. In the Filters dialog, select the filters you want to attach to the project. 要创建新过滤器,请单击 创建新过滤器

  10. 单击 添加环境

  11. In the Environment Lifecycle dialog, give the first environment a name, a label, and a description, and click Save. The Label field only accepts lowercase letters, numbers, periods, hyphens, and underscores.

  12. 继续创建环境,直到为整个生命周期创建了所有环境。 You can select the order of the environments in the lifecycle by selecting an environment in the Insert before field when you create it.

2. 过滤器类型

SUSE Multi-Linux Manager 允许您创建各种类型的过滤器来控制用于构建项目的内容。使用过滤器可以选择要在构建中包含或排除哪些软件包。例如,可以排除所有内核软件包,或仅包含某些软件包的特定发行版。

支持的过滤器为:

  • 软件包过滤

    • 按名称

    • 按名称、纪元、版本、发行版和体系结构

    • 按提供的名称

  • 补丁过滤

    • 按建议名称

    • 按建议类型

    • 按摘要

    • 按关键字

    • 按日期

    • 按受影响的软件包

  • 模块

    • 按流

在内容过滤期间不会解析软件包依赖项。

可以将多个匹配器与过滤器配合使用。哪些匹配器可用取决于所选的过滤器类型。

可用的匹配器为:

  • 包含

  • 匹配(必须采用正则表达式形式)

  • 等于

  • 大于

  • 大于或等于

  • 低于或等于

  • 低于

  • 高于或等于

2.1. Filter rule parameter

Each filter has a rule parameter that can be set to either Allow or Deny. The filters are processed like this:

  • If a package or patch satisfies a Deny filter, it is excluded from the result.

  • If a package or patch satisfies an Allow filter, it is included in the result (even if it was excluded by a Deny filter). Allow filters for packages only operate on package filters and Allow filters for patches only operate on patch filters. This means with a package filter you cannot add packages back in that were filtered out through patch filters or vice versa for patches that where filtered out through package filters.

This behavior is useful when you want to exclude large number of packages or patches using a general Deny filter and "cherry-pick" specific packages or patches with specific Allow filters.

内容过滤器在您的组织中是全局性的,并可以在项目之间共享。

如果您的项目已包含构建的源,当您添加环境时,该环境中会自动填充现有内容。内容是从周期中的前一个环境(如果有)提取的。如果前一个环境不存在,则将内容留空,直到再次构建了项目源。

3. 过滤器模板

为了帮助为某些常见方案创建过滤器,SUSE Multi-Linux Manager 提供了过滤器模板。应用这些模板有助于提前创建一组针对特定用例定制的过滤器。

本节介绍可用的模板及其用法。

3.1. 根据 SUSE 产品进行实时修补

在包含实时修补的项目中,必须排除未来的常规内核软件包,以便仅将在线补丁软件包作为更新提供给客户端。另一方面,仍然必须包含已安装的常规内核软件包以保持系统完整性。

应用此模板会创建三个所需的过滤器来实现以下行为:

  • Allow patches that contain kernel-default package equal to a base kernel version

  • Deny patches that contain reboot_suggested keyword

  • Deny patches that contain a package which provides the name installhint(reboot-needed)

有关如何设置实时修补项目的详细信息,请参见 administration:content-lifecycle-examples.adoc#exclude-higher-kernel-version

过程:应用模板
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  过滤器并单击 创建过滤器

  2. 在对话框中单击 使用模板。输入将相应地更改。

  3. In the Prefix field, type a name prefix. This value will be prepended to the name of every individual filter created by the template. If the template is being applied in the context of a project, this field will be prefilled with the project label.

  4. In the Template field, select Live patching based on a SUSE product.

  5. In the Product field, select the product you wish to set up live patching for.

  6. In the Kernel field, select a kernel version from the list of versions available in the selected product. The filter to deny the later regular kernel patches will be based on this version.

  7. 单击 保存 以创建过滤器。

  8. 导航到内容生命周期  项目并选择您的项目。

  9. 单击 关联过滤器/解除过滤器关联

  10. 选择具有指定前缀的三个过滤器,然后单击 保存

3.2. 根据系统实时修补

如果您想要根据特定已注册系统中安装的内核版本设置实时修补项目,可以使用根据系统实时修补模板。

应用此模板会创建三个所需的过滤器来实现以下行为:

  • Allow patches that contain kernel-default package equal to a base kernel version

  • Deny patches that contain reboot_suggested keyword

  • Deny patches that contain a package which provides the name installhint(reboot-needed)

有关如何设置实时修补项目的详细信息,请参见 administration:content-lifecycle-examples.adoc#exclude-higher-kernel-version

过程:应用模板
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  过滤器并单击 创建过滤器

  2. 在对话框中单击 使用模板。输入将相应地更改。

  3. In the Prefix field, type a name prefix. This value will be prepended to the name of every filter created by the template. If the template is being applied in the context of a project, this field will be prefilled with the project label.

  4. In the Template field, select Live patching based on a specific system.

  5. In the System field, select a system from the list, or start typing a system name to narrow down the options.

  6. In the Kernel field, select a kernel version from the list of versions installed in the selected system. The filter to deny the later regular kernel patches will be based on this version.

  7. 单击 保存 以创建过滤器。

  8. 导航到内容生命周期  项目并选择您的项目。

  9. 单击 关联过滤器/解除过滤器关联

  10. 选择具有指定前缀的三个过滤器,然后单击 保存

3.3. 含默认值的 AppStream 模块

如果您想要在项目中包含模块化储存库中提供的所有可用模块,可以使用此过滤器模板自动添加这些模块。

应用后,此模板将为每个模块及其默认流创建一个 AppStream 过滤器。

如果从项目的页面完成此过程,则过滤器将自动添加到项目。否则,创建的过滤器可能会列在内容生命周期  过滤器中,并根据需要添加到任何项目。

可以编辑每个过滤器以选择不同的模块流,或去除所有这些过滤器以从目标储存库中排除该模块。

由于并非所有模块流都相互兼容,因此更改单个流可能会导致无法成功解析模块化依赖关系。如果发生这种情况,项目细节页面中的过滤器窗格会显示描述问题的错误,并且在选择的所有模块都兼容之前,构建按钮将会禁用。

自 Red Hat Enterprise Linux 9 起,模块便不再具有任何定义的默认流。因此,对 Red Hat Enterprise Linux 9 源使用此模板将不会有任何效果。

有关如何使用内容生命周期管理设置 AppStream 储存库的详细信息,请参见 administration:content-lifecycle-examples.adoc#appstream-filters

过程:应用模板
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  项目,然后选择您的项目。

  2. In the Filters section, click Attach/Detach Filters, and then click Create New Filter.

  3. 在对话框中单击 使用模板。输入将相应地更改。

  4. In the Prefix field, type a name prefix. This value will be prepended to the name of every filter created by the template. If the template is being applied in the context of a project, this field will be prefilled with the project label.

  5. In the Template field, select AppStream modules with defaults.

  6. In the Channel field, select a modular channel to get the modules from. In this dropdown, only the modular channels are displayed.

  7. 单击 保存 以创建过滤器。

  8. Scroll to the Filters section to see the newly attached AppStream filters.

  9. 可以编辑/去除任何一个过滤器以根据您的需要定制项目。

4. 构建内容生命周期项目

创建项目、定义环境、关联源和过滤器后,可以首次构建项目。

构建过程会将过滤器应用于关联的源,并将过滤器克隆到项目中的第一个环境。

You can use the same vendor channels as sources for multiple content projects. In this case, SUSE Multi-Linux Manager does not create new patch clones for each cloned channel. Instead, a single patch clone is shared between all of your cloned channels. This can cause problems if a vendor modifies a patch; for example, if the patch is retracted, or the packages within the patch are changed. When you build one of the content projects, all the channels that share the cloned patch are synchronized with the original by default, even if the channels are in other environments of your content project, or other content project channels in your organization. You can change this behavior by turning off automatic patch synchronization in your organization settings. To manually synchronize the patch later for all channels sharing the patch, navigate to Software  Manage  Channels, click the channel you want to synchronize and navigate to the Sync subtab. Even manual patch synchronization affects all organization channels sharing the patch.

过程:构建内容生命周期项目
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  项目,然后选择您要构建的项目。

    在构建项目前,请确保环境可用。

  2. 查看关联的源和过滤器,然后单击 构建

  3. 提供版本消息以描述此构建中的更改或更新。

  4. You can monitor build progress in the Environment Lifecycle section.

构建完成后,环境版本号将会加 1,可将构建的源(例如软件通道)指派到您的客户端。

5. 升级环境

构建项目后,可将构建的源按顺序升级到环境。

过程:升级环境
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到内容生命周期  项目,然后选择您要处理的项目。

  2. In the Environment Lifecycle section, locate the environment to promote to its successor, and click Promote.

  3. You can monitor build progress in the Environment Lifecycle section.

6. 将客户端分配到环境

When you build and promote content lifecycle projects, SUSE Multi-Linux Manager creates a tree of software channels. To add clients to the environment, assign the base and child software channels to your client using Software  Software Channels in the System Details page for the client.

新添加的克隆通道不会自动指派到客户端。如果您添加或升级了源,则需要手动检查并更新您的通道指派。

在将来的版本中,自动指派会添加到 SUSE Multi-Linux Manager。