Oracle® VM Server for SPARC 3.3 管理指南

退出打印视图

更新时间: 2015 年 10 月
 
 

使用 ldmp2v 命令

本节介绍三阶段转换示例。

示例 19-1  收集阶段示例

    以下示例说明如何使用 ldmp2v collect 命令。

  • 共享已挂载 NFS 的文件系统。以下示例说明了执行 collect 步骤的最简单方法,其中源系统和目标系统共享一个已挂载 NFS 的文件系统。

    作为超级用户,确保所有所需的 UFS 文件系统都已挂载。

    volumia# df -k
    Filesystem            kbytes    used   avail capacity  Mounted on
    /dev/dsk/c1t1d0s0    16516485  463289 15888032     3%    /
    /proc                      0       0       0     0%    /proc
    fd                         0       0       0     0%    /dev/fd
    mnttab                     0       0       0     0%    /etc/mnttab
    /dev/dsk/c1t1d0s3    8258597    4304 8171708     1%    /var
    swap                 4487448      16 4487432     1%    /var/run
    swap                 4487448      16 4487432     1%    /tmp
    /dev/dsk/c1t0d0s0    1016122       9  955146     1%    /u01
    vandikhout:/u1/home/dana
                         6230996752 1051158977 5179837775    17%    /home/dana

    以下示例显示源系统和目标系统共享一个已挂载 NFS 的文件系统时如何运行收集工具:

    volumia# ldmp2v collect -d /home/dana/volumia
    Collecting system configuration ...
    Archiving file systems ...
    Determining which filesystems will be included in the archive...
    Creating the archive...
    895080 blocks
    Archive creation complete.
  • 没有共享已挂载 NFS 的文件系统。如果源系统和目标系统没有共享已挂载 NFS 的文件系统,可将文件系统映像写入本地存储,稍后再将其复制到控制域。Flash 归档文件实用程序会自动排除它所创建的归档文件。

    volumia# ldmp2v collect -d /var/tmp/volumia
    Collecting system configuration ...
    Archiving file systems ...
    Determining which filesystems will be included in the archive...
    Creating the archive...
    895080 blocks
    Archive creation complete.

    将 Flash 归档文件和 manifest 文件从 /var/tmp/volumia 目录复制到目标系统。


    提示  - 在某些情况下,ldmp2v 可能会显示 cpio 命令错误。最为常见的是,这些错误生成诸如 File size of etc/mnttab has increased by 435 之类的消息。您可以忽略与日志文件相关的消息,也可以忽略与反映系统状态的文件相关的消息。请确保仔细检查所有的错误消息。
  • 跳过文件系统备份步骤。如果您已使用第三方备份工具(如 NetBackup)为系统创建备份,则可以使用 none 归档方法跳过文件系统备份步骤。使用此选项时,将仅创建系统配置清单。

    volumia# ldmp2v collect -d home/dana/p2v/volumia -a none
    Collecting system configuration ...
    The following file system(s) must be archived manually: / /u01 /var

    请注意,如果源系统和目标系统没有共享由 –d 指定的目录,您必须将该目录的内容复制到控制域。必须在准备阶段之前将目录内容复制到控制域。

示例 19-2  准备阶段示例

    以下示例说明如何使用 ldmp2v prepare 命令。

  • 以下示例使用 /etc/ldmp2v.conf 中配置的默认值创建名为 volumia 的逻辑域,同时保留物理系统的 MAC 地址:

    # ldmp2v prepare -d /home/dana/p2v/volumia -o keep-mac volumia
    Creating vdisks ...
    Creating file systems ...
    Populating file systems ...
    Modifying guest domain OS image ...
    Removing SVM configuration ...
    Unmounting guest file systems ...
    Creating domain volumia ...
    Attaching vdisks to domain volumia ...
  • 以下命令显示了有关 volumia 逻辑域的信息:

    # ldm list -l volumia
    NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
    volumia          inactive   ------          2     4G
    
    NETWORK
        NAME    SERVICE                DEVICE     MAC               MODE   PVID VID
        vnet0   primary-vsw0                      00:03:ba:1d:7a:5a        1 
    
    DISK
        NAME    DEVICE  TOUT MPGROUP        VOLUME                      SERVER 
        disk0                                        volumia-vol0@primary-vds0 
        disk1                                        volumia-vol1@primary-vds0
  • 以下示例说明如何使用 –C 选项彻底删除域及其后端设备。

    # ldmp2v prepare -C volumia
    Cleaning up domain volumia ...
    Removing vdisk disk0 ...
    Removing vdisk disk1 ...
    Removing domain volumia ...
    Removing volume volumia-vol0@primary-vds0 ...
    Removing ZFS volume tank/ldoms/volumia/disk0 ...
    Removing volume volumia-vol1@primary-vds0 ...
    Removing ZFS volume tank/ldoms/volumia/disk1 ...
  • 以下示例说明如何通过使用 –m 选项指定挂载点和新大小来在 P2V 过程中调整一个或多个文件系统的大小。

    # ldmp2v prepare -d /home/dana/p2v/volumia -m /:8g volumia
    Resizing file systems ...
    Creating vdisks ...
    Creating file systems ...
    Populating file systems ...
    Modifying guest domain OS image ...
    Removing SVM configuration ...
    Modifying file systems on SVM devices ...
    Unmounting guest file systems ...
    Creating domain volumia ...
    Attaching vdisks to domain volumia ...
示例 19-3  转换阶段示例

    以下示例说明如何使用 ldmp2v convert 命令。

  • 使用网络安装服务器。ldmp2v convert 命令可使用指定的虚拟网络接口通过网络引导域。必须在安装服务器上运行 setup_install_serveradd_install_client 脚本。

    在 Oracle Solaris 10 系统上,您可以使用 Oracle Solaris JumpStart 功能执行完全自动化的转换。此功能需要您在 JumpStart 服务器上为客户机创建和配置相应的 sysidcfg 文件和配置文件。该配置文件应包含以下行:

    install_type    upgrade
    root_device     c0d0s0

    sysidcfg 文件仅用于升级操作,因此如下配置应已足够:

    name_service=NONE
    root_password=uQkoXlMLCsZhI
    system_locale=C
    timeserver=localhost
    timezone=Europe/Amsterdam
    terminal=vt100
    security_policy=NONE
    nfs4_domain=dynamic
    auto_reg=disable
    network_interface=PRIMARY {netmask=255.255.255.192
            default_route=none protocol_ipv6=no}

    有关使用 JumpStart 的更多信息,请参见Oracle Solaris 10 1/13 Installation Guide: JumpStart Installations


    注 - 示例 sysidcfg 文件包括 auto_reg 关键字,此关键字是在 Oracle Solaris 10 9/10 发行版中引入的。只有当您至少运行 Oracle Solaris 10 9/10 发行版时,才需要使用此关键字。
    # ldmp2v convert -j -n vnet0 -d /p2v/volumia volumia
    LDom volumia started
    Waiting for Solaris to come up ...
    Using Custom JumpStart
    Trying 0.0.0.0...
    Connected to 0.
    Escape character is '^]'.
    
    Connecting to console "volumia" in group "volumia" ....
    Press ~? for control options ..
    SunOS Release 5.10 Version Generic_137137-09 64-bit
    Copyright (c) 1983-2010, Oracle and/or its affiliates.  All rights reserved.
    Configuring devices.
    Using RPC Bootparams for network configuration information.
    Attempting to configure interface vnet0...
    Configured interface vnet0
    Reading ZFS config: done.
    Setting up Java. Please wait...
    Serial console, reverting to text install
    Beginning system identification...
    Searching for configuration file(s)...
    Using sysid configuration file
      129.159.206.54:/opt/SUNWjet/Clients/volumia/sysidcfg
    Search complete.
    Discovering additional network configuration...
    Completing system identification...
    Starting remote procedure call (RPC) services: done.
    System identification complete.
    Starting Solaris installation program...
    Searching for JumpStart directory...
    Using rules.ok from 129.159.206.54:/opt/SUNWjet.
    Checking rules.ok file...
    Using begin script: Clients/volumia/begin
    Using profile: Clients/volumia/profile
    Using finish script: Clients/volumia/finish
    Executing JumpStart preinstall phase...
    Executing begin script "Clients/volumia/begin"...
    Begin script Clients/volumia/begin execution completed.
    Searching for SolStart directory...
    Checking rules.ok file...
    Using begin script: install_begin
    Using finish script: patch_finish
    Executing SolStart preinstall phase...
    Executing begin script "install_begin"...
    Begin script install_begin execution completed.
    WARNING: Backup media not specified.  A backup media (backup_media)
      keyword must be specified if an upgrade with disk space reallocation
      is required
    
    Processing profile
    
    Loading local environment and services
    
    Generating upgrade actions
    Checking file system space: 100% completed
    Space check complete.
    
    Building upgrade script
    
    Preparing system for Solaris upgrade
    
    Upgrading Solaris: 10% completed
    [...]
  • 使用 ISO 映像。ldmp2v convert 命令可将 Oracle Solaris DVD ISO 映像附加到逻辑域并从中进行引导。要进行升级,请回答所有 sysid 提示,然后选择“升级”。


    Caution

    注意  - 在转换来宾域之前需执行安全检查。此检查可确保初始系统的 IP 地址不处于活动状态,以防止网络上出现重复的活动 IP 地址。可以使用 –x skip-ping-test 选项跳过此安全检查。跳过此检查可加快转换过程。只有当您确信不存在重复的 IP 地址(例如,初始主机未处于活动状态)时,才能使用此选项


    sysid 问题的回答仅会在升级过程期间使用。此数据不会应用至磁盘上的现有 OS 映像。执行转换的最快速、最简单的方法是选择“非联网”。指定的 root 密码不需要与源系统的 root 密码匹配。升级操作会保留系统的原始标识,该标识将在升级后的重新引导后生效。执行升级所需的时间取决于原始系统上安装的 Oracle Solaris Cluster。

    # ldmp2v convert -i /tank/iso/s10s_u5.iso -d /home/dana/p2v/volumia volumia
    Testing original system status ...
    LDom volumia started
    Waiting for Solaris to come up ...
    
            Select 'Upgrade' (F2) when prompted for the installation type.
            Disconnect from the console after the Upgrade has finished.
    
    Trying 0.0.0.0...
    Connected to 0.
    Escape character is '^]'.
    
    Connecting to console "volumia" in group "volumia" ....
    Press ~? for control options ..
    Configuring devices.
    Using RPC Bootparams for network configuration information.
    Attempting to configure interface vnet0...
    Extracting windowing system. Please wait...
    Beginning system identification...
    Searching for configuration file(s)...
    Search complete.
    Discovering additional network configuration...
    Configured interface vnet0
    Setting up Java. Please wait...
    
    Select a Language
    
       0. English
       1. French
       2. German
       3. Italian
       4. Japanese
       5. Korean
       6. Simplified Chinese
       7. Spanish
       8. Swedish
       9. Traditional Chinese
    
    Please make a choice (0 - 9), or press h or ? for help:
    [...]
    - Solaris Interactive Installation --------------------------------------------
    
      This system is upgradable, so there are two ways to install the Solaris
      software.
    
      The Upgrade option updates the Solaris software to the new release, saving
      as many modifications to the previous version of Solaris software as
      possible.  Back up the system before using the Upgrade option.
    
      The Initial option overwrites the system disks with the new version of
      Solaris software.  This option allows you to preserve any existing file
      systems.  Back up any modifications made to the previous version of Solaris
      software before starting the Initial option.
    
      After you select an option and complete the tasks that follow, a summary of
      your actions will be displayed.
    
    -------------------------------------------------------------------------------
         F2_Upgrade    F3_Go Back    F4_Initial    F5_Exit    F6_Help