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 資料存放區,或位於 /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.