PowerEdge:在 Dell ESXi 主机上创建持久暂存位置

Summary: 本作方法文章提供了有关如何在 Dell 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

创建持久暂存位置。

  1. 进入 维护模式
  2. 访问主机:使用 SSH
  3. 列出数据存储区
ls /vmfs/volumes
  1. 创建暂存目录
mkdir /vmfs/volumes/DatastoreName/DirectoryName Example: mkdir /vmfs/volumes/Datastore1/.locker-ESXHostname
  1. 检查当前暂存位置
vim-cmd hostsvc/advopt/view ScratchConfig.ConfiguredScratchLocation
  1. 设置新暂存位置
vim-cmd hostsvc/advopt/update ScratchConfig.ConfiguredScratchLocation string /vmfs/volumes/DatastoreName/DirectoryName
示例:
vim-cmd hostsvc/advopt/update ScratchConfig.ConfiguredScratchLocation string /vmfs/volumes/Datastore1/.locker-ESXHostname>
  1. 系统日志配置:确认
esxcli system syslog config get
  1. 本地日志输出:确保 /scratch/log
esxcli system syslog config set --logdir=/scratch/log
  1. 重新加载系统日志配置
esxcli system syslog reload
  1. 重新启动 ESXi 主机
  2. 退出维护模式

ESXi 按以下优先顺序使用暂存空间:配置位置、Fat16 文件系统、VMFS 数据存储区或位于以下位置的 ram 磁盘: /tmp/scratch


删除配置或还原到 RAM 磁盘:

  1. 进入 维护模式
  2. 改变 ScratchConfig.ConfiguredScratchLocation 重定向到 /tmp 在主机 的高级设置中。
  3. 保存
  4. 重新启动主机。
  5. 重新启动后, ScratchConfig.CurrentScratchLocation 应更新为 /tmp
  6. 如果更改未反映出来,请再次重新启动主机 ,然后您可以删除 VMFS 数据存储区。

或者,您可以使用以下命令直接清除暂存配置:

vim-cmd hostsvc/advopt/update ScratchConfig.ConfiguredScratchLocation string ""

重新启动主机 以应用更改。重新启动后,这应提示 ESXi 使用 /tmp/scratch 作为 RAM 磁盘上的暂存位置。

Additional Information

对于 vSAN:

Affected Products

VMware ESXi 7.x, VMware ESXi 8.x, VMware ESXi 9.x
Article Properties
Article Number: 000217150
Article Type: How To
Last Modified: 23 May 2025
Version:  5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.