产品迁移

1. 简介

Product migration lets you upgrade SLE-based client systems to a newer supported product version directly from the Web UI. This includes upgrading to a later Service Pack (SP) within the same major version, for example SUSE Linux Enterprise Server 15 SP5 to SUSE Linux Enterprise Server 15 SP6, as well as the major version upgrade from SUSE Linux Enterprise Server 15 SP7 to SUSE Linux Enterprise Server 16.0.

You can also use it to upgrade clients such as Red Hat Enterprise Linux or CentOS to SUSE Liberty Linux.

要进行产品迁移,客户端上启用的以及应该迁移的所有储存库都必须有效,否则迁移将会中止。

SUSE Multi-Linux Manager supports the following migration paths using the product migration feature:

Migration path Example

Service Pack (SP) upgrade within the same major version

SUSE Linux Enterprise Server 15 SP5 to SUSE Linux Enterprise Server 15 SP6

openSUSE Leap to a later minor version

openSUSE Leap 15.5 to openSUSE Leap 15.6

openSUSE Leap to the corresponding SUSE Linux Enterprise Server SP

openSUSE Leap 15.6 to SUSE Linux Enterprise Server 15 SP6

SUSE Linux Enterprise Server to the corresponding SUSE Linux Enterprise Server for SAP Applications SP

SUSE Linux Enterprise Server 15 SP5 to SUSE Linux Enterprise Server for SAP Applications 15 SP5

Major version upgrade to SUSE Linux Enterprise Server 16.0

SUSE Linux Enterprise Server 15 SP7 to SUSE Linux Enterprise Server 16.0

Red Hat Enterprise Linux or CentOS to SUSE Liberty Linux

Red Hat Enterprise Linux to SUSE Liberty Linux

You cannot use product migration to migrate from SUSE Linux Enterprise Server 12 to SUSE Linux Enterprise Server 15. To upgrade from SUSE Linux Enterprise Server 12 to SUSE Linux Enterprise Server 15, see 主要版本升级.

1.1. Major version upgrade to SUSE Linux Enterprise Server 16.0

The following applies specifically to the major version upgrade from SUSE Linux Enterprise Server 15 SP7 to SUSE Linux Enterprise Server 16.0.

  • The upgrade to SUSE Linux Enterprise Server 16.0 is supported from SUSE Linux Enterprise Server 15 SP7 only. Bring the client up to SUSE Linux Enterprise Server 15 SP7, with all the latest updates applied, before you migrate.

  • The migration is currently supported for regular (Salt) minions only. Clients managed with Salt SSH cannot yet be migrated.

  • The dry run option is not available when migrating from SUSE Linux Enterprise Server 15 SP7 to SUSE Linux Enterprise Server 16.0.

The migration to SUSE Linux Enterprise Server 16.0 happens in two steps:

  1. The migration action performs the actual product migration on the client.

  2. Once the migration action has finished, whether it passed or failed, the system is rebooted automatically. After the reboot, when the Salt minion connects to the SUSE Multi-Linux Manager Server again, the verification step starts automatically.

To perform this upgrade, use the standard product migration procedures described in this page: the 单系统迁移 procedure for a single client, or the 产品大量迁移 procedure for many clients at once.

在 SUSE Linux Enterprise Server 12 及更高版本中,SUSE 支持跳过服务包(如果 SUSE Customer Center 提供该服务包)。例如,您可以从 SUSE Linux Enterprise Server 15 升级到 SP2,而无需安装 SP1。

  • 迁移时会自动启用所有建议的扩展。

  • 迁移期间,SUSE Multi-Linux Manager 会在安装前自动接受任何必要的许可协议 (EULA)。

2. 单系统迁移

开始迁移产品之前:

  • Ensure there are no pending updates or patches. Check the System Status on the client system’s Details  Overview page, and install all offered updates or patches. If your client system is not up to date, product migration may fail.

  • 确保目标产品的所有通道都已完全同步。要在 Web UI 中检查同步状态,请导航到管理  安装向导  产品页面。

  • 请确保您具有有效的系统备份,以防万一。产品迁移没有回滚功能。迁移过程一旦开始,就无法回滚。

过程:执行单系统迁移
  1. 系统  概览页面中,选择一个客户端。

  2. 从客户端的系统细节页面,导航到软件  产品迁移选项卡。

  3. 选择目标迁移路径,然后单击 选择通道

  4. From the Product Migration - Channels page select the correct base channel, including Mandatory Child Channels and any additional Optional Child Channels.

  5. OPTIONAL: Check Allow Vendor Change to allow packages that have changed vendors to be installed. If this occurs, a notification is shown with details before the migration is started.

    To migrate openSUSE Leap to SUSE Linux Enterprise Server, you must check the Allow Vendor Change option.

  6. 正确配置您的通道后,单击 安排迁移

3. 产品大量迁移

If you want to migrate a large number of clients to the next SP version, you can use SUSE Multi-Linux Manager API calls or System Set Manager (SSM).

The spacecmd commandline tool provides a system_scheduleproductmigration sub command, which can be used to schedule a migration for a large number of clients to the next minor version.

3.1. Perform a Product Mass Migration using System Set Manager (SSM)

Procedure: Performing a Product Mass Migration using System Set Manager (SSM)
  1. Add the systems you want to migrate to the System Set Manager (SSM) as described in 系统组.

  2. In the SUSE Multi-Linux Manager Web UI, navigate to Systems  System Set Manager.

  3. Navigate to the Product Migration tab.

  4. Choose a target product and then click Select Channels.

  5. On the next page, click Schedule Migration.

  6. If you want, click Dry Run to do a dry run first, and if everything is correct, click Migrate to start the migration.

3.2. Perform a Product Mass Migration using API calls

产品大量迁移操作非常危险,该过程应经过全面测试。至少应先进行试运行。

请务必小心,不要无意中升级系统。

Procedure: Performing a Product Mass Migration using API calls
  1. 列出可用的迁移目标,并记下要迁移的系统 ID:

    spacecmd api -- system.listMigrationTargets -A 1000010001
  2. For each system ID, call listMigrationTarget and check that the desired target product is available.

    • If the system ID has an available target, call system.scheduleProductMigration.

    • 如果所需目标不可用,则跳过该系统。

  3. 根据您的环境调整以下模板:

    target = '[....]'
    basechannel = 'channel-label'
    system_ids = [1, 2, 3]
    
    session = auth.login(user, pass)
    for system in system_ids
       if system.listMigrationTargets(session, system).ident == target
         system.scheduleProductMigration(session, system, target, basechannel, [] , False, <now>)
       else
         print "无法迁移到请求的目标 -- 正在跳过系统"
       endif
    endfor

3.3. 示例:从 SLES 15 SP2 迁移到 SLES 15 SP3

对于此示例,将会创建一个组,以便于进行大量迁移。

过程:创建大量产品迁移组
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到系统  系统组,然后单击 创建组

  2. Name the group mpm-target-sles15sp3.

    • Only systems subscribed to the same base channel should be added to the created group. In the example, only systems subscribed to SLE-Product-SLES15-SP2-Pool for x86_64 should be added to the group.

      有关将客户端添加到组的详细信息,请参见 系统组

过程:将系统添加到组
  1. 运行以下命令,以获取该组中所有系统的目标:

    spacecmd -- system_listmigrationtargets group:mpm-target-sles15sp3
  2. 命令的输出为由多个 ID 组成的字符串。

    • 请只选择一个目标,这样为所有系统报告的就是该目标。

    • The string is the identifier for the MIGRATIONTARGET of the other command.

      The spacecmd sub-commands system_scheduleproductmigration and system_listmigrationtargets are looping over all systems that are part of the group.

      如果该组中有 100 个系统,您会发现安排了 100 个操作。

      该组中的所有系统都必须支持相同的迁移目标。

过程:运行大量迁移命令
  1. The syntax for the system_scheduleproductmigration command is as follows:

    spacecmd -- system_scheduleproductmigration <SYSTEM> <BASE_CHANNEL_LABEL> \
        <MIGRATION_TARGET> [选项]
  2. For this example to upgrade all systems in the group mpm-target-sles15sp3 from SLES 12 SP2 to SLES 15 SP, enter on the command line:

    spacecmd -- system_scheduleproductmigration group:mpm-target-sles15sp3 \
        sle-product-sles15-sp3-pool-x86_64 "[190,203,195,1242]" -d

3.3.1. 命令语法说明

To see syntax usage and options for system_scheduleproductmigration, run:

spacecmd system_scheduleproductmigration help
<SYSTEM>

对于此示例,我们将使用我们创建的组选择该组中的所有系统:

group:mpm-target-sles15sp3
<BASE_CHANNEL_LABEL>

This is the label for the target base channel. In this case, the system is being upgraded to SLES 15 SP3, and the label is sle-product-sles15-sp3-pool-x86_64.

要查看当前镜像的所有基础通道的列表,请运行以下命令:

spacecmd softwarechannel_listbasechannels

请注意,除非通道是当前基础通道的可用目标,否则您无法升级到该通道。

<MIGRATION_TARGET>

To identify this value for systems in the group group:mpm-target-sles15sp3, run:

spacecmd -- system_listmigrationtargets group:mpm-target-sles15sp3

The MIGRATION_TARGET parameter must be passed in the following format; note necessary shell quotation to prevent sideeffects with brackets:

"[190,203,195,1242]"
选项
  • -s START_TIME

  • -d pass this flag, if you want to do a dry run (it is recommended to run a dry run before the actual migration)

  • -c CHILD_CHANNELS (comma-separated child channels labels with no spaces)

    In this case we included the -d option, which can be removed after a successful dry run.

如果成功,安排的每个系统的命令输出将如下所示:

正在为以下系统安排产品迁移 mpm-sles152-1
已安排操作 ID:66

可以在 Web UI 中跟踪该组中某个指定系统的操作,在本例中即为试运行。从客户端的系统细节页面导航到事件  历史。如果试运行期间出现任何失败,应对系统进行调查。

If all is well, the -d option can be removed from the command to run the real migration. After the migration is complete, you can reboot the system from the SUSE Multi-Linux Manager Web UI.