跳到内容跳到页面导航:上一页 [access key p]/下一页 [access key n]
documentation.suse.com / SUSE Linux Enterprise Server 文档 / Quick Start Manuals / Xen 到 KVM 的迁移指南
SUSE Linux Enterprise Server 15 SP2

Xen 到 KVM 的迁移指南

SUSE Linux Enterprise Server 15 SP2

出版日期: December 11, 2023

随着服务器管理员越来越广泛地使用 KVM 虚拟化解决方案,他们中的许多人都需要有一个途径将其基于 Xen 的现有环境迁移到 KVM。目前还没有成熟的工具可自动将 Xen VM 转换为 KVM。不过,有一个技术解决方案有助于将 Xen 虚拟机转换为 KVM。下面的信息和过程可帮助您执行这样的迁移。

重要
重要:不支持迁移过程

SUSE 不完全支持本文档中所述的迁移过程。我们提供的说明仅作为指导。

1 使用 virt-v2v 迁移到 KVM

本章包含可帮助您将虚拟机从外部超级管理程序(例如 Xen)导入到 libvirt 所管理的 KVM 的信息。

提示
提示:Microsoft Windows Guest

本章重点介绍如何转换 Linux Guest。使用 virt-v2v 转换 Microsoft Windows Guest 与转换 Linux Guest 的过程相同,只不过对虚拟机驱动程序包 (VMDP) 的处理有所不同。虚拟机驱动程序包文档 中提供了有关转换使用 VMDP 的 Windows Guest 的更多细节。

1.1 virt-v2v 简介

virt-v2v 是一个命令行工具,可将外部超级管理程序中的 VM Guest 转换为在 libvirt 管理的 KVM 上运行。如果可能,它会在转换的虚拟机中启用半虚拟化 virtio 驱动程序。下面是支持的操作系统和超级管理程序列表:

支持的 Guest 操作系统
  • SUSE Linux Enterprise Server

  • openSUSE

  • Red Hat Enterprise Linux

  • Fedora

  • Microsoft Windows Server 2003 和 2008

支持的源超级管理程序
  • Xen

支持的目标超级管理程序
  • KVM(由 libvirt 管理)

1.2 安装 virt-v2v

安装 virt-v2v 的过程很简单:

tux > sudo zypper install virt-v2v

请记住,virt-v2v 需要 root 特权,因此您需要以 root 身份或通过 sudo 运行该工具。

1.3 准备虚拟机

注意
注意:跳过此步骤的条件

如果在 SLES 12 SP1 或之前的版本上运行 virt-v2v,可以放心跳过此步骤。如果虚拟机已完全虚拟化或者在 SLES 12 SP2 或更高版本上运行,也可以忽略此步骤。

Xen 虚拟机必须安装默认内核。要确保已执行此操作,请在虚拟机上运行 zypper in kernel-default

1.4 将虚拟机转换为在 libvirt 管理的 KVM 下运行

virt-v2v 可将 Xen 超级管理程序中的虚拟机转换为在 libvirt 管理的 KVM 下运行。要了解有关 libvirtvirsh 的详细信息,请参见第 II 部分 “使用 libvirt 管理虚拟机”。此外,virt-v2v 手册页 (man 1 virt-v2v) 中也对所有 virt-v2v 命令行选项进行了说明。

转换虚拟机之前,请务必完成以下步骤:

过程 1︰ 准备转换环境
  1. 创建新的本地储存池。

    virt-v2v 会将源虚拟机的储存复制到 libvirt 所管理的本地储存池(原始磁盘映像保持不变)。您可以使用虚拟机管理器或 virsh 创建该池。有关详细信息,请参见第 12.1 节 “使用虚拟机管理器管理储存”第 12.2 节 “使用 virsh 管理储存”

  2. 准备本地网络接口。

    检查转换的虚拟机能否使用 VM 主机服务器上的本地网络接口。该接口通常是一个网桥。如果尚未定义接口,请单击 YaST › 系统 › 网络设置 › 添加 › 网桥创建。

    注意
    注意:网络设备的映射

    在转换过程中,可能会将源 Xen 主机上的网络设备映射到 KVM 目标主机上的相应网络设备。例如,可能会将 Xen 网桥 br0 映射到 KVM 网络 default。/etc/virt-v2v.conf 中提供了一些示例映射。要启用这些映射,请根据需要修改 XML 规则,并确保未以 <! ----> 标记注释相应部分。例如:

     <network type='bridge' name='br0'>
       <network type='network' name='default'/>
     </network>
    提示
    提示:无网桥

    如果没有可用的网桥,虚拟机管理器可以选择性创建一个。

virt-v2v 的基本命令语法如下:

virt-v2v -i INPUT_METHOD -os STORAGE_POOL SOURCE_VM
input_method

输入方法有以下两种:libvirtlibvirtxml。有关详细信息,请参见 SOURCE_VM 参数。

storage_pool

您已为目标虚拟机准备好的储存池。

source_vm

要转换的源虚拟机。其值取决于 INPUT_METHOD 参数:如果输入方法为 libvirt,需指定 libvirt 域的名称。如果输入方法为 libvirtxml,需指定包含 libvirt 域规范的 XML 文件的路径。

注意
注意:转换时间

转换虚拟机时会占用大量系统资源,主要用于复制虚拟机的整个磁盘映像。转换单个虚拟机一般最多需要 10 分钟时间,但如果虚拟机使用的磁盘映像非常大,转换时间可能会长很多。

1.4.1 基于 libvirt XML 描述文件的转换

本节说明如何使用 libvirt XML 配置文件转换本地 Xen 虚拟机。如果主机已在运行 KVM 超级管理程序,则适合使用此方法。确保在本地主机上可以使用源虚拟机的 libvirt XML 文件以及其中引用的 libvirt 储存池。

  1. 获取源虚拟机的 libvirt XML 描述。

    提示
    提示:获取 XML 文件

    要获取源虚拟机的 libvirt XML 文件,您必须在 Xen 内核下运行主机操作系统。如果您已将主机重引导至启用了 KVM 的环境,请将其重引导回 Xen 内核,转储 libvirt XML 文件,然后再重引导回 KVM 环境。

    首先,识别 virsh 下的源虚拟机:

    root # virsh list
     Id    Name                           State
    ----------------------------------------------------
    [...]
      2     sles12_xen                     running
    [...]

    sles12_xen 是要转换的源虚拟机。现在,导出其 XML 并保存到 sles12_xen.xml

    root # virsh dumpxml sles12_xen > sles12_xen.xml
  2. 从 KVM 主机的角度校验所有磁盘映像路径是否正确。在一台计算机上转换时,路径正确与否不会产生问题,但使用 XML 转储从其他主机进行转换时,可能需要手动更改路径。

    <source file='/var/lib/libvirt/images/XenPool/SLES.qcow2'/>
    提示
    提示:复制映像

    为避免将映像复制两次,请直接手动将磁盘映像复制到 libvirt 储存池。更新 XML 描述文件中的源文件项。virt-v2v 进程将检测到现有磁盘,并就地转换这些磁盘。

  3. 运行 virt-v2v 以转换为 KVM 虚拟机:

    root # virt-v2v sles12_xen.xml1 \
    -i LIBVIRTXML2 \
    -os remote_host.example.com:/exported_dir3 \
    --bridge br04 \
    -on sles12_kvm5

    1

    基于 Xen 的源虚拟机的 XML 描述。

    2

    virt-v2v 将从 libvirt XML 文件中读取有关源虚拟机的信息。

    3

    将放置目标虚拟机磁盘映像的储存池。在此示例中,映像将放置在 remote_host.example.com 服务器的 NFS 共享 /exported_dir 上。

    4

    基于 KVM 的目标虚拟机将使用主机上的网桥 br0

    5

    目标虚拟机将重命名为 sles12_kvm,以防与同名的现有虚拟机发生名称冲突。

1.4.2 基于 libvirt 域名的转换

如果您仍在 Xen 下运行 libvirt,打算稍后重引导到 KVM 超级管理程序,则此方法很有用。

  1. 确定您要转换的虚拟机的 libvirt 域名。

    root # virsh list
     Id    Name                           State
    ----------------------------------------------------
    [...]
      2     sles12_xen                     running
    [...]

    sles12_xen 是要转换的源虚拟机。

  2. 运行 virt-v2v 以转换为 KVM 虚拟机:

    root # virt-v2v sles12_xen1 \
    -i libvirt2 \
    -os storage_pool3 \
    --network eth04 \
    -of qcow25 \
    -oa sparce6 \
    -on sles12_kvm

    1

    基于 Xen 的虚拟机的域名。

    2

    virt-v2v 将直接通过活动的 libvirt 连接读取有关源虚拟机的信息。

    3

    目标磁盘映像将放置在本地 libvirt 储存池中。

    4

    所有 Guest 网桥(或网络)都将连接到本地管理的网络。

    5

    目标虚拟机的磁盘映像的格式。支持的选项为 rawqcow2

    6

    转换的 Guest 磁盘空间将采用稀疏模式还是预分配模式。

1.4.3 转换远程 Xen 虚拟机

如果您需要转换在远程主机上运行的 Xen 虚拟机,此方法非常有用。因为 virt-v2v 通过 ssh 连接到远程主机,需确保主机上在运行 SSH 服务。

注意
注意:无口令 SSH 访问

从 SLES 12 SP2 开始,virt-v2v 要求通过无口令 SSH 方式连接到远程主机。这意味着需向 ssh-agent 添加一个使用 SSH 密钥的连接。有关这方面的细节,请参见 man ssh-keygenman ssh-add第 18 章 “SSH:安全性网络操作 上也提供了详细信息。

要连接到远程 libvirt 连接,请构建远程主机的相关有效连接 URI。在下面的示例中,远程主机名为 remote_host.example.com,连接的用户名为 root。连接 URI 的格式如下所示:

xen+ssh://root@remote_host.example.com/

有关 libvirt 连接 URI 的详细信息,请参见 http://libvirt.org/uri.html

  1. 确定您要转换的远程虚拟机的 libvirt 域名。

    root # virsh -c xen+ssh://root@remote_host.example.com/ list
     Id    Name                           State
    ----------------------------------------------------
      1     sles12_xen                     running
    [...]

    sles12_xen 是要转换的源虚拟机。

  2. 远程连接的 virt-v2v 命令如下所示:

    root # virt-v2v sles12_xen \
    -i libvirt \
    -ic xen+ssh://root@remote_host.example.com/ \
    -os local_storage_pool \
    --bridge br0

1.5 运行转换的虚拟机

virt-v2v 成功完成之后,将采用 -on 选项指定的名称创建一个新的 libvirt 域。如果您未指定 -on,将使用与源虚拟机相同的名称。您可以使用 virsh 或虚拟机管理器等标准 libvirt 工具管理新 Guest。

提示
提示:重引导计算机

如果您已按第 1.4.2 节 “基于 libvirt 域名的转换”中所述在 Xen 下完成转换,可能需要重引导主机,并使用非 Xen 内核进行引导。

2 Xen 到 KVM 的手动迁移

2.1 一般概述

首选的虚拟机管理解决方案是在 libvirt 上进行管理;有关详细信息,请参见 http://libvirt.org/。与手动定义和运行虚拟机的方式相比,它具有多项优势 — libvirt 可以跨平台,支持许多超级管理程序,具有安全的远程管理功能以及虚拟网络功能,最重要的是,它可提供统一的抽象层来管理虚拟机。因此,本文着重于介绍 libvirt 解决方案。

通常,进行 Xen 到 KVM 的迁移需执行以下基本步骤:

  1. 创建原始 Xen VM Guest 的备份副本。

  2. 可选:实施特定于半虚拟化 Guest 的更改。

  3. 获取有关 Xen VM Guest 的信息,并将其更新为 KVM 对等项。

  4. 关闭 Xen 主机上的 Guest,然后在 KVM 超级管理程序下运行新 Guest。

警告
警告:无法实时迁移

当源 VM Guest 正在运行时,无法将 Xen 实时迁移到 KVM。运行新的 KVM 就绪 VM Guest 之前,建议您关闭原始 Xen VM Guest。

2.2 备份 Xen VM Guest

要备份 Xen VM Guest,请执行以下步骤:

  1. 识别您要迁移的相关 Xen Guest 并记住其 ID/名称。

    tux > sudo virsh list --all
    Id Name                 State
    ----------------------------------
     0 Domain-0             running
     1 SLES11SP3            running
    [...]
  2. 关闭 Guest。您可以通过关闭 Guest 操作系统或使用 virsh 执行此操作:

    tux > sudo virsh shutdown SLES11SP3
  3. 将其配置备份到 XML 文件。

    tux > sudo virsh dumpxml SLES11SP3 > sles11sp3.xml
  4. 备份其磁盘映像文件。使用 cprsync 命令创建备份副本。请记住,比较好的做法始终是使用 md5sum 命令检查副本。

  5. 备份映像文件之后,您可以使用以下命令再次启动 Guest

    tux > sudo virsh start SLES11SP3

2.3 特定于半虚拟化 Guest 的更改

如果您从半虚拟化 Xen Guest 进行迁移,请实施以下更改。您可以使用 guestfs-tools 在运行中的 Guest 或已停止的 Guest 上执行此操作。

重要
重要

实施本节中所述的更改后,与迁移的 VM Guest 有关的映像文件将无法继续在 Xen 下使用。

2.3.1 安装默认内核

警告
警告:无法引导

安装默认内核之后,请不要尝试使用该内核引导 Xen Guest,系统将不会引导。

克隆 Xen Guest 磁盘映像以在 KVM 超级管理程序下使用之前,请确保该映像可在没有 Xen 超级管理程序的情况下引导。这一点对于半虚拟化 Xen Guest 非常重要,因为它们通常包含一个特殊的 Xen 内核,并且通常未安装完整的 GRUB 2 引导加载程序。

  1. 如果是 SLES 11,请更新 /etc/sysconfig/kernel 文件。更改 INITRD_MODULES 参数,具体做法是去除所有 Xen 驱动程序并以 virtio 驱动程序替换这些驱动程序。将

    INITRD_MODULES="xenblk xennet"

    替换为

    INITRD_MODULES="virtio_blk virtio_pci virtio_net virtio_balloon"

    如果是 SLES 12,请在 /etc/dracut.conf.d/*.conf 中搜索 xenblk xennet,并将它们替换为 virtio_blk virtio_pci virtio_net virtio_balloon

  2. 半虚拟化 Xen Guest 运行的是特定的 Xen 内核。要在 KVM 下运行 Guest,您需要安装默认内核。

    注意
    注意:默认内核已安装

    对于全虚拟化 Guest,您无需安装默认内核,因为它已安装。

    在 Xen Guest 上输入 rpm -q kernel-default,以确认默认内核是否已安装。如果未安装,请使用 zypper in kernel-default 进行安装。

    我们将用于在 KVM 下引导 Guest 的内核必须有可用的 virtio(半虚拟化)驱动程序。请运行以下命令确认是否如此。不要忘记将 5.3.18-8 替换为您的内核版本:

    tux > sudo sudo find /lib/modules/5.3.18-8-default/kernel/drivers/ -name virtio*
    /lib/modules/5.3.18-8-default/kernel/drivers/block/virtio_blk.ko
    /lib/modules/5.3.18-8-default/kernel/drivers/char/hw_random/virtio-rng.ko
    /lib/modules/5.3.18-8-default/kernel/drivers/char/virtio_console.ko
    /lib/modules/5.3.18-8-default/kernel/drivers/crypto/virtio
    ...
  3. 更新 /etc/fstab。将所有储存设备从 xvda 更改为 vda

  4. 更新引导加载程序配置。在 Xen Guest 上输入 rpm -q grub2,以确认 GRUB 2 是否已安装。如果未安装,请使用 zypper in grub2 进行安装。

    现在,将新安装的默认内核设为默认的操作系统引导项。此外,去除/更新可能会引用特定于 Xen 的设备的内核命令行选项。您可以使用 YaST(系统 › 引导加载程序)或手动执行此操作。

    • 列出所有 Linux 引导菜单项,以确定首选引导菜单项:

      tux > cat /boot/grub2/grub.cfg | grep 'menuentry '

      请记住您新安装的项目的序号(从零开始计数)。

    • 将其设为默认引导菜单项:

      tux > sudo grub2-set-default N

      N 替换为之前查明的引导菜单项编号。

    • 打开 /etc/default/grub 进行编辑,并查找 GRUB_CMDLINE_LINUX_DEFAULTGRUB_CMDLINE_LINUX_RECOVERY 选项。去除/更新对特定于 Xen 的设备的所有引用。在下面的示例中,您可以将

      root=/dev/xvda1 disk=/dev/xvda console=xvc

      替换为

      root=/dev/vda1 disk=/dev/vda

      请注意,您需要去除对 xvc 类型控制台(例如 xvc0)的所有引用。

  5. 更新 /boot/grub2/boot/grub2-efi 其中一个目录中的 device.map。将所有储存设备从 xvda 更改为 vda

  6. 要导入新的默认设置,请运行

    grub2-mkconfig -o /boot/grub2/grub.cfg

2.3.2 更新 Guest 以在 KVM 下引导

  1. 更新系统以使用默认串行控制台。列出配置的控制台,并去除 xvc? 控制台的符号链接。

    tux > sudo ls -l /etc/systemd/system/getty.target.wants/
    getty@tty1.service -> /usr/lib/systemd/system/getty@.service
    getty@xvc0.service -> /usr/lib/systemd/system/getty@xvc0.service
    getty@xvc1.service -> /usr/lib/systemd/system/getty@xvc1.service
    
    # rm /etc/systemd/system/getty.target.wants/getty@xvc?.service
  2. 更新 /etc/securetty 文件。将 xvc0 替换为 ttyS0

2.4 更新 Xen VM Guest 配置

本节介绍如何导出原始 Xen VM Guest 的配置,以及为了能够将该 Guest 作为 KVM Guest 导入到 libvirt 中需对其实施的特定更改。

2.4.1 导出 Xen VM Guest 配置

首先导出 Guest 的配置并保存到某个文件中。典型的导出如下所示:

tux > sudo virsh dumpxml SLES11SP3
<domain type='xen'>
  <name>SLES11SP3</name>
  <uuid>fa9ea4d7-8f95-30c0-bce9-9e58ffcabeb2</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <bootloader>/usr/bin/pygrub</bootloader>
  <os>
    <type>linux</type>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
    <disk type='file' device='disk'>
      <driver name='file'/>
      <source file='/var/lib/libvirt/images/SLES_11_SP2_JeOS.x86_64-0.0.2_para.raw'/>
      <target dev='xvda' bus='xen'/>
    </disk>
    <interface type='bridge'>
      <mac address='00:16:3e:2d:91:c3'/>
      <source bridge='br0'/>
      <script path='vif-bridge'/>
    </interface>
    <console type='pty'>
      <target type='xen' port='0'/>
    </console>
    <input type='mouse' bus='xen'/>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>

http://libvirt.org/formatdomain.html 上提供了有关 VM Guest 描述的 libvirt XML 格式的详细信息。

2.4.2 对 Guest 配置的一般更改

您需要对导出的 Xen Guest XML 配置进行一些一般性更改,方可使其在 KVM 超级管理程序下运行。以下规则对全虚拟化和半虚拟化 Guest 均适用。请注意,您的具体配置中并不需要包含下列所有 XML 元素。

提示
提示:使用的约定

为了表示 XML 配置文件中的节点,整个文档中将使用 XPath 语法。例如,如要表示 <domain> 标记中的 <name>

<domain>
  <name>sles11sp3</name>
</domain>

将使用 XPath 对等项 /domain/name

  1. /domain 元素的 type 属性从 xen 更改为 kvm

  2. 去除 /domain/bootloader 元素部分。

  3. 去除 /domain/bootloader_args 元素部分。

  4. /domain/os/type 元素值从 linux 更改为 hvm

  5. /domain/os 元素下添加 <boot dev="hd"/>

  6. /domain/os/type 元素中添加 arch 属性。可接受的值为 arch=”x86_64”arch=”i686”

  7. /domain/devices/emulator 元素从 /usr/lib/xen/bin/qemu-dm' 更改为 /usr/bin/qemu-kvm

  8. 对与半虚拟化 (PV) Guest 关联的每个磁盘进行以下更改:

    • /domain/devices/disk/drivername 属性从 file 更改为 qemu,然后添加 type 属性以指定磁盘类型。例如,有效选项包括 rawqcow2

    • /domain/devices/disk/target 元素的 dev 属性从 xvda 更改为 vda

    • /domain/devices/disk/target 元素的 bus 属性从 xen 更改为 virtio

  9. 对每个网络接口卡进行以下更改:

    • 如果 /domain/devices/interface 中定义了 model,请将其 type 属性值更改为 virtio

      <model type=”virtio”>
    • 删除所有 /domain/devices/interface/script 部分。

    • 删除 dev 属性以 vifvnetveth 开头的所有 /domain/devices/interface/target 元素。如果使用的是自定义网络,请将 dev 值更改为该目标。

  10. 去除 /domain/devices/console 元素部分(如果存在)。

  11. 去除 /domain/devices/serial 元素部分(如果存在)。

  12. /domain/devices/input 元素的 bus 属性从 xen 更改为 ps2

  13. /domain/devices 元素下添加以下有关内存气球功能的元素。

    <memballoon model="virtio"/>
提示
提示:设备名

<target dev='hda' bus='ide'/> 控制在哪个设备下向 Guest 操作系统公开磁盘。dev 属性指示“逻辑”设备名称。我们无法保证实际指定的设备名称与 Guest 操作系统中的设备名称对应。因此,您可能需要更改引导加载程序命令行上的磁盘映射。例如,如果引导加载程序预期根磁盘为 hda2,但 KVM 仍将其视为 sda2,请将引导加载程序命令行从

[...] root=/dev/hda2 resume=/dev/hda1 [...]

更改为

[...] root=/dev/sda2 resume=/dev/sda1 [...]

如果是半虚拟化 xvda 设备,请将其更改为

[...] root=/dev/vda2 resume=/dev/vda1 [...]

否则,VM Guest 将拒绝在 KVM 环境中引导。

2.4.3 目标 KVM Guest 配置

实施上述所有修改后,您的 KVM Guest 的最终配置如下所示:

<domain type='kvm'>
  <name>SLES11SP3</name>
  <uuid>fa9ea4d7-8f95-30c0-bce9-9e58ffcabeb2</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu cpuset='0-3'>1</vcpu>
  <os>
    <type arch=”x86_64”>hvm</type>
    <boot dev="hd"/>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type="raw"/>
      <source file='/var/lib/libvirt/images/SLES_11_SP2_JeOS.x86_64-0.0.2_para.raw'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='bridge'>
      <mac address='00:16:3e:2d:91:c3'/>
      <source bridge='br0'/>
    </interface>
    <input type='mouse' bus='usb'/>
    <graphics type='vnc' port='5900' autoport='yes' keymap='en-us'/>
    <memballoon model="virtio"/>
  </devices>
</domain>

将配置保存到主目录中的某个文件。您稍后将其导入之后,它会复制到默认的 /etc/libvirt/qemu 中。假设您将文件保存为 SLES11SP3.xml

2.5 迁移 VM Guest

更新 VM Guest 配置并对 Guest 操作系统实施必要的更改之后,请关闭原始 Xen Guest 并在 KVM 超级管理程序下运行其克隆版本。

  1. root 身份从控制台运行 shutdown -h now,以关闭 Xen 主机上的 Guest。

  2. 根据需要复制与 VM Guest 关联的磁盘文件。默认配置要求将 Xen 磁盘文件从 /var/lib/xen/images 复制到 /var/lib/kvm/images。如果您之前未创建 VM Guest,则可能需要以 root 身份创建 /var/lib/kvm/images 目录。

  3. 创建新域,然后将其注册到 libvirt 中:

    tux > sudo virsh define SLES11SP3.xml
     Domain SLES11SP3 defined from SLES11SP3.xml
  4. 校验新 Guest 是否包含在 KVM 配置中。

    tux > virsh list –all
  5. 创建域之后,您可以将其启动:

    tux > sudo virsh start SLES11SP3
     Domain SLES11SP3 started

3 更多信息

有关 libvirt 的详细信息,请参见 http://libvirt.org

http://libvirt.org/formatdomain.html 上提供了有关 libvirt XML 格式的更多细节。

https://documentation.suse.com/ 上的 SUSE Linux Enterprise Server 文档中提供了有关 Xen 和 KVM 虚拟化的详细信息。

4 法律声明

版权所有 © 2006– 2023 SUSE LLC 和贡献者。保留所有权利。

根据 GNU 自由文档许可证 (GNU Free Documentation License) 版本 1.2 或(根据您的选择)版本 1.3 中的条款,在此授予您复制、分发和/或修改本文档的许可权限;本版权声明和许可证附带不可变部分。许可证版本 1.2 的副本包含在题为GNU 自由文档许可证的部分。

有关 SUSE 商标,请参见 https://www.suse.com/company/legal/。所有其他第三方商标是其各自所有者的财产。商标符号(®、™ 等)代表 SUSE 及其关联公司的商标。星号 (*) 代表第三方商标。

本指南力求涵盖所有细节,但这不能确保本指南准确无误。SUSE LLC 及其关联公司、作者和译者对于可能出现的错误或由此造成的后果皆不承担责任。

5 GNU Free Documentation License

Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or non-commercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

We have designed this License to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.

The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

You may copy and distribute the Document in any medium, either commercially or non-commercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

  1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.

  2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.

  3. State on the Title page the name of the publisher of the Modified Version, as the publisher.

  4. Preserve all the copyright notices of the Document.

  5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.

  6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.

  7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.

  8. Include an unaltered copy of this License.

  9. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.

  10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.

  11. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.

  12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.

  13. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.

  14. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.

  15. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements".

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.

If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.

Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled “GNU
Free Documentation License”.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this:

with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.