PowerStore:ESXi 的主机验证脚本

Summary: 正确配置主机对于优化 PowerStore 操作至关重要。本文介绍验证 ESXi 主机是否根据最佳实践进行配置的主机验证脚本。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

概览

主机最佳实践的规格可在 E-Lab 主机连接指南中找到。VMware ESXi 服务器指南指定主机配置参数的建议值及其影响(稳定性、性能、空间效率)和严重性(必需、警告或建议)。此主机验证脚本验证主机是否符合这些最佳实践。
 

提醒:主机验证脚本不用于验证 PowerStore X 节点主机。


验证脚本使用 PowerCLI 版本 6.5 及更高版本,这是适用于 Windows 的 VMware shell。脚本在 VMware vCenter 上运行,验证所有或部分主机的配置。它需要 VMware vCenter 凭据,并且不使用主机的凭据。


应用场景。

建议在以下情况下使用主机验证脚本:

  1. 软件更新 (NDU) 之前
  2. 验证新主机
  3. 故障处理
  4. 定期运行状况检查

过程说明

执行:
此过程使用在使用 VMware vCenter 的 Windows 上运行的 PowerCLI 执行。必须以管理员身份运行控制台。vCenter 凭据必须用于管理员权限。

群集或主机影响:
脚本读取当前配置。脚本不会修改群集或主机。
无中断升级 (NDU) 注意事项:此过程不会对群集或主机进行任何更改。

执行持续时间:
此任务的脚本需要每个 ESXi 主机大约一 (1) 分钟才能完成。

从 PowerCLI 运行 ESXi 主机验证脚本

  1. 从本文下载 ESX_Configuration_Validation 脚本。 
     软件包名称 PowerStore_ESXi_Configuration_Validation_1.0.19.0_pkb.zip
     附件中显示的文件名可能具有不同的后缀。
     脚本名称 check_esx_config.ps1
     版本  1.0.19.0
     MD5 校验和 64c97ce4218c97f03b718e68aa88c120
     SHA256 校验和 7d065192bc1715dd8c134e99158bfabeb74f8b733c7226c8f781a9fe39a26828

提醒:有关包签名验证,请参阅标题为“如何验证包签名”的可选步骤。

 

  1. 下载 VMware PowerCLI 6.5 或更高版本。这可能已经安装在您的个人计算机上。如果未安装,则按照下文的“下载”部分所述下载。
  2. 以管理员身份打开 PowerCLI 控制台。执行此操作的一种方法是使用“以管理员身份运行”选项从“开始”菜单打开 PowerCLI。或者,可以从 PowerShell 控制台运行 PowerCLI。
以管理员身份运行 VMware PowerCLI 的作系统选项
  1. ExecutionPolicy 通过运行以下命令:
> Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  1. 将 PowerCLI 配置设置为忽略无效证书(PowerCLI 10.x 及更高版本)。
> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore 
  1. 调用 check_esx_config 命令执行此操作:
> cd ESX
> .\check_esx_config.ps1 [parameters]


支持的参数:

参数 说明
必需(除非在使用 -version or -help 选项)
-vcenter_server vCenter Server 名称或 IP 地址 是的
-vcenter_user vCenter 用户名 是的
-vcenter_password vCenter 密码 是的
-esx_host

ESXi 主机名/IP 地址的逗号分隔列表或“all”

如果 -esx_host all 指定,脚本将验证给定 vCenter 上所有主机的配置。

是的
-logpath

日志目录完整路径。

如果 -logpath 未指定,默认值为 Logs 目录(与 ESXi 目录同级)。

如果用户指定了不存在的目录,脚本会要求确认以创建它。
在批处理模式下,脚本会在不进行确认的情况下创建一个目录,并将该目录添加到创建该目录的日志中。

-batch 如果未指定任何参数,脚本不会提示输入。
-version 打印脚本版本并退出。
-help 打印帮助页面并退出。


ESXi 主机验证脚本的输出

脚本会将其输出打印到 PowerCLI 控制台和日志文件。名为 <vCenter_Server>_<date>_<time> 在 Logs 目录中创建。

对于每个配置验证,输出将指示验证是否正确,或者如果不正确,则指示错误配置的严重性。消息中的前缀与项目的严重性匹配:PROBLEM、WARNING 或 NOTICE、验证文本和预期值

控制台中会显示脚本所执行作的所有消息。在控制台输出的最后一部分中,发现的所有问题将按严重性和类别汇总。此外,输出将保存到日志文件中。日志文件按部分进行组织,建议用于了解脚本的结果。

输出目录中包含以下文件:

  • all.log - 包含所有输出(与打印到控制台的内容相同)。
  • error.log - 仅包含错误消息或警告以及可疑错误。
  • Dell_EMC_EULA.txt - 戴尔软件工具许可协议

error.log 输出文件的示例:

***************************************************************************************************
Started processing at [22/07/2024 19:31:52] India Standard Time.
***************************************************************************************************
 
Running script version [1.0.19.0].
 
***************************************************************************************************
 
#########   START VALIDATIONS FOR ESX abc.abc.abc.com   ###########
NOTICE:# 0 PowerStore datastores were found
NOTICE:# Checking VM disks provisioning
NOTICE:# Checking VM SCSI controllers type
#########   FINISHED VALIDATIONS FOR ESX abc.abc.abc.com   ###########
 
 
#########################################################
########### Overview section for host abc.abc.abc.com ############
#########################################################
Warning issues for Configuration setting occurs 2 times
#########################################################
############ Detail section for host abc.abc.abc.com #############
#########################################################
WARNING:# NVMe Qualified Name format is not set. It must be set to 0.
WARNING:# Disk.DiskMaxIOSize is set to 32767 rather than the recommended value of 1024.
 
 
***************************************************************************************************
Problems found: 0 issues (0 instances)
Warnings found: 1 issues (2 instances)
Notices found: 0 issues (0 instances)
***************************************************************************************************
Finished processing at [22/07/2024 19:35:15].
***************************************************************************************************

如何验证程序包签名

  • 下载以下两个文件:
  1. 签名
File

PowerStore_ESXi_Configuration_Validation_1.0.19.0.zip.asc.signed
(附件的后缀可能不同)

 大小  659 字节
 MD5 16acecc8b0fba8ec255b63ccc2403ed8
 SHA256    903d826db7c0af897fd3300069c0271d14c3467df7f55fff211bbbc7c44b1041   
  1. 公钥 
File

gpg_public_key.txt
(附件的后缀可能不同)

 大小  1,306 字节
 MD5 fe97eba75623bd1d5ff307f1fbb1a5ae
 SHA256    de141fc22a35deaa0753006b80a87c54d8b4e8ca47f434be3c61807a4d0b6d1d
  • 将这些文件移动到开发 VM(最好是 Linux,因为在此示例中,使用 gpg 预装在大多数 Linux 系统中):
  • 使用以下命令导入密钥 gpg gpg --import gpg_public_key.txt
Expected output gpg: key B16F06CB37196B9C: public key "Dell Technologies Inc. support@dell.com" imported

gpg: Total number processed: 1

gpg:               imported: 1
  • 使用以下命令验证签名的软件包 gpg gpg --verify PowerStore_ESXi_Configuration_Validation_1.0.19.0.zip.asc.signed PowerStore_ESXi_Configuration_Validation_1.0.19.0.zip
Expected output gpg: Signature made Thu 04 Jul 2024 07:06:24 AM EDT
 
gpg:                using RSA key EC31223156602232B2EBE7B0B16F06CB37196B9C
 
gpg: Good signature from "Dell Technologies Inc. support@dell.com" [unknown]
 
gpg: WARNING: This key is not certified with a trusted signature!
 
gpg:          There is no indication that the signature belongs to the owner.
 
Primary key fingerprint: EC31 2231 5660 2232 B2EB  E7B0 B16F 06CB 3719 6B9C
  • 将密钥认证为“受信任”(可选步骤) gpg --edit-key EC31223156602232B2EBE7B0B16F06CB37196B9C
Enter “trust” when gpg prompts, then enter “5” (trust ultimately), then “y” to confirm. Finally, enter “q” to quit the gpg prompt.
 
Expected output à gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
 
This is free software: you are free to change and redistribute it.
 
There is NO WARRANTY, to the extent permitted by law.
 
pub  rsa3072/B16F06CB37196B9C
 
     created: 2024-04-29  expires: 2027-04-29  usage: SCE
 
     trust: unknown       validity: unknown
 
[ unknown] (1). Dell Technologies Inc. support@dell.com
 
 
gpg> trust
 
pub  rsa3072/B16F06CB37196B9C
 
     created: 2024-04-29  expires: 2027-04-29  usage: SCE
 
     trust: unknown       validity: unknown
 
[ unknown] (1). Dell Technologies Inc. support@dell.com
 
 
Please decide how far you trust this user to correctly verify other users' keys
 
(by looking at passports, checking fingerprints from different sources, etc.)
 
 
  1 = I don't know or won't say
 
  2 = I do NOT trust
 
  3 = I trust marginally
 
  4 = I trust fully
 
  5 = I trust ultimately
 
  m = back to the main menu
 
 
Your decision? 5
 
Do you really want to set this key to ultimate trust? (y/N) y
 
 
pub  rsa3072/B16F06CB37196B9C
 
     created: 2024-04-29  expires: 2027-04-29  usage: SCE
 
     trust: ultimate      validity: unknown
 
[ unknown] (1). Dell Technologies Inc. support@dell.com
 
The shown key validity is not necessarily correct
 
unless you restart the program.
 
 
gpg> q
 
  
Rerun the gpg verification now gpg --verify PowerStore_ESXi_Configuration_Validation_1.0.19.0.zip.asc.signed PowerStore_ESXi_Configuration_Validation_1.0.19.0.zip
 
Expected output gpg: Signature made Thu 04 Jul 2024 07:06:24 AM EDT
 
gpg:                using RSA key EC31223156602232B2EBE7B0B16F06CB37196B9C
 
gpg: checking the trustdb
 
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
 
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
 
gpg: next trustdb check due at 2027-04-29
 
gpg: Good signature from "Dell Technologies Inc. support@dell.com" [ultimate]

已知问题

  1. HVS 脚本错误地警告回收参数。回收参数的正确值为:
  • Reclaim Priority 使用 Low
  • Reclaim Method 使用 Priority
[~] esxcli storage vmfs reclaim config get --volume-label VMFS1
 Reclaim Granularity: 1048576 Bytes
 Reclaim Priority: low      <<<<<<<<<<<< priority Low
 Reclaim Method: priority   <<<<<<<<<<<< use priority and not fixed
 Reclaim Bandwidth: 26 MB/s 

下载:

 
提醒:您必须先向 VMware 订阅免费帐户,然后才能下载 PowerCLI。或者,也可以从 PowerShell 控制台中下载 PowerCLI。
 
  • 本文附上了验证脚本。从戴尔支持中,选择本文左侧面板中的 附件
附件在左侧面板中的位置

修订记录:

  • 1.0.15:
    • 初版
  • 1.0.18
    • 经过 PowerCLI 12.5 认证
    • 现在,通过 NVMe 映射的数据存储区可得到正确处理。
    • 更新了免责声明,说明多路径不会评估 HPP NVMe 路径策略。 
    • 系统模块检查 FC HBA 评估建议的 NVMe 设置:vmknvme_hostnqn_format=0
    • 日志文件位置移至输出末尾。 
    • 针对建议的 5 秒 iSCSI no-op 间隔评估了 iSCSI VMkernel
    • 删除了无关的模块收集
    • 输出包括对缺少的成功测试的积极反馈。
    • 解决了验证 config.vpxd.ResourceManager.maxCostPerHost 的问题
    • 解决了验证默认 NMP 循环路径切换频率 PSP 选项的问题: policy=iops;iops=1
  • 1.0.19
    • 对《戴尔主机配置指南》的引用已更改为《E-Lab 连接指南》。相关验证和免责声明也已更新。 
    • 支持的 ESXi 版本已更新。 

Affected Products

PowerStore
Article Properties
Article Number: 000192904
Article Type: How To
Last Modified: 11 Dec 2025
Version:  14
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.