使用Packer在VMware VCenter上自动部署Windows Server 2016中文版

Packer 是由 Hashicorp 创建的应用程序,它使 IT 专业人员能够自动执行其 VM 模板生成。随着混合云环境的兴起,它正迅速成为在一个工具下管理每个平台的多个 VM 映像的首选实用工具之一。它自动执行建立全新 VM 的过程,并合并自定义生成脚本以动态自定义 VM,然后转换回模板以用于在云中或本地进行部署。在 VMware 环境中使用 Packer 可以带来以下好处:

  • 与平台无关– Packer 不仅可以将相同的映像和配置部署到 VMware 环境,还可以将相同的映像和配置部署到 AWS 和 Azure 等公共云提供商。这大大减少了为每个环境维护映像所花费的时间,并确保每个映像都是一致的。
  • 更快的部署– 将尽可能多的内容包含在映像生成中,而不是在部署时运行自定义脚本,从而创建更快的 VM 部署。
  • 自动模板管理– 现在可以自动执行整个过程,并且可以对计划任务运行 Packer 映像重建,而不是每月对模板手动运行 Windows 更新。
  • 基础结构即模板的代码– Packer 允许 IT 专业人员获取其模板内部版本并在代码中对其进行定义。这使我们能够将模板配置存储在源代码管理中,从而可以更轻松地管理和跟踪对模板所做的所有更改。
  • 开源- Packer是一个开源软件,这意味着它是完全免费使用的,这使得它更是必须尝试的。

如何安装Packer

Packer只是一个可执行文件,可以放在任何文件夹中并从那里执行。您可以在此处下载Packer。为配合 JetBrains 的VSphere-ISO的自定义构建器需要下载1.4.5版本的packer(更高版本的packer与 JetBrains 的VSphere-ISO的不兼容)。在我们的示例中,我们将从 Windows 10 计算机运行 Packer。在本例中,packer.exe在C:\Packer目录中。

Packer使用"builders"来提供为当今各种平台(如Azure,VMware和AWS)生成映像的方法。有许多构建器与 Packer 一起提供,但是,目前默认的 VMware 构建器仅允许您使用 SSH 连接到单个主机以提供模板。这还需要在主机上进行自定义配置才能与打包程序交互。幸运的是,Packer是开源软件,并且拥有一个令人惊叹的社区,该社区一直在改进产品。JetBrains 提供了一个名为VSphere-ISO的自定义构建器,它允许我们使用 VCenter API 连接到我们的 VMware 环境,只需开始配置模板即可。因此,在此示例中,我们将下载的packer-builder-vsphere-iso.exe放置在与 packer.exe相同的目录中,Packer 将自动找到该插件:

现在,我们已准备好开始构建 VMware 模板。

在 VMware 中构建基本模板

有两种方法可以构建模板,即 OS ISO 或现有 VM。我们将从头开始,从Windows Server 2016 ISO构建一个VM。Packer 将创建 VM、安装 OS、配置 OS,然后将 VM 转换为模板映像以用于将来的部署。我们需要创建一个打包程序配置文件。打包器配置文件以 JSON 格式编写,如下所示。在我的示例中,这些设置是为我的 VMware 环境配置的。要查看可用于 VSphere-ISO 插件的不同选项,请查看Packer GitHub 页面。我将以下配置另存为名为WindowsServer.Json的文件。确保编辑字段以匹配您自己的 VCenter 环境。另外,请注意,密码都是以明文形式声明的,这不是最佳实践,仅用于演示目的。在生产环境中,我们希望将它们作为变量输入。

{
    "builders": [
        {
            "type": "vsphere-iso","vcenter_server": "vcenter_server_ip","username": "administrator@vsphere.local","password": "vc_admin_password","insecure_connection": "true","vm_name": "windows2016packer","host": "esxi_host_ip","guest_os_type": "windows9_64Guest","communicator": "winrm","winrm_username": "vagrant","winrm_password": "vagrant","CPUs": 1,"RAM": 4096,"RAM_reserve_all": true,"disk_controller_type": "lsilogic-sas","disk_size": 32768,"disk_thin_provisioned": true,"network_card": "e1000e","iso_paths": [
                "[datastore1] SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_ChnSimp_-2_MLF_X21-22842.iso","[datastore1] VMware-tools-windows-11.3.0-18090558.iso"
            ],"floppy_files": [
                "{{template_dir}}/setup/"
            ]
        }
    ],"provisioners": [
        {
            "type": "windows-shell","inline": ["dir c:\\"]
        }
    ]
}

接下来,我们需要创建两个文件。我们需要一个 autounattend.xml 文件来自动安装我们的 Windows Server ISO,一个 vmtools.cmd 文件来配置静态IP,启用服务器和客户端之间的 winrm 通信,关闭防火墙,安装 Windows 期间安装 VMware Tools。这些文件将挂载到 VM 的软盘驱动器上,然后在 Windows 安装阶段运行。幸运的是,jetbrains在Github上拥有所有文件示例 。另请注意,您将需要修改 autounattend.xml 文件以匹配打包程序配置文件中的相同 winrm 凭据。所以现在我有了我的配置文件和一个"setup"文件夹,其中包含用于Windows安装的两个文件:

在 VMware 中构建基本模板

autounattend.xml

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>zh-CN</UILanguage>
            </SetupUILanguage>
            <InputLocale>zh-CN</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <UILanguageFallback>zh-CN</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DiskConfiguration>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Type>Primary</Type>
                            <Order>1</Order>
                            <Size>350</Size>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>2</Order>
                            <Type>Primary</Type>
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Active>true</Active>
                            <Format>NTFS</Format>
                            <Label>boot</Label>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Format>NTFS</Format>
                            <Label>Windows 2016</Label>
                            <Letter>C</Letter>
                            <Order>2</Order>
                            <PartitionID>2</PartitionID>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>Windows Server 2016 SERVERDATACENTER</Value>
                        </MetaData>
                    </InstallFrom>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>2</PartitionID>
                    </InstallTo>
                </OSImage>
            </ImageInstall>
            <UserData>
                <!-- Product Key from https://www.microsoft.com/de-de/evalcenter/evaluate-windows-server-technical-preview?i=1 -->
                <ProductKey>
                    <!-- Do not uncomment the Key element if you are using trial ISOs -->
                    <!-- You must uncomment the Key element (and optionally insert your own key) if you are using retail or volume license ISOs -->
                    <Key>6CNGG-BJP34-H923Y-6DMWR-37BMF</Key>
                    <WillShowUI>OnError</WillShowUI>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
                <FullName>Vagrant</FullName>
                <Organization>Vagrant</Organization>
            </UserData>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OEMInformation>
                <HelpCustomized>false</HelpCustomized>
            </OEMInformation>
            <ComputerName>vagrant-2016</ComputerName>
            <TimeZone>China Standard Time</TimeZone>
            <RegisteredOwner/>
        </component>
        <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
        </component>
        <component name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <IEHardenAdmin>false</IEHardenAdmin>
            <IEHardenUser>false</IEHardenUser>
        </component>
        <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
        </component>
        <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Description>Set Execution Policy 64 Bit</Description>
                    <Path>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>2</Order>
                    <Description>Set Execution Policy 32 Bit</Description>
                    <Path>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</Path>
                </RunSynchronousCommand>
                <!-- <RunSynchronousCommand wcm:action="add">
                    <Order>3</Order>
                    <Description>Disable WinRM</Description>
                    <Path>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-winrm.ps1</Path>
                </RunSynchronousCommand> -->
            </RunSynchronous>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <AutoLogon>
                <Password>
                    <Value>vagrant</Value>
                    <PlainText>true</PlainText>
                </Password>
                <Enabled>true</Enabled>
                <Username>vagrant</Username>
            </AutoLogon>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <CommandLine>cmd.exe /c a:\vmtools.cmd</CommandLine>
                    <RequiresUserInput>true</RequiresUserInput>
                </SynchronousCommand>
            </FirstLogonCommands>
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <NetworkLocation>Home</NetworkLocation>
                <ProtectYourPC>1</ProtectYourPC>
            </OOBE>
            <UserAccounts>
                <AdministratorPassword>
                    <Value>vagrant</Value>
                    <PlainText>true</PlainText>
                </AdministratorPassword>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>vagrant</Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Group>administrators</Group>
                        <DisplayName>Vagrant</DisplayName>
                        <Name>vagrant</Name>
                        <Description>Vagrant User</Description>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <RegisteredOwner />
        </component>
    </settings>
    <settings pass="offlineServicing">
        <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <EnableLUA>false</EnableLUA>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:c:/wim/install.wim#Windows Server 2012 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

vmtools.cmd

netsh interface ip set address name="Ethernet0" static 192.168.1.206 255.255.255.0 192.168.1.254

rem basic config for winrm
cmd.exe /c winrm quickconfig -q

rem allow unencrypted traffic,and configure auth to use basic username/password auth
cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}

rem update firewall rules to open the right port and to allow remote administration
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes

rem restart winrm
cmd.exe /c net stop winrm
cmd.exe /c net start winrm

netsh advfirewall set  allprofiles state off


e:\setup64 /s /v "/qb REBOOT=R"

现在我们需要下载一个 VMware Tools ISO。您可以在此处获取它,只需匹配您的 VMware 环境的版本即可。将其传输到数据存储。我把它放在我的ESXi主机上。然后我们需要一个Windows Server 2016 ISO。下载一个并将其保存到您的数据存储中。因此,现在我的数据存储上同时具有操作系统和 VMware Tools ISO,并且该位置在我的打包器配置文件中引用。

有很多预先设置工作要做,但自动化模板构建的好处是值得的。现在,让我们验证我们的 json 文件中没有错误。为此,请打开 PowerShell 控制台并将目录更改为 WindowsServer.Json 的位置,然后运行以下语法:

packer.exe validate WindowsServer.Json

我们可以看到我们的模板已经过验证,我们很好运行我们的构建。为此,请键入以下命令:

packer.exe build WindowsServer.Json

Windows Server需要一些时间来安装,然后打包器将安装VMware工具,最后将VM转换为模板:



C:\packer>packer.exe build WindowsServer.Json
vsphere-iso output will be in this color.

==> vsphere-iso: Creating VM...
==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Mount ISO images...
==> vsphere-iso: Creating floppy disk...
    vsphere-iso: Copying files flatly from floppy_files
    vsphere-iso: Copying directory: C:\packer/setup/
    vsphere-iso: Adding file: C:\packer\setup\Autounattend.xml
    vsphere-iso: Adding file: C:\packer\setup\vmtools.cmd
    vsphere-iso: Done copying files from floppy_files
    vsphere-iso: Collecting paths from floppy_dirs
    vsphere-iso: Resulting paths from floppy_dirs : []
    vsphere-iso: Done copying paths from floppy_dirs
==> vsphere-iso: Uploading created floppy image
==> vsphere-iso: Adding generated Floppy...
==> vsphere-iso: Set boot order temporary...
==> vsphere-iso: Power on VM...
==> vsphere-iso: Waiting for IP...
==> vsphere-iso: IP address: 192.168.1.206
==> vsphere-iso: Using winrm communicator to connect: 192.168.1.206
==> vsphere-iso: Waiting for WinRM to become available...
    vsphere-iso: #< CLIXML
    vsphere-iso: WinRM connected.
    vsphere-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/pow
ershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.
Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I
64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>
-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="p
rogress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record
"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</P
C><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
==> vsphere-iso: Connected to WinRM!
==> vsphere-iso: Provisioning with windows-shell...
==> vsphere-iso: Provisioning with shell script: C:\Users\ADMINI~1.DCC\AppData\L
ocal\Temp\3\windows-shell-provisioner971976287
    vsphere-iso:
    vsphere-iso: C:\Users\vagrant>dir c:\
    vsphere-iso:  Volume in drive C is Windows 2016
    vsphere-iso:  Volume Serial Number is D0F1-E882
    vsphere-iso:
    vsphere-iso:  Directory of c:\
    vsphere-iso:
    vsphere-iso: 2016/09/12  20:45    <DIR>          Logs
    vsphere-iso: 2016/07/16  21:23    <DIR>          PerfLogs
    vsphere-iso: 2021/12/21  05:46    <DIR>          Program Files
    vsphere-iso: 2016/07/16  21:23    <DIR>          Program Files (x86)
    vsphere-iso: 2021/12/21  05:45    <DIR>          Users
    vsphere-iso: 2021/12/21  05:46    <DIR>          Windows
    vsphere-iso:                0 File(s)              0 bytes
    vsphere-iso:                6 Dir(s)  22,341,677,056 bytes free
==> vsphere-iso: Shut down VM...
==> vsphere-iso: Deleting Floppy drives...
==> vsphere-iso: Deleting Floppy image...
==> vsphere-iso: Eject CD-ROM drives...
==> vsphere-iso: Clear boot order...
Build 'vsphere-iso' finished.

==> Builds finished. The artifacts of successful builds are:
--> vsphere-iso: windows2016packer

C:\packer>

完成后,我们可以看到新模板在 vSphere 中可用:

您可能会想"对于Windows的普通安装来说,这是很多工作",但是,这只是一个基本的例子。Packer具有"配置器",它允许我们运行PowerShell脚本,将文件传输到VM以安装应用程序,甚至使用Puppet或Chef等配置管理工具。

原文地址:https://blog.csdn.net/allway2

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


VMware中为CentOS设置固定IP
很多用户想体验Win10,不过又不想把当前电脑系统换成Win10,那么最简单的就是在虚拟机上安装一个Win10系统来进行体验了,这里小编推荐使用VMware Workstation虚拟机来安装Win10系统,下面小编介绍虚拟机的创建及Win10详细安装教程步骤如下:1、首
MAC OS操作系统一般来说只能在苹果设备上安装运行,小编发现一个有趣的方法在winndows 操作系统中通过虚拟机来安装苹果系统,有兴趣的用户一起随小编往下看吧!首先准备好以下工具:用于VMware 12的mac补丁,unlocke(链接: https: pan baidu
vmware player是一款能够让我们在Windows10系统中运行别的系统的软件俗称虚拟机(如win7、xp等),虽然这个平台有大量的优点和有用的功能,但是卸载起来非常困难,特别是在升级过程中。这样的问题大多出在9 0和最近的12 0版本中。在点击卸载或
虚拟机在测试和实验系统上有着很大的帮助,很多用户也喜欢在虚拟机上使用自己想要使用的系统。不过,在win10系统中打开虚拟机时,提示VMware Workstation cannot connect错误无法打开虚拟机怎么办?遇到这种情况时应该怎么办呢?下面就让
最近使用Win10系统的用户反应vmware workstation 运行失败的现象,该怎么办呢?出现这样的情况是由于软件不兼容的问题所引起的,我们可通过下面方法进行恢复。步骤如下:1、按下win+R打开运行,键入gpedit msc,,然后单击确定。将打开本地组策
vmware克隆镜像后,新的Centos无法启动网络
为访问虚拟磁盘、CD/DVD-ROM 和 SCSI 设备,虚拟机将使用创建虚拟机时默认添加的存储控制器。创建虚拟机后可以添加额外的控制器或更改控制器类型。在创建向导中时可执行这些更改。如果您在更改或添加控制器前了解不同类型的控制器的节点行为、控制器限制和兼容性,则可以避免潜在的引导问题。存储控制器技术的工作方式存储控制器对于虚拟机而言是不同类型的 SCSI 控制器,包括 BusLogic 并行、LSI Logic 并行、LSI Logic SAS 和 VMware 准虚拟 SCSI。还提供 AHCI
如今,越来越多的工作负载在虚拟机 (VM) 中运行,包括在来宾操作系统中需要更多 IO 的工作负载。在 VMware vSphere 上的 VM 中,所有虚拟磁盘 (VMDK) 都连接到默认配置中的 LSI 逻辑 SAS SCSI 适配器。此适配器无需安装额外驱动程序即可被所有操作系统识别,但并不总是提供最佳性能,尤其是在使用 SSD RAID 或 NVMe 存储时。在本文中,我们比较了虚拟存储控制器LSI Logical SAS、VMware Paravirtual和NVMe Controller。
Packer 是由 Hashicorp 创建的应用程序,它使 IT 专业人员能够自动执行其 VM 模板生成。随着混合云环境的兴起,它正迅速成为在一个工具下管理每个平台的多个 VM 映像的首选实用工具之一。它自动执行建立全新 VM 的过程,并合并自定义生成脚本以动态自定义 VM,然后转换回模板以用于在云中或本地进行部署。在 VMware 环境中使用 Packer 可以带来以下好处:与平台无关– Packer 不仅可以将相同的映像和配置部署到 VMware 环境,还可以将相同的映像和配置部署到 AWS 和
封隔器 OVA 示例我遇到了一些其他人很幸运的好例子:基础设施即代码:使用 Packer 创建 Linux (RHEL/CentOS) 基础映像 打包机-centos-7 打包模板 自动化示例 打包机-centos7-esxi 打包模板封隔器配置文件在所有这些示例之间,我创建了自己的配置并确保它们没问题:&lt;&gt; tree.├── ansible│ ├── main.yml│ └── requirements.yml├── centos7.jso.
在所有云供应商中,您都获得了基于模板的自动化构建的虚拟机——如何为 VMWare vSphere 构建自定义模板?在这种情况下,HashiCorp Packer 是您想要的工具。这篇文章将介绍创建基于打包程序的虚拟机模板的主要概念什么是打包机?Packer 映像允许您在几秒钟内启动完全配置和配置的机器,而不是几分钟或几小时。这不仅有利于生产,也有利于开发,因为开发虚拟机也可以在几秒钟内启动,而无需等待通常更长的配置时间。由于 Packer 为多个平台创建相同的映像,因此您可以在 AWS 中运行生
在这篇博客文章中,我想向您展示如何使用 Packer 自动执行 VMware vsphere 模板。我喜欢它,因为packer可以在其他平台上使用,如Hyper-V,Azure,AWS或soagar for vmware Workstation或Virtual Box。通过这篇文章,我想向您展示如何为VMware vsphere自动创建Windows Server 2016和Windows Server 2019模板。今天,我将首先在 vmware vsphere 上创建和部署。由于我想尽可能简单快捷地自
如何使用付费许可证设置Vagrant VMware提供商,以便在CentOS 8上运行的VMware Workstation Pro 15.5上运行。感谢Aaron McKay鼓励我写这篇文章,并提供 Vagrant VMware 提供商许可证。在这篇文章中,我将向您展示如何:安装 VMware Workstation Pro。 安装流浪汉。 安装 Vagrant VMware Utility。 安装Vagrant VMware插件。 安装 Vagrant VMware Provider
在本文中,我们将逐步介绍在 VMware vSphere 环境中使用 ISO 构建 Redhat Enterprise Linux 7/CentOS 7 VM。Packer对于在云端和本地构建基础镜像非常有用。Packer 是一个开源工具,由HashiCorp开发。HashiCorp 拥有非常著名的工具,如 Vagrant、Consul 和 Terraform。如今,克隆和部署是构建 VM 的最便捷方式。在某些情况下,所需版本的 OS 模板可能不存在,您可能需要在 Adhoc 中构建 VM。这就是 Pack
虽然Vagrant VMware Desktop提供商是VirtualBox的直接替代品,但还公开了一些其他功能,可让您更精细地配置计算机的VMware特定方面。提供程序的配置设置在 Vagrantfile中设置:Vagrant.configure("2") do |config| config.vm.box = "my-box" config.vm.provider "vmware_desktop" do |v| v.gui = true endend...
autoinst.xml&lt;?xml version="1.0"?&gt;&lt;!DOCTYPE profile&gt;&lt;profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"&gt; &lt;scripts&gt; &lt;chroot-scripts config:type="list"&gt; &lt;script&g..
Ubuntu 20.04 带来了新的安装程序,用subiquity取代了以前的Debian安装。这意味着以前用于自动/无人值守安装的任何方法都不再有效,需要更换。使用Packer成功地做到了这一点。但首先,这是一个工作的无人值守配置:ubuntu-2004.json:{ "builders": [ { "name": "ubuntu-2004", "type": "vmware-iso", "guest_os_type": "ubunt...
Packer 是由 Hashicorp 创建的应用程序,它使 IT 专业人员能够自动执行其 VM 模板生成。随着混合云环境的兴起,它正迅速成为在一个工具下管理每个平台的多个 VM 映像的首选实用工具之一。它自动执行建立全新 VM 的过程,并合并自定义生成脚本以动态自定义 VM,然后转换回模板以用于在云中或本地进行部署。在 VMware 环境中使用 Packer 可以带来以下好处:与平台无关– Packer 不仅可以将相同的映像和配置部署到 VMware 环境,还可以将相同的映像和配置部署到 AWS 和
GitHub - librenms/packer-builds: This repo is where virtual images are created and storedThis repo is where virtual images are created and stored - GitHub - librenms/packer-builds: This repo is where virtual images are created and storedhttps://github.com/