VMware ESXi: The Purpose-Built Bare Metal Hypervisor

0x00.安装或升级

封装含有Realtek 8168网卡驱动的离线包

1.PowerShell大法

设置PowerShell执行策略:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
安装VMware PowerCLI模块:Install-Module -Name VMware.PowerCLI
然后竟然炸了?

1
Microsoft Windows [版本 10.0.17763.914]
2
(c) 2018 Microsoft Corporation。保留所有权利。
3
4
C:\Windows\system32>ps
5
'ps' 不是内部或外部命令,也不是可运行的程序
6
或批处理文件。
7
8
C:\Windows\system32>powershell
9
Windows PowerShell
10
版权所有 (C) Microsoft Corporation。保留所有权利。
11
12
PS C:\Windows\system32> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
13
PS C:\Windows\system32> Install-Module -Name VMware.PowerCLI -Scope AllUsers
14
15
需要使用 NuGet 提供程序来继续操作
16
PowerShellGet 需要使用 NuGet 提供程序“2.8.5.201”或更高版本来与基于 NuGet 的存储库交互。必须在“C:\Program
17
Files\PackageManagement\ProviderAssemblies”或“C:\Users\yuangezhizao\AppData\Local\PackageManagement\ProviderAssemblie
18
s”中提供 NuGet 提供程序。也可以通过运行 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force' 安装
19
NuGet 提供程序。是否要让 PowerShellGet 立即安装并导入 NuGet 提供程序?
20
[Y] 是(Y)  [N] 否(N)  [S] 暂停(S)  [?] 帮助 (默认值为“Y”): Y
21
PackageManagement\Install-Package : 找不到与指定的搜索条件和程序包名称“VMware.PowerCLI”匹配的项目。请尝试使用 Get-PSR
22
epository 查看所有可用的注册程序包源。
23
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 字符: 21
24
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
25
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
27
   ception
28
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
29
30
PS C:\Windows\system32> Install-Module -Name VMware.PowerCLI -Scope AllUsers
31
PackageManagement\Install-Package : 找不到与指定的搜索条件和程序包名称“VMware.PowerCLI”匹配的项目。请尝试使用 Get-PSR
32
epository 查看所有可用的注册程序包源。
33
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 字符: 21
34
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
35
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
37
   ception
38
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
39
40
PS C:\Windows\system32>

只好去官网手动下载安装

最新 6.5.4 ?
最新 6.5.4 ?
网奇慢,好久才进到这个页面
网奇慢,好久才进到这个页面

翻了一大圈,才看到没有新版本下载地址的原因?

因为这玩楞会自动升级
因为这玩楞会自动升级

以及404的可能性之一

也就是说网炸了?
也就是说网炸了?
草

最终只好离线安装,然后就出现了如下的一幕

11.5.0
11.5.0
草 * 2
草 * 2
才看到原来这里写明了新版本会在新地址发布
才看到原来这里写明了新版本会在新地址发布

真·官网下载之后解压到模块目录下:C:\Windows\System32\WindowsPowerShell\v1.0\Modules顺手把VMware-PowerCLI-11.5.0-14912921重命名为了VMware-PowerCLI
2019-12-28 01:14:06终于找到了导入不能的解决方法,那就是解压完不要嵌套文件夹,要直接放在Modules目录下……
最后导入模块:Import-Module VMware.PowerCLI
附:
关闭CEIP(Customer Experience Improvement Program)Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false
忽略证书验证:Set-PowerCLIConfiguration -InvalidCertificateAction Ignore

完美离线导入
完美离线导入
成功登录
成功登录
点击此处 ← 查看终端
1
PS C:\Users\yuangezhizao> $env:PSModulePath
2
D:\yuangezhizao\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
3
PS C:\Users\yuangezhizao> Import-Module VMware.PowerCLI
4
警告: Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a
5
better product. You can join using the following command:
6
7
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true
8
9
VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to
10
improve its products and services, to fix problems, and to advise you on how best to deploy and use our products.  As
11
part of the CEIP, VMware collects technical information about your organization抯 use of VMware products and services
12
on a regular basis in association with your organization抯 VMware license key(s).  This information does not personally
13
 identify any individual.
14
15
For more details: type "help about_ceip" to see the related help article.
16
17
To disable this warning and set your preference use the following command and restart PowerShell:
18
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false.
19
          Welcome to VMware PowerCLI!
20
21
Log in to a vCenter Server or ESX host:              Connect-VIServer
22
To find out what commands are available, type:       Get-VICommand
23
To show searchable help for all PowerCLI commands:   Get-PowerCLIHelp
24
Once you've connected, display all virtual machines: Get-VM
25
If you need more help, visit the PowerCLI community: Get-PowerCLICommunity
26
27
       Copyright (C) VMware, Inc. All rights reserved.
28
29
30
PS C:\Users\yuangezhizao> Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false
31
32
Perform operation?
33
Performing operation 'Update PowerCLI configuration.'?
34
[Y] 是(Y)  [A] 全是(A)  [N] 否(N)  [L] 全否(L)  [S] 暂停(S)  [?] 帮助 (默认值为“Y”): Y
35
36
Scope    ProxyPolicy     DefaultVIServerMode InvalidCertificateAction  DisplayDeprecationWarnings WebOperationTimeout
37
                                                                                                  Seconds
38
-----    -----------     ------------------- ------------------------  -------------------------- -------------------
39
Session  UseSystemProxy  Multiple            Unset                     True                       300
40
User
41
AllUsers
42
43
44
PS C:\Users\yuangezhizao> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
45
46
Perform operation?
47
Performing operation 'Update PowerCLI configuration.'?
48
[Y] 是(Y)  [A] 全是(A)  [N] 否(N)  [L] 全否(L)  [S] 暂停(S)  [?] 帮助 (默认值为“Y”): Y
49
50
Scope    ProxyPolicy     DefaultVIServerMode InvalidCertificateAction  DisplayDeprecationWarnings WebOperationTimeout
51
                                                                                                  Seconds
52
-----    -----------     ------------------- ------------------------  -------------------------- -------------------
53
Session  UseSystemProxy  Multiple            Ignore                    True                       300
54
User                                         Ignore
55
AllUsers
56
57
58
PS C:\Users\yuangezhizao>

2.下载ESXi-Customizer-PS脚本

VMware Front Experience: ESXi-Customizer-PS
最新仍然是:Version 2.6.0 (2018-04-18)ESXi-Customizer-PS-v2.6.0.ps1

点击此处 ← 查看源码
1
#############################################################################################################################
2
#
3
# ESXi-Customizer-PS.ps1 - a script to build a customized ESXi installation ISO using ImageBuilder
4
#
5
# Version:       2.6.0
6
# Author:        Andreas Peetz (ESXi-Customizer-PS@v-front.de)
7
# Info/Tutorial: https://esxi-customizer-ps.v-front.de/
8
#
9
# License:
10
#
11
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
12
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
13
#
14
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16
#
17
# A copy of the GNU General Public License is available at http://www.gnu.org/licenses/.
18
#
19
#############################################################################################################################
20
21
param(
22
    [string]$iZip = "",
23
    [string]$pkgDir = "",
24
    [string]$outDir = $(Split-Path $MyInvocation.MyCommand.Path),
25
    [string]$ipname = "",
26
    [string]$ipvendor = "",
27
    [string]$ipdesc = "",
28
    [switch]$vft = $false,
29
    [string[]]$dpt = @(),
30
    [string[]]$load = @(),
31
    [string[]]$remove = @(),
32
    [switch]$test = $false,
33
    [switch]$sip = $false,
34
    [switch]$nsc = $false,
35
    [switch]$help = $false,
36
    [switch]$ozip = $false,
37
    [switch]$v50 = $false,
38
    [switch]$v51 = $false,
39
    [switch]$v55 = $false,
40
    [switch]$v60 = $false,
41
    [switch]$v65 = $false,
42
    [switch]$v67 = $false,
43
    [switch]$update = $false,
44
    [string]$log = ($env:TEMP + "\ESXi-Customizer-PS-" + $PID + ".log")
45
)
46
47
# Constants
48
$ScriptName = "ESXi-Customizer-PS"
49
$ScriptVersion = "2.6.0"
50
$ScriptURL = "https://ESXi-Customizer-PS.v-front.de"
51
52
$AccLevel = @{"VMwareCertified" = 1; "VMwareAccepted" = 2; "PartnerSupported" = 3; "CommunitySupported" = 4}
53
54
# Online depot URLs
55
$vmwdepotURL = "https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml"
56
$vftdepotURL = "https://vibsdepot.v-front.de/"
57
58
# Function to update/add VIB package
59
function AddVIB2Profile($vib) {
60
    $AddVersion = $vib.Version
61
    $ExVersion = ($MyProfile.VibList | where { $_.Name -eq $vib.Name }).Version
62
    if ($AccLevel[$vib.AcceptanceLevel.ToString()] -gt $AccLevel[$MyProfile.AcceptanceLevel.ToString()]) {
63
        write-host -ForegroundColor Yellow -nonewline (" [New AcceptanceLevel: " + $vib.AcceptanceLevel + "]")
64
        $MyProfile.AcceptanceLevel = $vib.AcceptanceLevel
65
    }
66
    If ($MyProfile.VibList -contains $vib) {
67
        write-host -ForegroundColor Yellow " [IGNORED, already added]"
68
    } else {
69
        Add-EsxSoftwarePackage -SoftwarePackage $vib -Imageprofile $MyProfile -force -ErrorAction SilentlyContinue | Out-Null 
70
        if ($?) {
71
            if ($ExVersion -eq $null) {
72
                write-host -ForegroundColor Green " [OK, added]"
73
            } else {
74
                write-host -ForegroundColor Yellow (" [OK, replaced " + $ExVersion + "]")
75
            }
76
        } else {
77
            write-host -ForegroundColor Red " [FAILED, invalid package?]"
78
        }
79
    }
80
}
81
82
# Function to test if entered string is numeric
83
function isNumeric ($x) {
84
    $x2 = 0
85
    $isNum = [System.Int32]::TryParse($x, [ref]$x2)
86
    return $isNum
87
}
88
89
# Clean-up function
90
function cleanup() {
91
    Stop-Transcript | Out-Null
92
    if ($DefaultSoftwaredepots) { Remove-EsxSoftwaredepot $DefaultSoftwaredepots }
93
}
94
95
# Write info and help if requested
96
write-host ("`nThis is " + $ScriptName + " Version " + $ScriptVersion + " (visit " + $ScriptURL + " for more information!)")
97
if ($help) {
98
    write-host "`nUsage:"
99
    write-host "   ESXi-Customizer-PS [-help] | [-izip <bundle> [-update]] [-sip] [-v67|-v65|-v60|-v55|-v51|-v50]"
100
    write-host "                                [-ozip] [-pkgDir <dir>] [-outDir <dir>] [-vft] [-dpt depot1[,...]]"
101
    write-host "                                [-load vib1[,...]] [-remove vib1[,...]] [-log <file>] [-ipname <name>]"
102
	write-host "                                [-ipdesc <desc>] [-ipvendor <vendor>] [-nsc] [-test]"
103
    write-host "`nOptional parameters:"
104
    write-host "   -help              : display this help"
105
    write-host "   -izip <bundle>     : use the VMware Offline bundle <bundle> as input instead of the Online depot"
106
    write-host "   -update            : only with -izip, updates a local bundle with an ESXi patch from the VMware Online depot,"
107
    write-host "                        combine this with the matching ESXi version selection switch"
108
    write-host "   -pkgDir <dir>      : local directory of Offline bundles and/or VIB files to add (if any, no default)"
109
    write-host "   -ozip              : output an Offline bundle instead of an installation ISO"
110
    write-host "   -outDir <dir>      : directory to store the customized ISO or Offline bundle (the default is the"
111
    write-host "                        script directory. If specified the log file will also be moved here.)"
112
    write-host "   -vft               : connect the V-Front Online depot"
113
	write-host "   -dpt depot1[,...]  : connect additional Online depots by URL or local Offline bundles by file name"
114
    write-host "   -load vib1[,...]   : load additional packages from connected depots or Offline bundles"
115
    write-host "   -remove vib1[,...] : remove named VIB packages from the custom Imageprofile"
116
    write-host "   -sip               : select an Imageprofile from the current list"
117
    write-host "                        (default = auto-select latest available standard profile)"
118
    write-host "   -v67 | -v65 | -v60 |"
119
    write-host "   -v55 | -v51 | -v50 : Use only ESXi 6.7/6.5/6.0/5.5/5.1/5.0 Imageprofiles as input, ignore other versions"
120
    write-host "   -nsc               : use -NoSignatureCheck with export"
121
    write-host "   -log <file>        : Use custom log file <file>"
122
    write-host "   -ipname <name>"
123
    write-host "   -ipdesc <desc>"
124
    write-host "   -ipvendor <vendor> : provide a name, description and/or vendor for the customized"
125
    write-host "                        Imageprofile (the default is derived from the cloned input Imageprofile)"
126
    write-host "   -test              : skip package download and image build (for testing)`n"
127
    exit
128
} else {
129
    write-host "(Call with -help for instructions)"
130
    if (!($PSBoundParameters.ContainsKey('log')) -and $PSBoundParameters.ContainsKey('outDir')) {
131
        write-host ("`nTemporarily logging to " + $log + " ...")
132
    } else {
133
        write-host ("`nLogging to " + $log + " ...")
134
    }
135
    # Stop active transcript
136
    try { Stop-Transcript | out-null } catch {}
137
    # Start own transcript
138
    try { Start-Transcript -Path $log -Force -Confirm:$false | Out-Null } catch {
139
        write-host -ForegroundColor Red "`nFATAL ERROR: Log file cannot be opened. Bad file path or missing permission?`n"
140
        exit
141
    }
142
}
143
144
# The main try ...
145
146
$isModule = @{}
147
try {
148
149
# Check for and load required modules/snapins
150
foreach ($comp in "VMware.VimAutomation.Core", "VMware.ImageBuilder") {
151
    if (Get-Module -ListAvailable -Name $comp -ErrorAction:SilentlyContinue) {
152
		$isModule[$comp] = $true
153
        if (!(Get-Module -Name $comp -ErrorAction:SilentlyContinue)) {
154
            if (!(Import-Module -PassThru -Name $comp -ErrorAction:SilentlyContinue)) {
155
                write-host -ForegroundColor Red "`nFATAL ERROR: Failed to import the $comp module!`n"
156
                exit
157
            }
158
        }
159
    } else {
160
		$isModule[$comp] = $false
161
        if (Get-PSSnapin -Registered -Name $comp -ErrorAction:SilentlyContinue) {
162
            if (!(Get-PSSnapin -Name $comp -ErrorAction:SilentlyContinue)) {
163
                if (!(Add-PSSnapin -PassThru -Name $comp -ErrorAction:SilentlyContinue)) {
164
                    write-host -ForegroundColor Red "`nFATAL ERROR: Failed to add the $comp snapin!`n"
165
                    exit
166
                }
167
            }
168
        } else {
169
            write-host -ForegroundColor Red "`nFATAL ERROR: $comp is not available as a module or snapin! It looks like there is no compatible version of PowerCLI installed!`n"
170
            exit
171
        }
172
    }
173
}
174
175
# Parameter sanity check
176
if ( ($v50 -and ($v51 -or $v55 -or $v60 -or $v65 -or $v67)) -or ($v51 -and ($v55 -or $v60 -or $v65 -or $v67)) -or ($v55 -and ($v60 -or $v65 -or $v67)) -or ($v60 -and ($v65 -or $v67)) -or ($v65 -and $v67) ) {
177
    write-host -ForegroundColor Yellow "`nWARNING: Multiple ESXi versions specified. Highest version will take precedence!"
178
}
179
if ($update -and ($izip -eq "")) {
180
    write-host -ForegroundColor Red "`nFATAL ERROR: -update requires -izip!`n"
181
    exit
182
}
183
184
# Check PowerShell and PowerCLI version
185
if (!(Test-Path variable:PSVersionTable)) {
186
    write-host -ForegroundColor Red "`nFATAL ERROR: This script requires at least PowerShell version 2.0!`n"
187
    exit
188
}
189
$psv = $PSVersionTable.PSVersion | select Major,Minor
190
191
if ($isModule["VMware.VimAutomation.Core"]) {
192
	$pcvm = (get-module "VMware.VimAutomation.Core").Version
193
	write-host ("`nRunning with PowerShell version " + $psv.Major + "." + $psv.Minor + " and VMware PowerCLI version " + $pcvm)
194
} else {
195
	$pcv = Get-PowerCLIVersion | select major,minor,UserFriendlyVersion
196
	write-host ("`nRunning with PowerShell version " + $psv.Major + "." + $psv.Minor + " and " + $pcv.UserFriendlyVersion)
197
	if ( ($pcv.major -lt 5) -or (($pcv.major -eq 5) -and ($pcv.minor -eq 0)) ) {
198
		write-host -ForegroundColor Red "`nFATAL ERROR: This script requires at least PowerCLI version 5.1 !`n"
199
		exit
200
	}
201
}
202
203
if ($update) {
204
    # Try to add Offline bundle specified by -izip
205
    write-host -nonewline "`nAdding Base Offline bundle $izip (to be updated)..."
206
    if ($upddepot = Add-EsxSoftwaredepot $izip) {
207
        write-host -ForegroundColor Green " [OK]"
208
    } else {
209
        write-host -ForegroundColor Red "`nFATAL ERROR: Cannot add Base Offline bundle!`n"
210
        exit
211
    }
212
    if (!($CloneIP = Get-EsxImageprofile -Softwaredepot $upddepot)) {
213
        write-host -ForegroundColor Red "`nFATAL ERROR: No Imageprofiles found in Base Offline bundle!`n"
214
        exit
215
    }
216
    if ($CloneIP -is [system.array]) {
217
        # Input Offline bundle includes multiple Imageprofiles. Pick only the latest standard profile:
218
        write-host -ForegroundColor Yellow "Warning: Input Offline Bundle contains multiple Imageprofiles. Will pick the latest standard profile!"
219
        $CloneIP = @( $CloneIP | Sort-Object -Descending -Property @{Expression={$_.Name.Substring(0,10)}},@{Expression={$_.CreationTime.Date}},Name )[0]
220
    }
221
}
222
223
if (($izip -eq "") -or $update) {
224
    # Connect the VMware ESXi base depot
225
    write-host -nonewline "`nConnecting the VMware ESXi Online depot ..."
226
    if ($basedepot = Add-EsxSoftwaredepot $vmwdepotURL) {
227
        write-host -ForegroundColor Green " [OK]"
228
    } else {
229
        write-host -ForegroundColor Red "`nFATAL ERROR: Cannot add VMware ESXi Online depot. Please check your Internet connectivity and/or proxy settings!`n"
230
        exit
231
    }
232
} else {
233
    # Try to add Offline bundle specified by -izip
234
    write-host -nonewline "`nAdding base Offline bundle $izip ..."
235
    if ($basedepot = Add-EsxSoftwaredepot $izip) {
236
        write-host -ForegroundColor Green " [OK]"
237
    } else {
238
        write-host -ForegroundColor Red "`nFATAL ERROR: Cannot add VMware base Offline bundle!`n"
239
        exit
240
    }
241
}
242
243
if ($vft) {
244
    # Connect the V-Front Online depot
245
    write-host -nonewline "`nConnecting the V-Front Online depot ..."
246
    if ($vftdepot = Add-EsxSoftwaredepot $vftdepotURL) {
247
        write-host -ForegroundColor Green " [OK]"
248
    } else {
249
        write-host -ForegroundColor Red "`nFATAL ERROR: Cannot add the V-Front Online depot. Please check your internet connectivity and/or proxy settings!`n"
250
        exit
251
    }
252
}
253
254
if ($dpt -ne @()) {
255
	# Connect additional depots (Online depot or Offline bundle)
256
	$AddDpt = @()
257
	for ($i=0; $i -lt $dpt.Length; $i++ ) {
258
		write-host -nonewline ("`nConnecting additional depot " + $dpt[$i] + " ...")
259
		if ($AddDpt += Add-EsxSoftwaredepot $dpt[$i]) {
260
			write-host -ForegroundColor Green " [OK]"
261
		} else {
262
			write-host -ForegroundColor Red "`nFATAL ERROR: Cannot add Online depot or Offline bundle. In case of Online depot check your Internet"
263
            write-host -ForegroundColor Red "connectivity and/or proxy settings! In case of Offline bundle check file name, format and permissions!`n"
264
			exit
265
		}
266
	}
267
268
}
269
270
write-host -NoNewLine "`nGetting Imageprofiles, please wait ..."
271
$iplist = @()
272
if ($iZip -and !($update)) {
273
    Get-EsxImageprofile -Softwaredepot $basedepot | foreach { $iplist += $_ }
274
} else {
275
	if ($v67) {
276
		Get-EsxImageprofile "ESXi-6.7*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
277
	} else {
278
		if ($v65) {
279
			Get-EsxImageprofile "ESXi-6.5*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
280
		} else {
281
			if ($v60) {
282
				Get-EsxImageprofile "ESXi-6.0*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
283
			} else {
284
				if ($v55) {
285
					Get-EsxImageprofile "ESXi-5.5*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
286
				} else {
287
					if ($v51) {
288
						Get-EsxImageprofile "ESXi-5.1*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
289
					} else {
290
						if ($v50) {
291
							Get-EsxImageprofile "ESXi-5.0*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
292
						} else {
293
							# Workaround for http://kb.vmware.com/kb/2089217
294
							Get-EsxImageprofile "ESXi-5.0*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
295
							Get-EsxImageprofile "ESXi-5.1*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
296
							Get-EsxImageprofile "ESXi-5.5*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
297
							Get-EsxImageprofile "ESXi-6.0*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
298
							Get-EsxImageprofile "ESXi-6.5*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
299
							Get-EsxImageprofile "ESXi-6.7*" -Softwaredepot $basedepot | foreach { $iplist += $_ }
300
						}
301
					}
302
				}
303
			}
304
		}
305
	}
306
}
307
308
if ($iplist.Length -eq 0) {
309
    write-host -ForegroundColor Red " [FAILED]`n`nFATAL ERROR: No valid Imageprofile(s) found!"
310
    if ($iZip) {
311
        write-host -ForegroundColor Red "The input file is probably not a full ESXi base bundle.`n"
312
    }
313
    exit
314
} else {
315
    write-host -ForegroundColor Green " [OK]"
316
    $iplist = @( $iplist | Sort-Object -Descending -Property @{Expression={$_.Name.Substring(0,10)}},@{Expression={$_.CreationTime.Date}},Name )
317
}
318
319
# if -sip then display menu of available image profiles ...
320
if ($sip) {
321
    if ($update) {
322
        write-host "`nSelect Imageprofile to use for update:"
323
    } else {
324
        write-host "`nSelect Base Imageprofile:"
325
    }
326
    write-host "-------------------------------------------"
327
    for ($i=0; $i -lt $iplist.Length; $i++ ) {
328
        write-host ($i+1): $iplist[$i].Name
329
    }
330
    write-host "-------------------------------------------"
331
    do {
332
        $sel = read-host "Enter selection"
333
        if (isNumeric $sel) {
334
            if (([int]$sel -lt 1) -or ([int]$sel -gt $iplist.Length)) { $sel = $null }
335
        } else {
336
            $sel = $null
337
        }
338
    } until ($sel)
339
    $idx = [int]$sel-1
340
} else {
341
    $idx = 0
342
}
343
if ($update) {
344
    $updIP = $iplist[$idx]
345
} else {
346
    $CloneIP = $iplist[$idx]
347
}
348
349
write-host ("`nUsing Imageprofile " + $CloneIP.Name + " ...")
350
write-host ("(dated " + $CloneIP.CreationTime + ", AcceptanceLevel: " + $CloneIP.AcceptanceLevel + ",")
351
write-host ($CloneIP.Description + ")")
352
353
# If customization is required ...
354
if ( ($pkgDir -ne "") -or $update -or ($load -ne @()) -or ($remove -ne @()) ) {
355
356
    # Create your own Imageprofile
357
    if ($ipname -eq "") { $ipname = $CloneIP.Name + "-customized" }
358
    if ($ipvendor -eq "") { $ipvendor = $CloneIP.Vendor }
359
    if ($ipdesc -eq "") { $ipdesc = $CloneIP.Description + " (customized)" }
360
    $MyProfile = New-EsxImageprofile -CloneProfile $CloneIP -Vendor $ipvendor -Name $ipname -Description $ipdesc
361
362
    # Update from Online depot profile
363
    if ($update) {
364
        write-host ("`nUpdating with the VMware Imageprofile " + $UpdIP.Name + " ...")
365
        write-host ("(dated " + $UpdIP.CreationTime + ", AcceptanceLevel: " + $UpdIP.AcceptanceLevel + ",")
366
        write-host ($UpdIP.Description + ")")
367
        $diff = Compare-EsxImageprofile $MyProfile $UpdIP
368
        $diff.UpgradeFromRef | foreach {
369
            $uguid = $_
370
            $uvib = Get-EsxSoftwarePackage | where { $_.Guid -eq $uguid }
371
            write-host -nonewline "   Add VIB" $uvib.Name $uvib.Version
372
            AddVIB2Profile $uvib
373
        }
374
    }
375
376
    # Loop over Offline bundles and VIB files
377
    if ($pkgDir -ne "") {
378
        write-host "`nLoading Offline bundles and VIB files from" $pkgDir ...
379
        foreach ($obundle in Get-Item $pkgDir\*.zip) {
380
            write-host -nonewline "   Loading" $obundle ...
381
            if ($ob = Add-EsxSoftwaredepot $obundle -ErrorAction SilentlyContinue) {
382
                write-host -ForegroundColor Green " [OK]"
383
                $ob | Get-EsxSoftwarePackage | foreach {
384
                    write-host -nonewline "      Add VIB" $_.Name $_.Version
385
                    AddVIB2Profile $_
386
                }
387
            } else {
388
                write-host -ForegroundColor Red " [FAILED]`n      Probably not a valid Offline bundle, ignoring."
389
            }
390
        }
391
        foreach ($vibFile in Get-Item $pkgDir\*.vib) {
392
            write-host -nonewline "   Loading" $vibFile ...
393
            try {
394
                $vib1 = Get-EsxSoftwarePackage -PackageUrl $vibFile -ErrorAction SilentlyContinue
395
                write-host -ForegroundColor Green " [OK]"
396
                write-host -nonewline "      Add VIB" $vib1.Name $vib1.Version
397
                AddVIB2Profile $vib1
398
            } catch {
399
                write-host -ForegroundColor Red " [FAILED]`n      Probably not a valid VIB file, ignoring."
400
            }
401
        }
402
    }
403
    # Load additional packages from Online depots or Offline bundles
404
    if ($load -ne @()) {
405
        write-host "`nLoad additional VIBs from Online depots ..."
406
        for ($i=0; $i -lt $load.Length; $i++ ) {
407
            if ($ovib = Get-ESXSoftwarePackage $load[$i] -Newest) {
408
                write-host -nonewline "   Add VIB" $ovib.Name $ovib.Version
409
                AddVIB2Profile $ovib
410
            } else {
411
                write-host -ForegroundColor Red "   [ERROR] Cannot find VIB named" $load[$i] "!"
412
            }
413
        }
414
    }
415
    # Remove selected VIBs
416
    if ($remove -ne @()) {
417
        write-host "`nRemove selected VIBs from Imageprofile ..."
418
        for ($i=0; $i -lt $remove.Length; $i++ ) {
419
            write-host -nonewline "      Remove VIB" $remove[$i]
420
            try {
421
                Remove-EsxSoftwarePackage -ImageProfile $MyProfile -SoftwarePackage $remove[$i] | Out-Null
422
                write-host -ForegroundColor Green " [OK]"
423
            } catch {
424
                write-host -ForegroundColor Red " [FAILED]`n      VIB does probably not exist or cannot be removed without breaking dependencies."
425
            }
426
        }
427
    }
428
429
} else {
430
    $MyProfile = $CloneIP
431
}
432
433
434
# Build the export command:
435
$cmd = "Export-EsxImageprofile -Imageprofile " + "`'" + $MyProfile.Name + "`'"
436
437
if ($ozip) {
438
    $outFile = "`'" + $outDir + "\" + $MyProfile.Name + ".zip" + "`'"
439
    $cmd = $cmd + " -ExportTobundle"
440
} else {
441
    $outFile = "`'" + $outDir + "\" + $MyProfile.Name + ".iso" + "`'"
442
    $cmd = $cmd + " -ExportToISO"
443
}
444
$cmd = $cmd + " -FilePath " + $outFile
445
if ($nsc) { $cmd = $cmd + " -NoSignatureCheck" }
446
$cmd = $cmd + " -Force"
447
448
# Run the export:
449
write-host -nonewline ("`nExporting the Imageprofile to " + $outFile + ". Please be patient ...")
450
if ($test) {
451
    write-host -ForegroundColor Yellow " [Skipped]"
452
} else {
453
    write-host "`n"
454
    Invoke-Expression $cmd
455
}
456
457
write-host -ForegroundColor Green "`nAll done.`n"
458
459
# The main catch ...
460
} catch {
461
    write-host -ForegroundColor Red ("`n`nAn unexpected error occured:`n" + $Error[0])
462
    write-host -ForegroundColor Red ("`nIf requesting support please be sure to include the log file`n   " + $log + "`n`n")
463
464
# The main cleanup
465
} finally {
466
    cleanup
467
    if (!($PSBoundParameters.ContainsKey('log')) -and $PSBoundParameters.ContainsKey('outDir')) {
468
        $finalLog = ($outDir + "\" + $MyProfile.Name + "-" + (get-date -Format yyyyMMddHHmm) + ".log")
469
        Move-Item $log $finalLog -force
470
        write-host ("(Log file moved to " + $finalLog + ")`n")
471
    }
472
}
点击此处 ← 查看帮助
1
PS D:\yuangezhizao\Documents\ESXi> .\ESXi-Customizer-PS-v2.6.0.ps1 -help
2
3
This is ESXi-Customizer-PS Version 2.6.0 (visit https://ESXi-Customizer-PS.v-front.de for more information!)
4
5
Usage:
6
   ESXi-Customizer-PS [-help] | [-izip <bundle> [-update]] [-sip] [-v67|-v65|-v60|-v55|-v51|-v50]
7
                                [-ozip] [-pkgDir <dir>] [-outDir <dir>] [-vft] [-dpt depot1[,...]]
8
                                [-load vib1[,...]] [-remove vib1[,...]] [-log <file>] [-ipname <name>]
9
                                [-ipdesc <desc>] [-ipvendor <vendor>] [-nsc] [-test]
10
11
Optional parameters:
12
   -help              : display this help
13
   -izip <bundle>     : use the VMware Offline bundle <bundle> as input instead of the Online depot
14
   -update            : only with -izip, updates a local bundle with an ESXi patch from the VMware Online depot,
15
                        combine this with the matching ESXi version selection switch
16
   -pkgDir <dir>      : local directory of Offline bundles and/or VIB files to add (if any, no default)
17
   -ozip              : output an Offline bundle instead of an installation ISO
18
   -outDir <dir>      : directory to store the customized ISO or Offline bundle (the default is the
19
                        script directory. If specified the log file will also be moved here.)
20
   -vft               : connect the V-Front Online depot
21
   -dpt depot1[,...]  : connect additional Online depots by URL or local Offline bundles by file name
22
   -load vib1[,...]   : load additional packages from connected depots or Offline bundles
23
   -remove vib1[,...] : remove named VIB packages from the custom Imageprofile
24
   -sip               : select an Imageprofile from the current list
25
                        (default = auto-select latest available standard profile)
26
   -v67 | -v65 | -v60 |
27
   -v55 | -v51 | -v50 : Use only ESXi 6.7/6.5/6.0/5.5/5.1/5.0 Imageprofiles as input, ignore other versions
28
   -nsc               : use -NoSignatureCheck with export
29
   -log <file>        : Use custom log file <file>
30
   -ipname <name>
31
   -ipdesc <desc>
32
   -ipvendor <vendor> : provide a name, description and/or vendor for the customized
33
                        Imageprofile (the default is derived from the cloned input Imageprofile)
34
   -test              : skip package download and image build (for testing)

3.下载ESXi离线包

它的文件命名格式突然变了,现在的ESXi670-201912001.zip与之前的update-from-esxi6.7-6.7_update03.zip……

ESXi670-201912001
ESXi670-201912001
最新到 1205
最新到 1205

推荐一个与此强相关的网站,老管网络日志 | funpower’s blog

看来就是这个了
看来就是这个了
龟速下载
龟速下载
1
VMware vSphere Hypervisor (ESXi) Offline Bundle
2
文件大小: 451.7 MB
3
文件类型: zip
4
立即下载
5
Name: ESXi670-201912001.zip
6
发行日期: 2019-12-05
7
内部版本号: 15160138
8
VMware vSphere Hypervisor (ESXi) Offline Bundle
9
Including VMware Tools. Use the image profiles and the VIB packages with VMware Image BuContains VIB packages
10
MD5SUM: 153ea9de288d1cc2518e747f3806f929
11
SHA1SUM: e9761a1a8148d13af8a920decd9d729658d59f1c
12
SHA256SUM: a480208411422076e7cb7fda83aed2198513deb5859d6087f56f931afb0aa399

4. 下载Realtek 8168网卡驱动

Net55-r8168 - V-Front VIBSDepot Wiki可以了解到

Supported Devices / PCI IDs
10ec:8168, 1186:4300

(Realtek RTL8111B / RTL8168B / RTL8111/RTL8168 / RTL8111C / RTL8111CP / RTL8111D(L) / RTL8168C / RTL8111DP / RTL8111E / RTL8168E / RTL8111F / RTL8411 / RTL8111G / RTL8111GUS / RTL8411B(N) / RTL8118AS / D-Link DGE-528T)

下载这个:net55-r8168-8.045a-napi-offline_bundle.zip

5.封装

终于成功
终于成功
1
PS D:\yuangezhizao\Documents\ESXi> ./ESXi-Customizer-PS-v2.6.0.ps1 -izip ESXi670-201912001.zip -dpt net55-r8168-8.045a-napi-offline_bundle.zip -load net55-r8168
2
3
This is ESXi-Customizer-PS Version 2.6.0 (visit https://ESXi-Customizer-PS.v-front.de for more information!)
4
(Call with -help for instructions)
5
6
Logging to C:\Users\YUANGE~1\AppData\Local\Temp\ESXi-Customizer-PS-17316.log ...
7
8
Running with PowerShell version 5.1 and VMware PowerCLI version 11.5.0.14899560
9
10
Adding base Offline bundle ESXi670-201912001.zip ... [OK]
11
12
Connecting additional depot net55-r8168-8.045a-napi-offline_bundle.zip ... [OK]
13
14
Getting Imageprofiles, please wait ... [OK]
15
16
Using Imageprofile ESXi-6.7.0-20191204001-standard ...
17
(dated 11/25/2019 11:43:03, AcceptanceLevel: PartnerSupported,
18
Updates ESXi 6.7 Image Profile-ESXi-6.7.0-20191204001-standard)
19
20
Load additional VIBs from Online depots ...
21
   Add VIB net55-r8168 8.045a-napi [New AcceptanceLevel: CommunitySupported] [OK, added]
22
23
Exporting the Imageprofile to 'D:\yuangezhizao\Documents\ESXi\ESXi-6.7.0-20191204001-standard-customized.iso'. Please be patient ...
24
25
26
All done.
27
28
PS D:\yuangezhizao\Documents\ESXi>

6.烧录

亲测使用balenaEtcher烧录之后的U盘并不能成功启动,于是采用官网←的rufus该工具

?
选择镜像和盘
选择镜像和盘

注意如果提示啥启动项过于老旧可能不会成功需要联网下载新版请点,第一次没截图现在不出弹提示了草

7.启动

机子搬回屋子里,菊花插上显示器、键盘和盘……开机BIOS设置项里选盘启动!

BIOS
BIOS
Installer
Installer
Enter
Enter

这里让选在哪块硬盘上安装或升级ESXi,当时一愣选错就尴尬了……
后来看到可以看详细信息,只有一块硬盘含有ESX(I) Found:ESXi 6.7.0

看硬盘详细信息
看硬盘详细信息
Upgrade
Upgrade
最终确认
最终确认
升级中
升级中
升级完成
升级完成
运行中
运行中

然后关机后把机子拿到客厅,插上电源和网线(主板上电自动开机
回到卧室,进web一看

不慌,再等等
不慌,再等等
大功告成
大功告成

挂起的macOS成功启动,并不用重新破解,看起来没什么大问题hhh,可以去睡觉了.zZ……

0x01.VMware ESXi

这玩楞就是传说中的把服务器整机都虚拟化的软件,之前用的VMware Workstation只是在本机跑虚拟机。而前者虚拟化完成之后并没有图形化界面,只能在另一台电脑上远程访问Web界面进行管理,比如创建多个虚拟机此类操作。所以,你懂得……
这里就截几个图看看吧(WZ大佬组的台式机硬件,华硕主板、E3 CPU,16G内存,唯一不足的是硬盘拿了个辣鸡500G先扛着了
2019-12-28 00:43:33该硬盘于上周已炸……
电信宽带提供公网IP,只需一个电话说明理由就给你分配,与移动的NAT相比已经很良心的了……
再一个这里能获取到IPV6地址,下列截图中也进行了高斯模糊处理干脆折叠起来好了~

host
host

这里比较有意思的是,你可以创建大于物理核心数量的虚拟核心,也可以理解为虚拟化的是总频率,如下图

CPU
CPU

更改用户权限的页面藏在了这里,找了半天才发现,实在是太反人类了……

permission
permission

web页面每900s会强制下线草,参照为 ESXi Shell 和 vSphere Web Client 设置超时可以在高级设置中修改至0

官方文档
官方文档
超时
超时
逼死强逼症患者
逼死强逼症患者

参照为 ESXi 6.0 主机配置 CA 签名证书 (2113926)

官方文档
官方文档
腾讯云申请免费证书
腾讯云申请免费证书

重命名为rui.crtrui.key,上传至/etc/vmware/ssl文件夹中

上传自己的证书
上传自己的证书

懒得重启了,于是
/etc/init.d/hostd restart/etc/init.d/vpxa restart

XShell
XShell
点击此处 ← 查看终端
1
Copyright (c) 2002 NetSarang Computer, Inc. All rights reserved.
2
3
Type `help' to learn how to use Xshell prompt.
4
[D:\~]$ 
5
6
Connecting to 192.168.25.249:22...
7
Connection established.
8
To escape to local shell, press 'Ctrl+Alt+]'.
9
10
The time and date of this login have been sent to the system logs.
11
12
WARNING:
13
   All commands run on the ESXi shell are logged and may be included in
14
   support bundles. Do not provide passwords directly on the command line.
15
   Most tools can prompt for secrets or accept them from standard input.
16
17
VMware offers supported, powerful system administration tools.  Please
18
see www.vmware.com/go/sysadmintools for details.
19
20
The ESXi Shell can be disabled by an administrative user. See the
21
vSphere Security documentation for more information.
22
[root@VM:~] cd /etc/vmware/ssl
23
[root@VM:/etc/vmware/ssl] ls
24
castore.pem               rui.crt                   vsan_kms_client.crt       vsanvp_castore.pem
25
iofiltervp.pem            rui.key                   vsan_kms_client.key
26
openssl.cnf               vsan_kms_castore.pem      vsan_kms_client_old.crt
27
rui.bak                   vsan_kms_castore_old.pem  vsan_kms_client_old.key
28
[root@VM:/etc/vmware/ssl] rm rui.crt rui.key 
29
[root@VM:/etc/vmware/ssl] /etc/init.d/hostd restart
30
watchdog-hostd: Terminating watchdog process with PID 2099465
31
hostd stopped.
32
hostd started.
33
[root@VM:/etc/vmware/ssl] /etc/init.d/vpxa restart
34
watchdog-vpxa: Terminating watchdog process with PID 2099054
35
vpxa stopped.
36
vpxa started.
37
[root@VM:/etc/vmware/ssl]
新增内网?解析
新增内网?解析
完工爽到
完工爽到

先给自己分配了一个虚拟机hhh2019-12-28 00:51:40该机子由于存储在坏掉的硬盘无法成功完全导出,最终只能重装……

vms
vms
+1s
+1s

PY 云新增 CentOS 7.7 64 位

c7
c7

2019-8-24 13:06:59

4TB 硬盘购买
4TB 硬盘购买
NASdata 3TB
NASdata 3TB

2019-12-28 00:19:00
旧硬盘已炸(彻底报废?)替代硬盘已上,然后开机发现web连不上……出去看机子听到硬盘一直咔咔响……
WZ大佬现身Trouble Shooting,发现那块硬盘连的是旧的SATA硬盘线,换上新的1/元根的线之后好了
猜想之前的那块系统盘坏掉的原因也可能是因为这条线,草

机子
机子
那条硬盘线
那条硬盘线

0x02.Windows Server 2019 DataCenter

爽到

cn-py-dl-w9d
cn-py-dl-w9d

0x03.后记

这玩楞搁在了客厅的冰箱旁边和冰箱一起24h不断电工作,虽然主板以及其他位置都配置为了节能,但是感觉还是会比较费电……也不知道功耗能有多少诶?

0x04.引用

旧笔记本通过自定义整合网卡驱动安装 ESXi 6.7.0 u1
命令行操作vSphere–VMware PowerCLI安装