Apache CloudStack Administration RTD - en to zh_CN translation catalogue (229 entries)

en: Working with Templates
zh_CN: 使用模板

en: A template is a reusable configuration for virtual machines. When users launch VMs, they can choose from a list of templates in CloudStack.
zh_CN: 模板相当于虚拟机的重用配置。当用户创建虚拟机时能从CloudStack的模板列表中选择一个。

en: Specifically, a template is a virtual disk image that includes one of a variety of operating systems, optional additional software such as office applications, and settings such as access control to determine who can use the template. Each template is associated with a particular type of hypervisor, which is specified when the template is added to CloudStack.
zh_CN: 特殊情况下，模板可以是一个包含一个或多个操作系统的虚拟磁盘镜像，你可以选择性的安装另外的软件，比如office应用并设置访问控制来决定谁能使用这个模板。每个模板对应一个特殊类型的虚拟机，此类虚拟机在将模板添加入CloudStack时指定。

en: CloudStack ships with a default template. In order to present more choices to users, CloudStack administrators and users can create templates and add them to CloudStack.
zh_CN: CloudStack附带一个默认模板。为了向用户呈现出更多选择，CloudStack的管理员和用户能创建模板并添加到CloudStack中。

en: Creating Templates: Overview
zh_CN: 创建模板概览

en: CloudStack ships with a default template for the CentOS operating system. There are a variety of ways to add more templates. Administrators and end users can add templates. The typical sequence of events is:
zh_CN: CloudStack默认已经有了一个带CentOS系统的默认模板。有许多添加更多模板的方法，管理员和普通用户均能添加。一般是这样的顺序：

en: Launch a VM instance that has the operating system you want. Make any other desired configuration changes to the VM.
zh_CN: 运行一个带有你需要的操作系统的虚拟机实例，并进行一些你期望的设置。

en: Stop the VM.
zh_CN: 停止VM。

en: Convert the volume into a template.
zh_CN: 将卷转换为模板。

en: There are other ways to add templates to CloudStack. For example, you can take a snapshot of the VM's volume and create a template from the snapshot, or import a VHD from another system into CloudStack.
zh_CN: 还有其他方法向CloudStack中添加模板。比如你可以对虚机磁盘卷做个快照然后通过这个快照创建模板，或者从另一个系统导入一个VHD到CloudStack。

en: The various techniques for creating templates are described in the next few sections.
zh_CN: 接下来的几节中将继续讲述各种创建模板的技术。

en: Requirements for Templates
zh_CN: 模板的需求

en: For XenServer, install PV drivers / Xen tools on each template that you create. This will enable live migration and clean guest shutdown.
zh_CN: 对于 XenServer, 在每一个你创建的模板上安装 PV 驱动 / Xen tools。 这将使动态迁移和干净的宾客关机成为可能。

en: For vSphere, install VMware Tools on each template that you create. This will enable console view to work properly.
zh_CN: 对于 vSphere, 在每一个你创建的模板上安装VMware 工具。这将使控制台视图能够正常工作。

en: Best Practices for Templates
zh_CN: 模板最佳实践

en: If you plan to use large templates (100 GB or larger), be sure you have a 10-gigabit network to support the large templates. A slower network can lead to timeouts and other errors when large templates are used.
zh_CN: 如果你计划使用大的模板(100 GB 或更大)，确保你有10g 的网络以支持大的模板。 当大的模板被使用时，较慢的网络可能导致超时及其它错误。

en: The Default Template
zh_CN: 默认模版

en: CloudStack includes a CentOS template. This template is downloaded by the Secondary Storage VM after the primary and secondary storage are configured. You can use this template in your production deployment or you can delete it and use custom templates.
zh_CN: CloudStack包含一个CentOS 模版。当主存储和二级存储配置完成后，这个模版会由二级存储虚拟机下载。可以在生产部署中使用这个模版，也可以删除掉它，使用自定义的模版。

en: The root password for the default template is "password".
zh_CN: 默认模版的root用户密码是“password”。

en: A default template is provided for each of XenServer, KVM, and vSphere. The templates that are downloaded depend on the hypervisor type that is available in your cloud. Each template is approximately 2.5 GB physical size.
zh_CN: 为XenServer，KVM和vSphere各提供了一个默认模板。下载的模板取决于你的云中使用的hypervisor类型。每个模板大概占用2.5GB的存储空间。

en: The default template includes the standard iptables rules, which will block most access to the template excluding ssh.
zh_CN: 默认模版包括标准的iptables 规则，会阻止除了ssh以外的其他访问。

en: Private and Public Templates
zh_CN: 私有模板和公共模板

en: When a user creates a template, it can be designated private or public.
zh_CN: 用户创建模板时可选择模板为公有还是私有。

en: Private templates are only available to the user who created them. By default, an uploaded template is private.
zh_CN: 私有模板只对创建者可用。默认上传的模板都是私有的。

en: When a user marks a template as “public,” the template becomes available to all users in all accounts in the user's domain, as well as users in any other domains that have access to the Zone where the template is stored. This depends on whether the Zone, in turn, was defined as private or public. A private Zone is assigned to a single domain, and a public Zone is accessible to any domain. If a public template is created in a private Zone, it is available only to users in the domain assigned to that Zone. If a public template is created in a public Zone, it is available to all users in all domains.
zh_CN: 当用户将模板标识为“公有”，该模板不但能让该用户域中所有账户中的所有用户使用，还可以让能访问存储该模板的区域的其他域中用户使用。这取决于zone是设置成公用还是私有。私有区域被分配到一个单一的域，而公共区域能被任何域访问。

en: Creating a Template from an Existing Virtual Machine
zh_CN: 通过已存在的虚拟机创建模板

en: Once you have at least one VM set up in the way you want, you can use it as the prototype for other VMs.
zh_CN: 当你已经有了一台按你的想法已经配置好的虚拟机，你就能以他为原型创建别的虚拟机。

en: Create and start a virtual machine using any of the techniques given in `“Creating VMs” <virtual_machines.html#creating-vms>`_.
zh_CN: 使用 `“创建VMs” <virtual_machines.html#creating-vms>`_给出的方法创建并且开启一个虚拟机。

en: Make any desired configuration changes on the running VM, then click Stop.
zh_CN: 在虚拟机中做好需要的配置，然后点击按钮关闭该虚拟机。

en: Wait for the VM to stop. When the status shows Stopped, go to the next step.
zh_CN: 等待虚拟机关闭。当虚拟机状态显示为“已停止”，执行下一步。

en: Click Create Template and provide the following:
zh_CN: 点击创建模板并填写如下内容：

en: **Name and Display Text**. These will be shown in the UI, so choose something descriptive.
zh_CN: **名称和显示文本**。这些会在UI中显示，所以建议写一些描述信息。

en: **OS Type**. This helps CloudStack and the hypervisor perform certain operations and make assumptions that improve the performance of the guest. Select one of the following.
zh_CN: **操作系统类型*:。这有助于CloudStack和Hypervisor执行某些操作并可能提高来宾虚拟机的性能。选择下列之一。

en: If the operating system of the stopped VM is listed, choose it.
zh_CN: 如果已停止虚拟机的系统在列表中，选择它。

en: If the OS type of the stopped VM is not listed, choose Other.
zh_CN: 如果已停止虚拟机系统类型不在列表中就选择其他。

en: If you want to boot from this template in PV mode, choose Other PV (32-bit) or Other PV (64-bit). This choice is available only for XenServere:
zh_CN: 如果你打算以PV模式启动该模板，请选择其他PV(32位)或其他PV(64位)。这个选项只对XenServer有效：

en: Generally you should not choose an older version of the OS than the version in the image. For example, choosing CentOS 5.4 to support a CentOS 6.2 image will in general not work. In those cases you should choose Other.
zh_CN: 通常你不能选择比镜像版本老的OS版本。比如，选择CentOS 5.4来支持CentOS 6.2镜像通常来说是不工作的。在这种情况下，你应该选择其他。

en: **Public**. Choose Yes to make this template accessible to all users of this CloudStack installation. The template will appear in the Community Templates list. See `“Private and Public Templates” <#private-and-public-templates>`_.
zh_CN: **公共**。选择是来让CloudStack里面的所有用户都能访问这个模板。模板将会出现在社区模板列表中。请参阅 `“私有和公共模板” <#private-and-public-templates>`_。

en: **Password Enabled**. Choose Yes if your template has the CloudStack password change script installed. See :ref:`adding-password-management-to-templates`.
zh_CN: **启用密码**。如果你的模板中安装了CLoudStack密码修改脚本，选择是。请参阅 :ref:`adding-password-management-to-templates`。

en: Click Add.
zh_CN: 点击 添加

en: The new template will be visible in the Templates section when the template creation process has been completed. The template is then available when creating a new VM.
zh_CN: 当模版创建过程完成后，新模版会出现在模版页面。在创建虚机时就可以使用新模版了。

en: Creating a Template from a Snapshot
zh_CN: 从一个快照创建一个模板

en: If you do not want to stop the VM in order to use the Create Template menu item (as described in `“Creating a Template from an Existing Virtual Machine” <#creating-a-template-from-an-existing-virtual-machine>`_), you can create a template directly from any snapshot through the CloudStack UI.
zh_CN: 如果你不想为了使用创建模板菜单项而停止虚拟机(如在`“从已有的虚机创建模板” <#creating-a-template-from-an-existing-virtual-machine>`_中描述的)， 你可以通过CloudStack UI从任何快照直接创建模板。

en: Uploading Templates
zh_CN: 上传模板

en: vSphere Templates and ISOs
zh_CN: vSphere模板和ISOs

en: If you are uploading a template that was created using vSphere Client, be sure the OVA file does not contain an ISO. If it does, the deployment of VMs from the template will fail.
zh_CN: 如果你通过vSphere Client上传模板，请确认OVA文件不包含ISO。如果是的话，从模板部署虚拟机将失败。

en: Templates are uploaded based on a URL. HTTP is the supported access protocol. Templates are frequently large files. You can optionally gzip them to decrease upload times.
zh_CN: 模板是使用HTTP协议通过URL来上传的。模板通常都很大。你可以使用gzip压缩它们以缩短上传时间。

en: To upload a template:
zh_CN: 要上传模板：

en: In the left navigation bar, click Templates.
zh_CN: 在左侧的导航栏，点击模板。

en: Click Register Template.
zh_CN: 点击注册模板。

en: Provide the following:
zh_CN: 填写以下内容：

en: **Name and Description**. These will be shown in the UI, so choose something descriptive.
zh_CN: **名称和显示文本**。这些会在UI中显示，所以建议写一些描述信息。

en: **URL**. The Management Server will download the file from the specified URL, such as ``http://my.web.server/filename.vhd.gz``.
zh_CN: **URL**。管理服务器会从指定的URL下载模板，就像 ``http://my.web.server/filename.vhd.gz``。

en: **Zone**. Choose the zone where you want the template to be available, or All Zones to make it available throughout CloudStack.
zh_CN: **区域**:：选择你希望该模板在到哪个区域可用，或者选择所有区域使该模板在CloudStack中全部区域中可用。

en: **OS Type**: This helps CloudStack and the hypervisor perform certain operations and make assumptions that improve the performance of the guest. Select one of the following:
zh_CN: **操作系统类型*:：这有助于CloudStack和Hypervisor执行某些操作并假设可提高来宾虚拟机的性能。选择下列之一。

en: You should not choose an older version of the OS than the version in the image. For example, choosing CentOS 5.4 to support a CentOS 6.2 image will in general not work. In those cases you should choose Other.
zh_CN: 你不能选择比镜像版本老的OS版本。比如，选择CentOS 5.4来支持CentOS 6.2镜像通常来说是不工作的。在这种情况下，你应该选择其他。

en: **Hypervisor**: The supported hypervisors are listed. Select the desired one.
zh_CN: **Hypervisor**：列表中显示支持的hypervisors。选择想要的一个。

en: **Format**. The format of the template upload file, such as VHD or OVA.
zh_CN: **格式**。上传的模板文件的格式，如VHD或OVA。

en: **Extractable**. Choose Yes if the template is available for extraction. If this option is selected, end users can download a full image of a template.
zh_CN: **可提取**。如果模板可以被提取请选择是。如果选择了此选项，终端用户可以下载此模板的完全镜。

en: **Featured**. Choose Yes if you would like this template to be more prominent for users to select. The template will appear in the Featured Templates list. Only an administrator can make a template Featured.
zh_CN: **精选**: 。如果你想这个用户在选择这个模板时更明显则选择Yes。该模板将出现在精选模板列表中。只有管理员可以设置模板为精选。

en: Exporting Templates
zh_CN: 导出模板

en: End users and Administrators may export templates from the CloudStack. Navigate to the template in the UI and choose the Download function from the Actions menu.
zh_CN: 最终用户和管理员可以从CloudStack导出模板。导航到用户界面中的模板并选择动作菜单中的下载功能。

en: Creating a Linux Template
zh_CN: 创建Linux模板

en: Linux templates should be prepared using this documentation in order to prepare your linux VMs for template deployment. For ease of documentation, the VM which you are configuring the template on will be referred to as "Template Primary". This guide currently covers legacy setups which do not take advantage of UserData and cloud-init and assumes openssh-server is installed during installation.
zh_CN: 为了准备使用模板部署你的Linux VMs，可以使用此文档来准备Linux模板。对于文档中的情况，你要通过配置模板，这会涉及"主模板"。这个指导目前覆盖了传统的安装，但不会涉及用户数据和cloud-init还有假设在装过程中安装了openshh服务。

en: An overview of the procedure is as follow:
zh_CN: 过程概述如下：

en: Upload your Linux ISO.
zh_CN: 上传你的Linux ISO。

en: For more information, see `“Adding an ISO” <virtual_machines.html#adding-an-iso>`_.
zh_CN: 更多信息，请参阅 `“添加ISO” <virtual_machines.html#adding-an-iso>`_。

en: Create a VM Instance with this ISO.
zh_CN: 使用这个ISO创建VM实例。

en: For more information, see `“Creating VMs” <virtual_machines.html#creating-vms>`_.
zh_CN: 更多信息，请参阅 `“创建VMs” <virtual_machines.html#creating-vms>`_。

en: Prepare the Linux VM
zh_CN: 准备Linux VM

en: Create a template from the VM.
zh_CN: 从VM创建模板。

en: For more information, see `“Creating a Template from an Existing Virtual Machine” <#creating-a-template-from-an-existing-virtual-machine>`_.
zh_CN: 更多信息，请参阅 `“从已有的虚拟机创建模板” <#creating-a-template-from-an-existing-virtual-machine>`_。

en: System preparation for Linux
zh_CN: Linux的系统准备工作

en: The following steps will prepare a basic Linux installation for templating.
zh_CN: 下列步骤将会为模板准备一个基本的Linux安装。

en: **Installation**
zh_CN: **安装**

en: It is good practice to name your VM something generic during installation, this will ensure components such as LVM do not appear unique to a machine. It is recommended that the name of "localhost" is used for installation.
zh_CN: 通常在安装过程中给VM命名是一个好的做法，这么做能确保某些组件如LVM不会只在一台机器中出现。推荐在在安装过程中使用"localhost"命名。

en: For CentOS, it is necessary to take unique identification out of the interface configuration file, for this edit /etc/sysconfig/network-scripts/ifcfg-eth0 and change the content to the following.
zh_CN: 对于CentOS，必须要修改网络接口的配置文件，在这里我们编辑/etc/sysconfig/network-scripts/ifcfg-eth0文件，更改下面的内容。

en: The next steps updates the packages on the Template Primary.
zh_CN: 下一步更新主模板中的包。

en: **Password management**
zh_CN: **密码管理**

en: If preferred, custom users (such as ones created during the Ubuntu installation) should be removed. First ensure the root user account is enabled by giving it a password and then login as root to continue.
zh_CN: 如果需要，客户(如在Ubuntu的安装过程中创建的用户)应该被移除。首先确认root用户账户是启用的并且使用了密码，然后使用root登录。

en: As root, remove any custom user accounts created during the installation process.
zh_CN: 使用root，移除任何在安装过程中创建的自定义用户账户。

en: See :ref:`adding-password-management-to-templates` for instructions to setup the password management script, this will allow CloudStack to change your root password from the web interface.
zh_CN: 关于设置密码管理脚本的相关说明，请参阅 :ref:`adding-password-management-to-templates` ，这样能允许CloudStack通过web界面更改root密码。

en: **Hostname Management**
zh_CN: **主机名管理**

en: CentOS configures the hostname by default on boot. Unfortunately Ubuntu does not have this functionality, for Ubuntu installations use the following steps.
zh_CN: 默认情况下CentOS在启动的时候配置主机名。但是，Ubuntu却没有此功能，对于Ubuntu，安装时使用下面步骤。

en: The hostname of a Templated VM is set by a custom script in `/etc/dhcp/dhclient-exit-hooks.d`, this script first checks if the current hostname is localhost, if true, it will get the host-name, domain-name and fixed-ip from the DHCP lease file and use those values to set the hostname and append the `/etc/hosts` file for local hostname resolution. Once this script, or a user has changed the hostname from localhost, it will no longer adjust system files regardless of it's new hostname. The script also recreates openssh-server keys, which should have been deleted before templating (shown below). Save the following script to `/etc/dhcp/dhclient-exit-hooks.d/sethostname`, and adjust the permissions.
zh_CN: 一个模板化的VM使用`/etc/dhcp/dhclient-exit-hooks.d`中的一个自定义脚本来设置主机名，这个脚本首先检查当前的主机名是是否是hostname，如果是，它将从DHCP租约文件获取host-name，domain-name和fix-ip，并且使用这些值来设置主机名并将其追加到 `/etc/hosts` 文件以用来本地主机名解析。一旦这个脚本或者一个用户从本地改变了主机名，那么它将不再根据新的主机名调整系统文件。此脚本同样也会重建openssh-server keys，这个keys在做模板(如下所示)之前被删除了。保存下面的脚本到`/etc/dhcp/dhclient-exit-hooks.d/sethostname`，并且调整权限。

en: The following steps should be run when you are ready to template your Template Primary. If the Template Primary is rebooted during these steps you will have to run all the steps again. At the end of this process the Template Primary should be shutdown and the template created in order to create and deploy the final template.
zh_CN: 当你准备好做你的主模板的时候请运行下列步骤。如果主模板在这些步骤期间重启了，那么你要重新运行所有的步骤。在这个过程的最后，主模板应该关机并且将其创建为模板，然后再部署。

en: **Remove the udev persistent device rules**
zh_CN: **移除udev持久设备规则**

en: This step removes information unique to your Template Primary such as network MAC addresses, lease files and CD block devices, the files are automatically generated on next boot.
zh_CN: 这一步会移除你的主模板的特殊信息，如网络MAC地址，租约信息和CD块设备，这个文件会在下次启动时自动生成。

en: **Remove SSH Keys**
zh_CN: **移除SSH Keys**

en: This step is to ensure all your Templated VMs do not have the same SSH keys, which would decrease the security of the machines dramatically.
zh_CN: 这步是为了确认所有要作为模板的VMs的SSH Keys都不相同，否则这样会降低虚拟机的安全性。

en: **Cleaning log files**
zh_CN: **清除日志文件**

en: It is good practice to remove old logs from the Template Primary.
zh_CN: 从主模板移除旧的日志文件是一个好习惯。

en: **Setting hostname**
zh_CN: **设置主机名**

en: In order for the Ubuntu DHCP script to function and the CentOS dhclient to set the VM hostname they both require the Template Primary's hostname to be "localhost", run the following commands to change the hostname.
zh_CN: 为了Ubuntu DHCP的脚本功能和CentOS dhclient能设置VM主机名，他们都去要设置主模板的主机名设置为“localhost”，运行下面的命令来更改主机名。

en: **Set user password to expire**
zh_CN: **设置用户密码期限**

en: This step forces the user to change the password of the VM after the template has been deployed.
zh_CN: 这步是要在模板部署之后强制用户更改VM的密码。

en: **Clearing User History**
zh_CN: **清除用户历史**

en: The next step clears the bash commands you have just run.
zh_CN: 下一步来清除你曾经运行过的bash命令。

en: **Shutdown the VM**
zh_CN: **关闭VM**

en: Your now ready to shutdown your Template Primary and create a template!
zh_CN: 现在你可以关闭你的主模板并且创建模板了！

en: **Create the template!**
zh_CN: **创建模板！**

en: You are now ready to create the template, for more information see `“Creating a Template from an Existing Virtual Machine” <#creating-a-template-from-an-existing-virtual-machine>`_.
zh_CN: 现在你可以创建模板了，更多信息请参阅 `“从已存在的虚拟机创建模板” <#creating-a-template-from-an-existing-virtual-machine>`_。

en: Templated VMs for both Ubuntu and CentOS may require a reboot after provisioning in order to pickup the hostname.
zh_CN: 通过Ubuntu和CentOS的模板分发的虚机可能需要重启才让主机名生效。

en: Creating a Windows Template
zh_CN: 创建Windows模板

en: Windows templates must be prepared with Sysprep before they can be provisioned on multiple machines. Sysprep allows you to create a generic Windows template and avoid any possible SID conflicts.
zh_CN: Windows模板在分发多个虚拟机的之前必须使用Sysprep初始化。Sysprep允许你创建一个通用的Windows模板和避免任何可能的SID冲突。

en: (XenServer) Windows VMs running on XenServer require PV drivers, which may be provided in the template or added after the VM is created. The PV drivers are necessary for essential management functions such as mounting additional volumes and ISO images, live migration, and graceful shutdown.
zh_CN: (XenServer)XXenServer上运行的Windows VMs需要安装PV驱动，它可能在模板中或在创建完VM后添加。PV驱动对于基本的管理功能是必要的，比如挂载额外的卷和ISO镜像、在线迁移和正常关机。

en: An overview of the procedure is as follows:
zh_CN: 过程概述如下：

en: Upload your Windows ISO.
zh_CN: 上传你的Windows ISO。

en: Follow the steps in Sysprep for Windows Server 2008 R2 (below) or Sysprep for Windows Server 2003 R2, depending on your version of Windows Server
zh_CN: 按照你所使用的WIndows Server版本进行Windows Server 2008 R2(下面的)或者Windows Server 2003 R2中Sysprep的操作步骤。

en: The preparation steps are complete. Now you can actually create the template as described in Creating the Windows Template.
zh_CN: 准本工作完成了。现在你可以按照创建Windows模板中描述的来创建模板。

en: System Preparation for Windows Server 2008 R2
zh_CN: 为Windows Server 2008 R2进行系统准备

en: For Windows 2008 R2, you run Windows System Image Manager to create a custom sysprep response XML file. Windows System Image Manager is installed as part of the Windows Automated Installation Kit (AIK). Windows AIK can be downloaded from `Microsoft Download Center <http://www.microsoft.com/en-us/download/details.aspx?id=9085>`_.
zh_CN: 对于Windows 2008 R2，你运行Windows系统镜像管理来创建一个自定义的sysprep应答XML文件。Windows系统镜像管理作为Windows Automated Installation Kit (AIK)的一部分安装在系统中。Windows AIK可以从 `微软下载中心 <http://www.microsoft.com/en-us/download/details.aspx?id=9085>`_下载到。

en: Use the following steps to run sysprep for Windows 2008 R2:
zh_CN: 按照以下步骤运行Windows 2008 R2的sysprep：

en: The steps outlined here are derived from the excellent guide by Charity Shelbourne, originally published at `Windows Server 2008 Sysprep Mini-Setup. <http://blogs.technet.com/askcore/archive/2008/10/31/automating-the-oobe-process-during-windows-server-2008-sysprep-mini-setup.aspx>`_
zh_CN: 这些步骤的概述来源于Charity Shelbourne一个非常棒的指导，发布在 `Windows Server 2008 Sysprep Mini-Setup. <http://blogs.technet.com/askcore/archive/2008/10/31/automating-the-oobe-process-during-windows-server-2008-sysprep-mini-setup.aspx>`_。

en: Download and install the Windows AIK
zh_CN: 下载和安装Windows AIK

en: Windows AIK should not be installed on the Windows 2008 R2 VM you just created. Windows AIK should not be part of the template you create. It is only used to create the sysprep answer file.
zh_CN: 刚刚创建的Windows 2008 R2上面并没有安装Windows AIK。Windows AIK不是你创建的模板中的一部分。它仅仅用于创建sysprep应答文件。

en: Copy the install.wim file in the \\sources directory of the Windows 2008 R2 installation DVD to the hard disk. This is a very large file and may take a long time to copy. Windows AIK requires the WIM file to be writable.
zh_CN: 在\\Windows 2008 R2安装DVD中的源目录复制install.wim文件到本地硬盘。这是一个非常大的文件可能会复制较长时间。Windows AIK要求WIM文件是可写的。

en: Start the Windows System Image Manager, which is part of the Windows AIK.
zh_CN: 打开Windows系统镜像管理器。

en: In the Windows Image pane, right click the Select a Windows image or catalog file option to load the install.wim file you just copied.
zh_CN: 在Windows镜像面板，右击选择一个Windows镜像或编录文件选项来读取你刚刚复制的install.wim文件。

en: Select the Windows 2008 R2 Edition.
zh_CN: 选择Windows 2008 R2版本。

en: You may be prompted with a warning that the catalog file cannot be opened. Click Yes to create a new catalog file.
zh_CN: 你可能会收到一个警告提示说不能打开编录文件。点击是来创建一个新的编录文件。

en: In the Answer File pane, right click to create a new answer file.
zh_CN: 在应答文件面板，右击来创建一个新的应答文件。

en: Generate the answer file from the Windows System Image Manager using the following steps:
zh_CN: 使用以下步骤从Windows系统镜像管理器生成应答文件：

en: The first page you need to automate is the Language and Country or Region Selection page. To automate this, expand Components in your Windows Image pane, right-click and add the Microsoft-Windows-International-Core setting to Pass 7 oobeSystem. In your Answer File pane, configure the InputLocale, SystemLocale, UILanguage, and UserLocale with the appropriate settings for your language and country or region. Should you have a question about any of these settings, you can right-click on the specific setting and select Help. This will open the appropriate CHM help file with more information, including examples on the setting you are attempting to configure.
zh_CN: 第一个页面你必须让语言和国家或位置选择页面是自动的。要使这个自动化，请在你的Windows 镜像面板扩展组件，右击Microsoft-Windows-International-Core添加设置以传送 7 oobeSystem。在你的应答文件面板中，为语言和国家或位置用适当的设置配置InputLocale、SystemLocale、UILanguage、和UserLocale。你可能对这些设置有疑问，你可以指定一个设置右击选择帮助。这将打开对应的CHM帮助文件，这里面包括了与你尝试配置的设置相关的一些示例。

en: You need to automate the Software License Terms Selection page, otherwise known as the End-User License Agreement (EULA). To do this, expand the Microsoft-Windows-Shell-Setup component. High-light the OOBE setting, and add the setting to the Pass 7 oobeSystem. In Settings, set HideEULAPage true.
zh_CN: 你需要将软件授权选择页配置为自动进行，这不是众所周知的EULA。为此，展开Microsoft-Windows-Shell-Setup组件，选中OOBE 设置，将此设置加入到Pass 7 oobeSystem中去。在设置中，将HideEULAPage 设置为true。

en: Make sure the license key is properly set. If you use MAK key, you can just enter the MAK key on the Windows 2008 R2 VM. You need not input the MAK into the Windows System Image Manager. If you use KMS host for activation you need not enter the Product Key. Details of Windows Volume Activation can be found at `http://technet.microsoft.com/en-us/library/bb892849.aspx <http://technet.microsoft.com/en-us/library/bb892849.aspx>`_
zh_CN: 确保恰当的设置了序列号。如果使用MAK的话，可以在Windows2008R2的虚拟机上输入MAK。并不需要将MAK输入到Windows映像管理器中。如果你使用KMS主机进行激活，则不需要输入产品序列号。Windows卷激活的详细信息可以在http://technet.microsoft.com/en-us/library/bb892849.aspx 上查看。

en: You need to automate is the Change Administrator Password page. Expand the Microsoft-Windows-Shell-Setup component (if it is not still expanded), expand UserAccounts, right-click on AdministratorPassword, and add the setting to the Pass 7 oobeSystem configuration pass of your answer file. Under Settings, specify a password next to Value.
zh_CN: 类似机械化的操作还有更改管理员密码页。展开Microsoft-Windows-Shell-Setup组件（如果没有展开的话），展开用户账户，右键点击管理员密码，添加设置到Pass 7 oobeSystem配置，在设置中，指定一个密码。

en: You may read the AIK documentation and set many more options that suit your deployment. The steps above are the minimum needed to make Windows unattended setup work.
zh_CN: 可能会需要阅读AIK文档并设置多个选项来适合你的部署。以上的步骤至少需要使windows脱离建立网络的过程。

en: Save the answer file as unattend.xml. You can ignore the warning messages that appear in the validation window.
zh_CN: 将答案文件保存为unattend.xml，可以忽略验证窗口中的警告信息。

en: Copy the unattend.xml file into the c:\\windows\\system32\\sysprep directory of the Windows 2008 R2 Virtual Machine
zh_CN: 将unattend.xml文件拷贝到Windows 2008 R2 虚拟机的c:\\windows\\system32\\sysprep 文件夹下，

en: Once you place the unattend.xml file in c:\\windows\\system32\\sysprep directory, you run the sysprep tool as follows:
zh_CN: 一旦将unattend.xml文件放到 c:\\windows\\system32\\sysprep文件夹下，则按以下步骤运行sysprep工具：

en: The Windows 2008 R2 VM will automatically shut down after sysprep is complete.
zh_CN: Windows 2008 R2虚拟机在sysprep完成后，会自动关闭。

en: System Preparation for Windows Server 2003 R2
zh_CN: 针对Windows Server 2003R2的系统准备

en: Earlier versions of Windows have a different sysprep tool. Follow these steps for Windows Server 2003 R2.
zh_CN: 早期的windows版本有个不同的sysprep的工具，按照这些步骤准备Windows Server 2003 R2。

en: Extract the content of \\support\\tools\\deploy.cab on the Windows installation CD into a directory called c:\\sysprep on the Windows 2003 R2 VM.
zh_CN: 从Windows 安装CD中提取\\support\\tools\\deploy.cab到WIndows 2003 R2 虚拟机中的此目录 c:\\sysprep。

en: Run c:\\sysprep\\setupmgr.exe to create the sysprep.inf file.
zh_CN: 运行 c:\\sysprep\\setupmgr.exe 来创建syprep.inf文件。

en: Select Create New to create a new Answer File.
zh_CN: 选择创建新的来创建一个新的应答文件。

en: Enter “Sysprep setup” for the Type of Setup.
zh_CN: 安装的类型选择 “Sysprep 安装”

en: Select the appropriate OS version and edition.
zh_CN: 选择合适的OS版本

en: On the License Agreement screen, select “Yes fully automate the installation”.
zh_CN: 在许可协议界面，选择"是，完全自动安装"

en: Provide your name and organization.
zh_CN: 提供你的名称和组织。

en: Leave display settings at default.
zh_CN: 保留显示设置为默认。

en: Set the appropriate time zone.
zh_CN: 设置合适的时区。

en: Provide your product key.
zh_CN: 提供你的产品key。

en: Select an appropriate license mode for your deployment
zh_CN: 给你的部署选择一个合适的许可模式。

en: Select “Automatically generate computer name”.
zh_CN: 选择"自动生成计算机名"。

en: Type a default administrator password. If you enable the password reset feature, the users will not actually use this password. This password will be reset by the instance manager after the guest boots up.
zh_CN: 输入一个默认的管理员密码。如果你启用了密码重置功能，用户实际上将不会使用这个密码。在来宾虚机启动之后实例管理器会重置密码。

en: Leave Network Components at “Typical Settings”.
zh_CN: 网络组件使用"典型设置"。

en: Select the “WORKGROUP” option.
zh_CN: 选择“WORKGROUP”选项。

en: Leave Telephony options at default.
zh_CN: 电话服务使用默认。

en: Select appropriate Regional Settings.
zh_CN: 选择合适的区域设置。

en: Select appropriate language settings.
zh_CN: 选择合适的语言选项。

en: Do not install printers.
zh_CN: 不要安装打印机。

en: Do not specify “Run Once commands”.
zh_CN: 不要指定"运行一次"。

en: You need not specify an identification string.
zh_CN: 你不必指定标示字符串。

en: Save the Answer File as c:\\sysprep\\sysprep.inf.
zh_CN: 将应答文件保存到c:\\sysprep\\sysprep.inf。

en: Run the following command to sysprep the image:
zh_CN: 运行以下命令行来sysprep镜像：

en: After this step the machine will automatically shut down
zh_CN: 在这个步骤之后，虚拟机会自动关机。

en: Importing Amazon Machine Images
zh_CN: 导入Amazon Machine Images

en: The following procedures describe how to import an Amazon Machine Image (AMI) into CloudStack when using the XenServer hypervisor.
zh_CN: 以下过程描述了当使用XenServer hypervisor时，如何导入一个AMI到Cloudstack中。

en: Assume you have an AMI file and this file is called CentOS\_6.2\_x64. Assume further that you are working on a CentOS host. If the AMI is a Fedora image, you need to be working on a Fedora host initially.
zh_CN: 假定你有一个叫做CentOS\_6.2|_x64的AMI文件。假定未来你将工作在CentOS主机上。如果AMI是一个Fedora镜像，你需要将它立即安装到Fedora主机上。

en: You need to have a XenServer host with a file-based storage repository (either a local ext3 SR or an NFS SR) to convert to a VHD once the image file has been customized on the Centos/Fedora host.
zh_CN: 一旦镜像文件在CentOS/Fedora主机上自定义完毕，你必须有一台使用文件存储库(本地ext3 SR或者NFS SP)的XenServer主机将其转换VHD。

en: When copying and pasting a command, be sure the command has pasted as a single line before executing. Some document viewers may introduce unwanted line breaks in copied text.
zh_CN: 当复制和粘贴命令时，请确保没有多余的换行符，因为一些文档查看器可能会在复制时加上换行符。

en: To import an AMI:
zh_CN: 导入一个AMI:

en: Set up loopback on image file:
zh_CN: 建立在镜像文件上的回滚

en: Install the kernel-xen package into the image. This downloads the PV kernel and ramdisk to the image.
zh_CN: 安装kernel-xen包到镜像文件中。下载PV内核和ramdisk到镜像中。

en: Create a grub entry in /boot/grub/grub.conf.
zh_CN: 在 /boot/grub/grub.conf中创建一个引导。

en: Determine the name of the PV kernel that has been installed into the image.
zh_CN: 终止已经安装到镜像文件中的PV内核名称

en: Xen kernels/ramdisk always end with "xen". For the kernel version you choose, there has to be an entry for that version under lib/modules, there has to be an initrd and vmlinuz corresponding to that. Above, the only kernel that satisfies this condition is 2.6.18-164.15.1.el5xen.
zh_CN: Xen的kernels/ramdisk通常以“xen"结尾。在lib/modules中选择相应的内核版本，intrd和vmlinuz将作出相应的反应.综上，唯一要求的条件是版本为2.6.18-164.15.1.el5xen。

en: Based on your findings, create an entry in the grub.conf file. Below is an example entry.
zh_CN: 根据你要找的内容，在grub.conf文件中创建一个入口。以下为入口例子。

en: Edit etc/fstab, changing “sda1” to “xvda” and changing “sdb” to “xvdb”.
zh_CN: 编辑 etc/fstab,将”sda1“改为”xvda"并将“sdb"改为”xbdb".

en: Enable login via the console. The default console device in a XenServer system is xvc0. Ensure that etc/inittab and etc/securetty have the following lines respectively:
zh_CN: 通过终端开启登陆。在默认终端设备XenServer系统上的是xvc0.确定在etc/inittab和etc/securetty中有以下各自的行：

en: Ensure the ramdisk supports PV disk and PV network. Customize this for the kernel version you have determined above.
zh_CN: 确保虚拟盘支持PV磁盘和PV网络。为你之前选择好的kernel版本自定义这些。

en: Change the password.
zh_CN: 修改密码

en: Exit out of chroot.
zh_CN: 退出chroot

en: Check `etc/ssh/sshd_config` for lines allowing ssh login using a password.
zh_CN: 检查 `etc/ssh/sshd_config`中关于允许在ssh登录时使用密码的相关行。

en: If you need the template to be enabled to reset passwords from the CloudStack UI or API, install the password change script into the image at this point. See :ref:`adding-password-management-to-templates`.
zh_CN: 如果你需要通过CloudStack· UI或API启用重置模板的密码功能，在镜像中安装密码更改脚本。相关内容请参考:ref:`adding-password-management-to-templates`。

en: Unmount and delete loopback mount.
zh_CN: 卸载或删除loopback挂载。

en: Copy the image file to your XenServer host's file-based storage repository. In the example below, the Xenserver is "xenhost". This XenServer has an NFS repository whose uuid is a9c5b8c8-536b-a193-a6dc-51af3e5ff799.
zh_CN: 复制镜像文件到XenServer主机的文件存储库。在下面的例子中，XenServer是"xenhost"。这个XenServer有一个UUID为a9c5b8c8-536b-a193-a6dc-51af3e5ff799的NFS库。

en: Log in to the Xenserver and create a VDI the same size as the image.
zh_CN: 登录到XenServer然后创建一个与镜像同样大小的VDI。

en: Import the image file into the VDI. This may take 10–20 minutes.
zh_CN: 将镜像导入到VDI中。这可能会花费10-20分钟。

en: Locate a the VHD file. This is the file with the VDI’s UUID as its name. Compress it and upload it to your web server.
zh_CN: 找到这个VHD文件。它的名字是以VDI的UUID命名的。压缩并上床至你的web服务器。

en: Converting a Hyper-V VM to a Template
zh_CN: 将Hyper-V的VM转换为模板

en: To convert a Hyper-V VM to a XenServer-compatible CloudStack template, you will need a standalone XenServer host with an attached NFS VHD SR. Use whatever XenServer version you are using with CloudStack, but use XenCenter 5.6 FP1 or SP2 (it is backwards compatible to 5.6). Additionally, it may help to have an attached NFS ISO SR.
zh_CN: 要转换Hyper-V的VM到兼容XenServer的CloudStack模板，你需要一个独立的添加了NFS VHD SR的XenServer主机。无论使用CloudStack管理哪个版本XenServer，但必须是XenCenter 5.6 FP1或SP2(它向下兼容5.6)。另外，添加了NFS ISO SR是有帮助的。

en: For Linux VMs, you may need to do some preparation in Hyper-V before trying to get the VM to work in XenServer. Clone the VM and work on the clone if you still want to use the VM in Hyper-V. Uninstall Hyper-V Integration Components and check for any references to device names in /etc/fstab:
zh_CN: 对于Linux VMs，在尝试让VM在XenServer中工作之前你可能必须在Hyper-V做一些准备工作。如果你仍然想要在Hyper-V中使用这个VM的话，克隆这个VM然后在克隆的虚机上操作。卸载Hyper-V集成组件然后检查任何/etc/fstab中涉及的相关设备名称：

en: From the linux\_ic/drivers/dist directory, run make uninstall (where "linux\_ic" is the path to the copied Hyper-V Integration Components files).
zh_CN: 从 linux\_ic/drivers/dist 目录中，运行make uninstall("linux\_ic" 是复制的Hyper-V集成组件的路径)。

en: Restore the original initrd from backup in /boot/ (the backup is named \*.backup0).
zh_CN: 从备份/boot/ 恢复原始的文件系统(备份名称为 \*.backup0)。

en: Remove the "hdX=noprobe" entries from /boot/grub/menu.lst.
zh_CN: 从 /boot/grub/menu.lst移除 "hdX=noprobe" 。

en: Check /etc/fstab for any partitions mounted by device name. Change those entries (if any) to mount by LABEL or UUID. You can get that information with the blkid command.
zh_CN: 通过名称从 /etc/fstab中检查任何挂载的分区。将这些条目(如果有)改成使用LABEL或者UUID挂载。你能通过 blkid命令获得这些信息。

en: The next step is make sure the VM is not running in Hyper-V, then get the VHD into XenServer. There are two options for doing this.
zh_CN: 下一步请确保Hyper-V中的这个VM没有运行，然后把VHD送至XenServer。有两个选择。

en: Option one:
zh_CN: 选项一：

en: Import the VHD using XenCenter. In XenCenter, go to Tools>Virtual Appliance Tools>Disk Image Import.
zh_CN: 使用XenCenter导入VHD。在XenCenter中，找到Tools>Virtual Appliance Tools>Disk Image Import。

en: Choose the VHD, then click Next.
zh_CN: 选择VHD，然后点击下一步。

en: Name the VM, choose the NFS VHD SR under Storage, enable "Run Operating System Fixups" and choose the NFS ISO SR.
zh_CN: 给VM起个名字，在Storage下选择 NFS VHD SR，启用"Run Operating System Fixups" 然后选择NFS ISO SR。

en: Click Next, then Finish. A VM should be created.
zh_CN: 点击下一步 完成。完成虚拟机创建。

en: Option two:
zh_CN: 选项二：

en: Run XenConvert, under From choose VHD, under To choose XenServer. Click Next.
zh_CN: 运行 XenConvert ,选择 VHD,选择 XenServer,点击下一步。

en: Input the XenServer host info, then click Next.
zh_CN: 输入XenServer主机信息，点击下一步。

en: Name the VM, then click Next, then Convert. A VM should be created.
zh_CN: 输入VM名称，点击“下一步”，点击“转换”。VM应该就创建了。

en: Once you have a VM created from the Hyper-V VHD, prepare it using the following steps:
zh_CN: 一旦你完成从hyper-v VHD到虚拟机的创建，准备使用以下步骤：

en: Boot the VM, uninstall Hyper-V Integration Services, and reboot.
zh_CN: 启动虚拟机，卸载Hyper-V集成服务，并重新启动。

en: Install XenServer Tools, then reboot.
zh_CN: 安装XenServer Tools，然后重新启动。

en: Prepare the VM as desired. For example, run sysprep on Windows VMs. See `“Creating a Windows Template” <#creating-a-windows-template>`_.
zh_CN: 按需要准备VM。例如在Windows VM上执行sysprep。请参阅 `“创建Windows模板” <#creating-a-windows-template>`_。

en: Either option above will create a VM in HVM mode. This is fine for Windows VMs, but Linux VMs may not perform optimally. Converting a Linux VM to PV mode will require additional steps and will vary by distribution.
zh_CN: 以上任一选项将在HVM模式下创建一个VM。对于Windows虚拟机来说这是很好的，但Linux的虚拟机可能无法达到最佳性能。要转换Linux虚拟机到PV模式，对于不同的发行版本将需要额外的步骤。

en: Shut down the VM and copy the VHD from the NFS storage to a web server; for example, mount the NFS share on the web server and copy it, or from the XenServer host use sftp or scp to upload it to the web server.
zh_CN: 关闭虚拟机，从NFS存储拷贝VHD到一个web服务器；比如，在web服务器上挂载NFS共享然后拷贝它，或者是在XenServer主机上用sftp或scp将VHD上传到web服务器。

en: In CloudStack, create a new template using the following values:
zh_CN: 在 CloudStack中，使用以下值创建一个新的模板：

en: URL. Give the URL for the VHD
zh_CN: URL。给VHD指定URL。

en: OS Type. Use the appropriate OS. For PV mode on CentOS, choose Other PV (32-bit) or Other PV (64-bit). This choice is available only for XenServer.
zh_CN: OS类型。使用适当的OS。对于CentOS的PV模式来说，选择其他PV (32位)或其他PV(64位)。这个选项仅适用于XenServer。

en: Hypervisor. XenServer
zh_CN: Hypervisor。XenServer

en: Format. VHD
zh_CN: 格式。VHD

en: The template will be created, and you can create instances from it.
zh_CN: 模板就创建好了，然后你可以通过它创建实例。

en: Adding Password Management to Your Templates
zh_CN: 给你的模板添加密码管理

en: CloudStack provides an optional password reset feature that allows users to set a temporary admin or root password as well as reset the existing admin or root password from the CloudStack UI.
zh_CN: CloudStack提供了可选的密码重置功能，该功能允许用户在CloudStack UI上设置临时的admin或root密码，也可以重置现有的admin或root密码。

en: To enable the Reset Password feature, you will need to download an additional script to patch your template. When you later upload the template into CloudStack, you can specify whether reset admin/root password feature should be enabled for this template.
zh_CN: 为启用密码重置功能，您需要下载额外的脚本到模版上。当您之后在CloudStack中添加模版时，您可以指定该模版是否启用重置admin或root密码的功能。

en: The password management feature works always resets the account password on instance boot. The script does an HTTP call to the virtual router to retrieve the account password that should be set. As long as the virtual router is accessible the guest will have access to the account password that should be used. When the user requests a password reset the management server generates and sends a new password to the virtual router for the account. Thus an instance reboot is necessary to effect any password changes.
zh_CN: 密码管理功能总是在虚机启动时重置账号的密码。该脚本通过对虚拟路由器的HTTP调用，获取需要重置的账号密码。启动时，只要虚拟路由器可以访问，虚机就可以获得应该设置的账号密码。当用户请求密码重置时，管理服务器会生成新密码，并发送到虚拟路由器。因而，虚机需要重启新密码才能生效。

en: If the script is unable to contact the virtual router during instance boot it will not set the password but boot will continue normally.
zh_CN: 在虚机重启时，如果脚本不能连接到虚拟路由器，则密码不会被重置，但启动过程还会继续正常执行。

en: Linux OS Installation
zh_CN: Linux系统安装

en: Use the following steps to begin the Linux OS installation:
zh_CN: 使用一下步骤开始Linux系统的安装：

en: Download the script file cloud-set-guest-password:
zh_CN: 下载cloud-set-guest-password脚本文件：

en: Copy this file to /etc/init.d.
zh_CN: 拷贝本文件到 /etc/init.d 。

en: On some Linux distributions, copy the file to ``/etc/rc.d/init.d``.
zh_CN: 在某些linux发行版拷贝此文件到 ``/etc/rc.d/init.d``。

en: Run the following command to make the script executable:
zh_CN: 执行以下命令使脚本可执行：

en: Depending on the Linux distribution, continue with the appropriate step.
zh_CN: 根据不同的Linux发行版，选择适当的步骤继续。

en: On Fedora, CentOS/RHEL, and Debian, run:
zh_CN: 在Fedora,CentOS/RHEL和Debian上运行：

en: Windows OS Installation
zh_CN: Windows OS 安装

en: Download the installer, CloudInstanceManager.msi, from the `Download page <http://sourceforge.net/projects/cloudstack/files/Password%20Management%20Scripts/CloudInstanceManager.msi/download>`_ and run the installer in the newly created Windows VM.
zh_CN: 从`下载页<http://sourceforge.net/projects/cloudstack/files/Password%20Management%20Scripts/CloudInstanceManager.msi/download>`_ 下载安装程序CloudInstanceManager.msi，并在新创建的Windows 虚拟机中运行安装程序。

en: Deleting Templates
zh_CN: 删除模板

en: Templates may be deleted. In general, when a template spans multiple Zones, only the copy that is selected for deletion will be deleted; the same template in other Zones will not be deleted. The provided CentOS template is an exception to this. If the provided CentOS template is deleted, it will be deleted from all Zones.
zh_CN: 模板可以被删除。在一般情况下，当一个模板跨越多个区域，只有被选中的副本才会被删除，在其他区域相同的模板将不会被删除。CentOS的模板是一个例外。如果所提供的CentOS的模板被删除，它从所有区域都将被删除。

en: When templates are deleted, the VMs instantiated from them will continue to run. However, new VMs cannot be created based on the deleted template.
zh_CN: 当删除模板时，从它们中产生的虚拟机实例将继续运行。然而，新的虚拟机不能在被删除模板的基础上创建。
