source/adminguide/locale/zh_CN/LC_MESSAGES/templates.mo (19 lines of code) (raw):

���|��#�2�K��G��MaYrZ��'�����6!+5a���*����,8A*z+�Q��#Y�J@g���K�`J  U v0�0���������� #4!%X!�~!�U"s2#�##�#,�#$�5$�$�$#�$4%I%e%Hx%K�% &'&&$N&�s&2k'i�'W(�`(�7)��)t�*0�*(+<+�P+��+�t,#8-J\.��/W10U�0��0sp1 �1��1��2Y]3�3��3=�4?�4�5��5(V6�7�M8� 9d�9B:X:@x:��:A�;��;,X</�<%�<e�<�A=@ >ta>3�># ?".?Q?�g?x�@DlAJ�A��Aq�CCD�`D(�DCERaEV�Eh FvtF �F �FG�G�Go�G2H#IHmH:�H�HS�HM1I=I8�I/�I1&JoXJ��J.�K6�K%�K%L#7L.[L"�L2�L�L�L�Mi�MI[O �O-�O-�OPq+P��PCHQ�RN�Rv�R�gS��UC�VK�W�X��Z9x[��[;6\r\{v^9�^,_CH`U�`��``�a�b��bKMc��d�e�e��e�f�f"�f�f�fg;g;WgL�gG�g`(h��j�8k��k�l��ldm{m��nrMo��o.fpS�p(�q�s��sF�t��t�u�u�u�u��u��w�x�x�x��x�ry=$zbzOvz �zZ�zZ,{��{�|��|>}�O}~ 1~R~o~ �~l�~��~��v8�!��3р��L1��~�]4���@����� x����U,�$�� ��*��1����(�� �����d�����3���h��"� 3�0T���q�� ��!1�'S�{� ��>��5ۋ�*�H��c�-P�i~�H��1��%����a8�*�� Ő Ґrߐ�R��ۑ-w�K����T��S֕~*�t�� �t+����FS������Ea�<�����l��������}`�eޝ;D���>���۞B��|ן'T�0|�-��O۠�+�9�c�#����¢�5�g)�B��NԤ\#�r��U��I�*اA�8E�P~�uϨwE� �� ʩש��i�K��Ѫ��/�O�J_�A��=�'*�(R�3{�T����6��3��6�U�t���#��Ϯ!�� �Eϯ%� ;�*G�+r���W���� �� ��@��W�2Y�`����>��)�u׺4M�f��$���^��3��2�?:�Bz����Az�w���4����������������� ������ ��/�44�Wi�<��E���D�����Z����� ��������o(����!'�I��M��M����<�����v�������(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.**Cleaning log files****Clearing User History****Create the template!****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.**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.**Format**. The format of the template upload file, such as VHD or OVA.**Hostname Management****Hypervisor**: The supported hypervisors are listed. Select the desired one.**Installation****Name and Description**. These will be shown in the UI, so choose something descriptive.**Name and Display Text**. These will be shown in the UI, so choose something descriptive.**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.**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:**Password Enabled**. Choose Yes if your template has the CloudStack password change script installed. See :ref:`adding-password-management-to-templates`.**Password management****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>`_.**Remove SSH Keys****Remove the udev persistent device rules****Set user password to expire****Setting hostname****Shutdown the VM****URL**. The Management Server will download the file from the specified URL, such as ``http://my.web.server/filename.vhd.gz``.**Zone**. Choose the zone where you want the template to be available, or All Zones to make it available throughout CloudStack.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.A template is a reusable configuration for virtual machines. When users launch VMs, they can choose from a list of templates in CloudStack.Adding Password Management to Your TemplatesAfter this step the machine will automatically shut downAn overview of the procedure is as follow:An overview of the procedure is as follows:As root, remove any custom user accounts created during the installation process.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.Based on your findings, create an entry in the grub.conf file. Below is an example entry.Best Practices for TemplatesBoot the VM, uninstall Hyper-V Integration Services, and reboot.CentOSCentOS configures the hostname by default on boot. Unfortunately Ubuntu does not have this functionality, for Ubuntu installations use the following steps.Change the password.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.Check `etc/ssh/sshd_config` for lines allowing ssh login using a password.Choose the VHD, then click Next.Click Add.Click Create Template and provide the following:Click Next, then Finish. A VM should be created.Click Register Template.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.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.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: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.Convert the volume into a template.Converting a Hyper-V VM to a TemplateCopy 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.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.Copy the unattend.xml file into the c:\\windows\\system32\\sysprep directory of the Windows 2008 R2 Virtual MachineCopy this file to /etc/init.d.Create a VM Instance with this ISO.Create a grub entry in /boot/grub/grub.conf.Create a template from the VM.Create and start a virtual machine using any of the techniques given in `“Creating VMs” <virtual_machines.html#creating-vms>`_.Creating Templates: OverviewCreating a Linux TemplateCreating a Template from a SnapshotCreating a Template from an Existing Virtual MachineCreating a Windows TemplateDeleting TemplatesDepending on the Linux distribution, continue with the appropriate step.Determine the name of the PV kernel that has been installed into the image.Do not install printers.Do not specify “Run Once commands”.Download and install the Windows AIKDownload 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.Download the script file cloud-set-guest-password:Earlier versions of Windows have a different sysprep tool. Follow these steps for Windows Server 2003 R2.Edit etc/fstab, changing “sda1” to “xvda” and changing “sdb” to “xvdb”.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.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: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.Ensure the ramdisk supports PV disk and PV network. Customize this for the kernel version you have determined above.Enter “Sysprep setup” for the Type of Setup.Exit out of chroot.Exporting TemplatesExtract the content of \\support\\tools\\deploy.cab on the Windows installation CD into a directory called c:\\sysprep on the Windows 2003 R2 VM.Follow the steps in Sysprep for Windows Server 2008 R2 (below) or Sysprep for Windows Server 2003 R2, depending on your version of Windows ServerFor 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.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: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>`_.For XenServer, install PV drivers / Xen tools on each template that you create. This will enable live migration and clean guest shutdown.For more information, see `“Adding an ISO” <virtual_machines.html#adding-an-iso>`_.For more information, see `“Creating VMs” <virtual_machines.html#creating-vms>`_.For more information, see `“Creating a Template from an Existing Virtual Machine” <#creating-a-template-from-an-existing-virtual-machine>`_.For vSphere, install VMware Tools on each template that you create. This will enable console view to work properly.Format. VHDFrom the linux\_ic/drivers/dist directory, run make uninstall (where "linux\_ic" is the path to the copied Hyper-V Integration Components files).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.Generate the answer file from the Windows System Image Manager using the following steps:Hypervisor. XenServerIf 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.If the OS type of the stopped VM is not listed, choose Other.If the operating system of the stopped VM is listed, choose it.If the script is unable to contact the virtual router during instance boot it will not set the password but boot will continue normally.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.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.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`.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.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:Import the VHD using XenCenter. In XenCenter, go to Tools>Virtual Appliance Tools>Disk Image Import.Import the image file into the VDI. This may take 10–20 minutes.Importing Amazon Machine ImagesIn CloudStack, create a new template using the following values:In order for the Ubuntu DHCP script to function and the CentOS dhclient to set the VM hostname they both require the Template Master's hostname to be "localhost", run the following commands to change the hostname.In the Answer File pane, right click to create a new answer file.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.In the left navigation bar, click Templates.Input the XenServer host info, then click Next.Install XenServer Tools, then reboot.Install the kernel-xen package into the image. This downloads the PV kernel and ramdisk to the image.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.It is good practice to remove old logs from the Template Master.Launch a VM instance that has the operating system you want. Make any other desired configuration changes to the VM.Leave Network Components at “Typical Settings”.Leave Telephony options at default.Leave display settings at default.Linux OS InstallationLinux 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 Master". This guide currently covers legacy setups which do not take advantage of UserData and cloud-init and assumes openssh-server is installed during installation.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.Log in to the Xenserver and create a VDI the same size as the image.Make any desired configuration changes on the running VM, then click Stop.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>`_Name the VM, choose the NFS VHD SR under Storage, enable "Run Operating System Fixups" and choose the NFS ISO SR.Name the VM, then click Next, then Convert. A VM should be created.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.On Fedora, CentOS/RHEL, and Debian, run:On some Linux distributions, copy the file to ``/etc/rc.d/init.d``.On the License Agreement screen, select “Yes fully automate the installation”.Once you have a VM created from the Hyper-V VHD, prepare it using the following steps:Once you have at least one VM set up in the way you want, you can use it as the prototype for other VMs.Once you place the unattend.xml file in c:\\windows\\system32\\sysprep directory, you run the sysprep tool as follows:Option one:Option two:Prepare the Linux VMPrepare the VM as desired. For example, run sysprep on Windows VMs. See `“Creating a Windows Template” <#creating-a-windows-template>`_.Private and Public TemplatesPrivate templates are only available to the user who created them. By default, an uploaded template is private.Provide the following:Provide your name and organization.Provide your product key.Remove the "hdX=noprobe" entries from /boot/grub/menu.lst.Requirements for TemplatesRestore the original initrd from backup in /boot/ (the backup is named \*.backup0).Run XenConvert, under From choose VHD, under To choose XenServer. Click Next.Run c:\\sysprep\\setupmgr.exe to create the sysprep.inf file.Run the following command to make the script executable:Run the following command to sysprep the image:Save the Answer File as c:\\sysprep\\sysprep.inf.Save the answer file as unattend.xml. You can ignore the warning messages that appear in the validation window.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.Select Create New to create a new Answer File.Select an appropriate license mode for your deploymentSelect appropriate Regional Settings.Select appropriate language settings.Select the Windows 2008 R2 Edition.Select the appropriate OS version and edition.Select the “WORKGROUP” option.Select “Automatically generate computer name”.Set the appropriate time zone.Set up loopback on image file: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.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.Start the Windows System Image Manager, which is part of the Windows AIK.Stop the VM.System Preparation for Windows Server 2003 R2System Preparation for Windows Server 2008 R2System preparation for LinuxTemplated VMs for both Ubuntu and CentOS may require a reboot after provisioning in order to pickup the hostname.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.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.The Default TemplateThe Windows 2008 R2 VM will automatically shut down after sysprep is complete.The default template includes the standard iptables rules, which will block most access to the template excluding ssh.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.The following procedures describe how to import an Amazon Machine Image (AMI) into CloudStack when using the XenServer hypervisor.The following steps should be run when you are ready to template your Template Master. If the Template Master is rebooted during these steps you will have to run all the steps again. At the end of this process the Template Master should be shutdown and the template created in order to create and deploy the final template.The following steps will prepare a basic Linux installation for templating.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.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.The next step clears the bash commands you have just run.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.The next steps updates the packages on the Template Master.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.The preparation steps are complete. Now you can actually create the template as described in Creating the Windows Template.The root password for the default template is "password".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>`_The template will be created, and you can create instances from it.The various techniques for creating templates are described in the next few sections.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.This step forces the user to change the password of the VM after the template has been deployed.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.This step removes information unique to your Template Master such as network MAC addresses, lease files and CD block devices, the files are automatically generated on next boot.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.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.To import an AMI:To upload a template: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.URL. Give the URL for the VHDUbuntuUnmount and delete loopback mount.Upload your Linux ISO.Upload your Windows ISO.Uploading TemplatesUse the following steps to begin the Linux OS installation:Use the following steps to run sysprep for Windows 2008 R2:Wait for the VM to stop. When the status shows Stopped, go to the next step.When a user creates a template, it can be designated private or public.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.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.When templates are deleted, the VMs instantiated from them will continue to run. However, new VMs cannot be created based on the deleted template.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.Windows OS InstallationWindows 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.Working with TemplatesXen 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.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>`_.You may be prompted with a warning that the catalog file cannot be opened. Click Yes to create a new catalog file.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.You need not specify an identification string.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.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.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.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.Your now ready to shutdown your Template Master and create a template!`http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in <http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in>`_vSphere Templates and ISOs|change-admin-password.png||software-license.png||sysmanager.png|Project-Id-Version: Apache CloudStack Administration RTD Report-Msgid-Bugs-To: POT-Creation-Date: 2014-06-30 12:52+0200 PO-Revision-Date: 2014-06-30 12:04+0000 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language-Team: Chinese (China) (http://www.transifex.com/projects/p/apache-cloudstack-administration-rtd/language/zh_CN/) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Language: zh_CN Plural-Forms: nplurals=1; plural=0; (XenServer)XXenServer上运行的Windows VMs需要安装PV驱动,它可能在模板中或在创建完VM后添加。PV驱动对于基本的管理功能是必要的,比如挂载额外的卷和ISO镜像、在线迁移和正常关机。**清除日志文件****清除用户历史****创建模板!****可提取**。如果模板可以被提取请选择是。如果选择了此选项,终端用户可以下载此模板的完全镜。**精选**: 。如果你想这个用户在选择这个模板时更明显则选择Yes。该模板将出现在精选模板列表中。只有管理员可以设置模板为精选。**格式**。上传的模板文件的格式,如VHD或OVA。**主机名管理****Hypervisor**:列表中显示支持的hypervisors。选择想要的一个。**安装****名称和显示文本**。这些会在UI中显示,所以建议写一些描述信息。**名称和显示文本**。这些会在UI中显示,所以建议写一些描述信息。**操作系统类型*:。这有助于CloudStack和Hypervisor执行某些操作并可能提高来宾虚拟机的性能。选择下列之一。**操作系统类型*::这有助于CloudStack和Hypervisor执行某些操作并假设可提高来宾虚拟机的性能。选择下列之一。**启用密码**。如果你的模板中安装了CLoudStack密码修改脚本,选择是。请参阅 :ref:`adding-password-management-to-templates`。**密码管理****公共**。选择是来让CloudStack里面的所有用户都能访问这个模板。模板将会出现在社区模板列表中。请参阅 `“私有和公共模板” <#private-and-public-templates>`_。**移除SSH Keys****移除udev持久设备规则****设置用户密码期限****设置主机名****关闭VM****URL**。管理服务器会从指定的URL下载模板,就像 ``http://my.web.server/filename.vhd.gz``。**区域**::选择你希望该模板在到哪个区域可用,或者选择所有区域使该模板在CloudStack中全部区域中可用。为XenServer,KVM和vSphere各提供了一个默认模板。下载的模板取决于你的云中使用的hypervisor类型。每个模板大概占用2.5GB的存储空间。模板相当于虚拟机的重用配置。当用户创建虚拟机时能从CloudStack的模板列表中选择一个。给你的模板添加密码管理在这个步骤之后,虚拟机会自动关机。过程概述如下:过程概述如下:使用root,移除任何在安装过程中创建的自定义用户账户。假定你有一个叫做CentOS\_6.2|_x64的AMI文件。假定未来你将工作在CentOS主机上。如果AMI是一个Fedora镜像,你需要将它立即安装到Fedora主机上。根据你要找的内容,在grub.conf文件中创建一个入口。以下为入口例子。模板最佳实践启动虚拟机,卸载Hyper-V集成服务,并重新启动。CentOS默认情况下CentOS在启动的时候配置主机名。但是,Ubuntu却没有此功能,对于Ubuntu,安装时使用下面步骤。修改密码通过名称从 /etc/fstab中检查任何挂载的分区。将这些条目(如果有)改成使用LABEL或者UUID挂载。你能通过 blkid命令获得这些信息。检查 `etc/ssh/sshd_config`中关于允许在ssh登录时使用密码的相关行。选择VHD,然后点击下一步。点击 添加点击创建模板并填写如下内容:点击下一步 完成。完成虚拟机创建。点击注册模板。CloudStack包含一个CentOS 模版。当主存储和二级存储配置完成后,这个模版会由二级存储虚拟机下载。可以在生产部署中使用这个模版,也可以删除掉它,使用自定义的模版。CloudStack提供了可选的密码重置功能,该功能允许用户在CloudStack UI上设置临时的admin或root密码,也可以重置现有的admin或root密码。CloudStack默认已经有了一个带CentOS系统的默认模板。有许多添加更多模板的方法,管理员和普通用户均能添加。一般是这样的顺序:CloudStack附带一个默认模板。为了向用户呈现出更多选择,CloudStack的管理员和用户能创建模板并添加到CloudStack中。将卷转换为模板。将Hyper-V的VM转换为模板复制镜像文件到XenServer主机的文件存储库。在下面的例子中,XenServer是"xenhost"。这个XenServer有一个UUID为a9c5b8c8-536b-a193-a6dc-51af3e5ff799的NFS库。在\\Windows 2008 R2安装DVD中的源目录复制install.wim文件到本地硬盘。这是一个非常大的文件可能会复制较长时间。Windows AIK要求WIM文件是可写的。将unattend.xml文件拷贝到Windows 2008 R2 虚拟机的c:\\windows\\system32\\sysprep 文件夹下,拷贝本文件到 /etc/init.d 。使用这个ISO创建VM实例。在 /boot/grub/grub.conf中创建一个引导。从VM创建模板。使用 `“创建VMs” <virtual_machines.html#creating-vms>`_给出的方法创建并且开启一个虚拟机。创建模板概览创建Linux模板从一个快照创建一个模板通过已存在的虚拟机创建模板创建Windows模板删除模板根据不同的Linux发行版,选择适当的步骤继续。终止已经安装到镜像文件中的PV内核名称不要安装打印机。不要指定"运行一次"。下载和安装Windows AIK从`下载页<http://sourceforge.net/projects/cloudstack/files/Password%20Management%20Scripts/CloudInstanceManager.msi/download>`_ 下载安装程序CloudInstanceManager.msi,并在新创建的Windows 虚拟机中运行安装程序。下载cloud-set-guest-password脚本文件:早期的windows版本有个不同的sysprep的工具,按照这些步骤准备Windows Server 2003 R2。编辑 etc/fstab,将”sda1“改为”xvda"并将“sdb"改为”xbdb".以上任一选项将在HVM模式下创建一个VM。对于Windows虚拟机来说这是很好的,但Linux的虚拟机可能无法达到最佳性能。要转换Linux虚拟机到PV模式,对于不同的发行版本将需要额外的步骤。通过终端开启登陆。在默认终端设备XenServer系统上的是xvc0.确定在etc/inittab和etc/securetty中有以下各自的行:最终用户和管理员可以从CloudStack导出模板。导航到用户界面中的模板并选择动作菜单中的下载功能。确保虚拟盘支持PV磁盘和PV网络。为你之前选择好的kernel版本自定义这些。安装的类型选择 “Sysprep 安装”退出chroot导出模板从Windows 安装CD中提取\\support\\tools\\deploy.cab到WIndows 2003 R2 虚拟机中的此目录 c:\\sysprep。按照你所使用的WIndows Server版本进行Windows Server 2008 R2(下面的)或者Windows Server 2003 R2中Sysprep的操作步骤。对于CentOS,必须要修改网络接口的配置文件,在这里我们编辑/etc/sysconfig/network-scripts/ifcfg-eth0文件,更改下面的内容。对于Linux VMs,在尝试让VM在XenServer中工作之前你可能必须在Hyper-V做一些准备工作。如果你仍然想要在Hyper-V中使用这个VM的话,克隆这个VM然后在克隆的虚机上操作。卸载Hyper-V集成组件然后检查任何/etc/fstab中涉及的相关设备名称:对于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>`_下载到。对于 XenServer, 在每一个你创建的模板上安装 PV 驱动 / Xen tools。 这将使动态迁移和干净的宾客关机成为可能。更多信息,请参阅 `“添加ISO” <virtual_machines.html#adding-an-iso>`_。更多信息,请参阅 `“创建VMs” <virtual_machines.html#creating-vms>`_。更多信息,请参阅 `“从已有的虚拟机创建模板” <#creating-a-template-from-an-existing-virtual-machine>`_。对于 vSphere, 在每一个你创建的模板上安装VMware 工具。这将使控制台视图能够正常工作。格式。VHD从 linux\_ic/drivers/dist 目录中,运行make uninstall("linux\_ic" 是复制的Hyper-V集成组件的路径)。通常你不能选择比镜像版本老的OS版本。比如,选择CentOS 5.4来支持CentOS 6.2镜像通常来说是不工作的。在这种情况下,你应该选择其他。使用以下步骤从Windows系统镜像管理器生成应答文件:Hypervisor。XenServer如果需要,客户(如在Ubuntu的安装过程中创建的用户)应该被移除。首先确认root用户账户是启用的并且使用了密码,然后使用root登录。如果已停止虚拟机系统类型不在列表中就选择其他。如果已停止虚拟机的系统在列表中,选择它。在虚机重启时,如果脚本不能连接到虚拟路由器,则密码不会被重置,但启动过程还会继续正常执行。如果你通过vSphere Client上传模板,请确认OVA文件不包含ISO。如果是的话,从模板部署虚拟机将失败。如果你不想为了使用创建模板菜单项而停止虚拟机(如在`“从已有的虚机创建模板” <#creating-a-template-from-an-existing-virtual-machine>`_中描述的), 你可以通过CloudStack UI从任何快照直接创建模板。如果你需要通过CloudStack· UI或API启用重置模板的密码功能,在镜像中安装密码更改脚本。相关内容请参考:ref:`adding-password-management-to-templates`。如果你计划使用大的模板(100 GB 或更大),确保你有10g 的网络以支持大的模板。 当大的模板被使用时,较慢的网络可能导致超时及其它错误。如果你打算以PV模式启动该模板,请选择其他PV(32位)或其他PV(64位)。这个选项只对XenServer有效:使用XenCenter导入VHD。在XenCenter中,找到Tools>Virtual Appliance Tools>Disk Image Import。将镜像导入到VDI中。这可能会花费10-20分钟。导入Amazon Machine Images在 CloudStack中,使用以下值创建一个新的模板:为了Ubuntu DHCP的脚本功能和CentOS dhclient能设置VM主机名,他们都去要设置主模板的主机名设置为“localhost”,运行下面的命令来更改主机名。在应答文件面板,右击来创建一个新的应答文件。在Windows镜像面板,右击选择一个Windows镜像或编录文件选项来读取你刚刚复制的install.wim文件。在左侧的导航栏,点击模板。输入XenServer主机信息,点击下一步。安装XenServer Tools,然后重新启动。安装kernel-xen包到镜像文件中。下载PV内核和ramdisk到镜像中。通常在安装过程中给VM命名是一个好的做法,这么做能确保某些组件如LVM不会只在一台机器中出现。推荐在在安装过程中使用"localhost"命名。从主模板移除旧的日志文件是一个好习惯。运行一个带有你需要的操作系统的虚拟机实例,并进行一些你期望的设置。网络组件使用"典型设置"。电话服务使用默认。保留显示设置为默认。Linux系统安装为了准备使用模板部署你的Linux VMs,可以使用此文档来准备Linux模板。对于文档中的情况,你要通过配置模板,这会涉及"主模板"。这个指导目前覆盖了传统的安装,但不会涉及用户数据和cloud-init还有假设在装过程中安装了openshh服务。找到这个VHD文件。它的名字是以VDI的UUID命名的。压缩并上床至你的web服务器。登录到XenServer然后创建一个与镜像同样大小的VDI。在虚拟机中做好需要的配置,然后点击按钮关闭该虚拟机。确保恰当的设置了序列号。如果使用MAK的话,可以在Windows2008R2的虚拟机上输入MAK。并不需要将MAK输入到Windows映像管理器中。如果你使用KMS主机进行激活,则不需要输入产品序列号。Windows卷激活的详细信息可以在http://technet.microsoft.com/en-us/library/bb892849.aspx 上查看。给VM起个名字,在Storage下选择 NFS VHD SR,启用"Run Operating System Fixups" 然后选择NFS ISO SR。输入VM名称,点击“下一步”,点击“转换”。VM应该就创建了。OS类型。使用适当的OS。对于CentOS的PV模式来说,选择其他PV (32位)或其他PV(64位)。这个选项仅适用于XenServer。在Fedora,CentOS/RHEL和Debian上运行:在某些linux发行版拷贝此文件到 ``/etc/rc.d/init.d``。在许可协议界面,选择"是,完全自动安装"一旦你完成从hyper-v VHD到虚拟机的创建,准备使用以下步骤:当你已经有了一台按你的想法已经配置好的虚拟机,你就能以他为原型创建别的虚拟机。一旦将unattend.xml文件放到 c:\\windows\\system32\\sysprep文件夹下,则按以下步骤运行sysprep工具:选项一:选项二:准备Linux VM按需要准备VM。例如在Windows VM上执行sysprep。请参阅 `“创建Windows模板” <#creating-a-windows-template>`_。私有模板和公共模板私有模板只对创建者可用。默认上传的模板都是私有的。填写以下内容:提供你的名称和组织。提供你的产品key。从 /boot/grub/menu.lst移除 "hdX=noprobe" 。模板的需求从备份/boot/ 恢复原始的文件系统(备份名称为 \*.backup0)。运行 XenConvert ,选择 VHD,选择 XenServer,点击下一步。运行 c:\\sysprep\\setupmgr.exe 来创建syprep.inf文件。执行以下命令使脚本可执行:运行以下命令行来sysprep镜像:将应答文件保存到c:\\sysprep\\sysprep.inf。将答案文件保存为unattend.xml,可以忽略验证窗口中的警告信息。关于设置密码管理脚本的相关说明,请参阅 :ref:`adding-password-management-to-templates` ,这样能允许CloudStack通过web界面更改root密码。选择创建新的来创建一个新的应答文件。给你的部署选择一个合适的许可模式。选择合适的区域设置。选择合适的语言选项。选择Windows 2008 R2版本。选择合适的OS版本选择“WORKGROUP”选项。选择"自动生成计算机名"。设置合适的时区。建立在镜像文件上的回滚关闭虚拟机,从NFS存储拷贝VHD到一个web服务器;比如,在web服务器上挂载NFS共享然后拷贝它,或者是在XenServer主机上用sftp或scp将VHD上传到web服务器。特殊情况下,模板可以是一个包含一个或多个操作系统的虚拟磁盘镜像,你可以选择性的安装另外的软件,比如office应用并设置访问控制来决定谁能使用这个模板。每个模板对应一个特殊类型的虚拟机,此类虚拟机在将模板添加入CloudStack时指定。打开Windows系统镜像管理器。停止VM。针对Windows Server 2003R2的系统准备为Windows Server 2008 R2进行系统准备Linux的系统准备工作通过Ubuntu和CentOS的模板分发的虚机可能需要重启才让主机名生效。模板是使用HTTP协议通过URL来上传的。模板通常都很大。你可以使用gzip压缩它们以缩短上传时间。模板可以被删除。在一般情况下,当一个模板跨越多个区域,只有被选中的副本才会被删除,在其他区域相同的模板将不会被删除。CentOS的模板是一个例外。如果所提供的CentOS的模板被删除,它从所有区域都将被删除。默认模版Windows 2008 R2虚拟机在sysprep完成后,会自动关闭。默认模版包括标准的iptables 规则,会阻止除了ssh以外的其他访问。第一个页面你必须让语言和国家或位置选择页面是自动的。要使这个自动化,请在你的Windows 镜像面板扩展组件,右击Microsoft-Windows-International-Core添加设置以传送 7 oobeSystem。在你的应答文件面板中,为语言和国家或位置用适当的设置配置InputLocale、SystemLocale、UILanguage、和UserLocale。你可能对这些设置有疑问,你可以指定一个设置右击选择帮助。这将打开对应的CHM帮助文件,这里面包括了与你尝试配置的设置相关的一些示例。以下过程描述了当使用XenServer hypervisor时,如何导入一个AMI到Cloudstack中。当你准备好做你的主模板的时候请运行下列步骤。如果主模板在这些步骤期间重启了,那么你要重新运行所有的步骤。在这个过程的最后,主模板应该关机并且将其创建为模板,然后再部署。下列步骤将会为模板准备一个基本的Linux安装。一个模板化的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`,并且调整权限。当模版创建过程完成后,新模版会出现在模版页面。在创建虚机时就可以使用新模版了。下一步来清除你曾经运行过的bash命令。下一步请确保Hyper-V中的这个VM没有运行,然后把VHD送至XenServer。有两个选择。下一步更新主模板中的包。密码管理功能总是在虚机启动时重置账号的密码。该脚本通过对虚拟路由器的HTTP调用,获取需要重置的账号密码。启动时,只要虚拟路由器可以访问,虚机就可以获得应该设置的账号密码。当用户请求密码重置时,管理服务器会生成新密码,并发送到虚拟路由器。因而,虚机需要重启新密码才能生效。准本工作完成了。现在你可以按照创建Windows模板中描述的来创建模板。默认模版的root用户密码是“password”。这些步骤的概述来源于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>`_。模板就创建好了,然后你可以通过它创建实例。接下来的几节中将继续讲述各种创建模板的技术。还有其他方法向CloudStack中添加模板。比如你可以对虚机磁盘卷做个快照然后通过这个快照创建模板,或者从另一个系统导入一个VHD到CloudStack。这步是要在模板部署之后强制用户更改VM的密码。这步是为了确认所有要作为模板的VMs的SSH Keys都不相同,否则这样会降低虚拟机的安全性。这一步会移除你的主模板的特殊信息,如网络MAC地址,租约信息和CD块设备,这个文件会在下次启动时自动生成。要转换Hyper-V的VM到兼容XenServer的CloudStack模板,你需要一个独立的添加了NFS VHD SR的XenServer主机。无论使用CloudStack管理哪个版本XenServer,但必须是XenCenter 5.6 FP1或SP2(它向下兼容5.6)。另外,添加了NFS ISO SR是有帮助的。为启用密码重置功能,您需要下载额外的脚本到模版上。当您之后在CloudStack中添加模版时,您可以指定该模版是否启用重置admin或root密码的功能。导入一个AMI:要上传模板:输入一个默认的管理员密码。如果你启用了密码重置功能,用户实际上将不会使用这个密码。在来宾虚机启动之后实例管理器会重置密码。URL。给VHD指定URL。Ubuntu卸载或删除loopback挂载。上传你的Linux ISO。上传你的Windows ISO。上传模板使用一下步骤开始Linux系统的安装:按照以下步骤运行Windows 2008 R2的sysprep:等待虚拟机关闭。当虚拟机状态显示为“已停止”,执行下一步。用户创建模板时可选择模板为公有还是私有。当用户将模板标识为“公有”,该模板不但能让该用户域中所有账户中的所有用户使用,还可以让能访问存储该模板的区域的其他域中用户使用。这取决于zone是设置成公用还是私有。私有区域被分配到一个单一的域,而公共区域能被任何域访问。当复制和粘贴命令时,请确保没有多余的换行符,因为一些文档查看器可能会在复制时加上换行符。当删除模板时,从它们中产生的虚拟机实例将继续运行。然而,新的虚拟机不能在被删除模板的基础上创建。刚刚创建的Windows 2008 R2上面并没有安装Windows AIK。Windows AIK不是你创建的模板中的一部分。它仅仅用于创建sysprep应答文件。Windows OS 安装Windows模板在分发多个虚拟机的之前必须使用Sysprep初始化。Sysprep允许你创建一个通用的Windows模板和避免任何可能的SID冲突。使用模板Xen的kernels/ramdisk通常以“xen"结尾。在lib/modules中选择相应的内核版本,intrd和vmlinuz将作出相应的反应.综上,唯一要求的条件是版本为2.6.18-164.15.1.el5xen。现在你可以创建模板了,更多信息请参阅 `“从已存在的虚拟机创建模板” <#creating-a-template-from-an-existing-virtual-machine>`_。你可能会收到一个警告提示说不能打开编录文件。点击是来创建一个新的编录文件。可能会需要阅读AIK文档并设置多个选项来适合你的部署。以上的步骤至少需要使windows脱离建立网络的过程。你不必指定标示字符串。类似机械化的操作还有更改管理员密码页。展开Microsoft-Windows-Shell-Setup组件(如果没有展开的话),展开用户账户,右键点击管理员密码,添加设置到Pass 7 oobeSystem配置,在设置中,指定一个密码。你需要将软件授权选择页配置为自动进行,这不是众所周知的EULA。为此,展开Microsoft-Windows-Shell-Setup组件,选中OOBE 设置,将此设置加入到Pass 7 oobeSystem中去。在设置中,将HideEULAPage 设置为true。一旦镜像文件在CentOS/Fedora主机上自定义完毕,你必须有一台使用文件存储库(本地ext3 SR或者NFS SP)的XenServer主机将其转换VHD。你不能选择比镜像版本老的OS版本。比如,选择CentOS 5.4来支持CentOS 6.2镜像通常来说是不工作的。在这种情况下,你应该选择其他。现在你可以关闭你的主模板并且创建模板了!`http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in <http://download.cloud.com/templates/4.2/bindir/cloud-set-guest-password.in>`_vSphere模板和ISOs|change-admin-password.png||software-license.png||sysmanager.png|