Compute Engine 用戶端的動態核心模組支援 (DKMS)

如果貴機構使用自訂核心,或需要特定環境設定,則標準 Lustre 套件可能不相容。

在這些情況下,Managed Lustre 支援動態核心模組支援 (DKMS)。DKMS 是一種架構,用於管理原始碼位於主要核心樹狀結構外部的 Linux 核心模組。這項工具的核心功能是在安裝新核心時,自動重建及安裝這些模組,確保相容性,不需手動介入。

雖然預先建構的核心模組仍是大多數使用者的建議安裝路徑,但 DKMS 可為使用自訂 Linux 核心的使用者提供替代方案。

注意事項

針對 Managed Lustre 用戶端使用動態核心模組支援 (DKMS),是專為需要與自訂核心相容,且準備自行管理用戶端問題的進階使用者而設計。與預先建構的模組不同,DKMS 需要安裝完整的編譯器工具鍊和特定核心標頭,這會增加系統的安全攻擊面和磁碟空間。此外,由於模組是依需求編譯,使用者必須考量用戶端 VM 啟動時間會大幅延長,且核心更新期間可能會發生編譯失敗。

支援的平台

Managed Lustre 支援下列項目的 DKMS 用戶端套件:

  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS,僅適用於 Arm VM

需求條件

如要使用 DKMS,系統必須包含:

  • 編譯核心模組所需的所有編譯器套件。這項設定會因發行版本而異。

  • 特定核心的標頭。如果是自訂核心,您必須手動將 DKMS 服務指向標頭位置。

受防護的 VM 不支援 DKMS。

安裝 DKMS 和標頭

安裝 Managed Lustre DKMS 套件前,請先安裝 dkms 套件,以及系統適用的 Linux 核心標頭。核心標頭版本必須與您執行的核心版本完全相符。

適用於標準 Ubuntu 核心

如果您使用 Ubuntu 提供的標準核心,通常可以執行下列指令來安裝必要套件:

sudo apt update
sudo apt install dkms linux-headers-$(uname -r)

適用於非標準或自訂核心

如果您使用自訂核心,請自行取得並安裝正確的核心標頭。

自訂核心的標頭安裝程序會因來源而異。你可能需要:

  • 請參閱作業系統供應商的說明文件:供應商可能會提供核心標頭的特定套件或存放區。
  • 從來源建構:如果您自行編譯核心,可能需要從核心來源樹狀結構建構及安裝標頭。

自訂標頭位置

DKMS 預期會在 /usr/src/linux-headers-$(uname -r) 目錄中找到核心標頭。這個指令會執行 uname -r 指令,取得核心版本字串並建構路徑。例如:/usr/src/linux-headers-5.15.0-101-generic

如果核心標頭未安裝在預期位置,您必須手動將 DKMS 服務指向該位置,方法是從自訂標頭目錄建立符號連結,指向 DKMS 預期會找到標頭的位置。

舉例來說,如果標頭位於 /opt/custom-kernel/headers/ 中,請執行下列指令:

sudo ln -s /opt/custom-kernel/headers/ /usr/src/linux-headers-$(uname -r)

您有責任確保正確的 Kernel 標頭已正確安裝,且 DKMS 可以存取。如果找不到標頭,DKMS 套件就無法建構 Lustre 核心模組。

安裝 Managed Lustre DKMS 套件

如要安裝 Managed Lustre DKMS 套件,請按照下列步驟操作。

設定存放區的存取權

DKMS 用戶端套件會託管在 Artifact Registry 的 lustre-client-modules-dkms 專案中。

如要設定 VM 從 Artifact Registry 安裝,請按照這些操作說明進行。

Ubuntu 22.04 LTS

  1. 安裝 Apt 存放區簽署金鑰:

    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/google-cloud.gpg
    curl -fsSL https://us-apt.pkg.dev/doc/repo-signing-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/lustre-client.gpg
    
  2. 設定 VM 以存取 Artifact Registry 套件:

    echo 'deb [signed-by=/usr/share/keyrings/google-cloud.gpg] http://packages.cloud.google.com/apt apt-transport-artifact-registry-stable main' \
      | sudo tee /etc/apt/sources.list.d/artifact-registry.list
    
  3. 更新 Apt 並安裝 apt-transport-artifact-registry 套件:

    sudo apt update && sudo apt install apt-transport-artifact-registry
    
  4. 設定 Apt 從存放區擷取套件:

    echo "deb [signed-by=/usr/share/keyrings/lustre-client.gpg] ar+https://us-apt.pkg.dev/projects/lustre-client-modules-dkms lustre-client-ubuntu-jammy main" \
      | sudo tee -a /etc/apt/sources.list.d/artifact-registry.list
    
  5. 更新存放區來源:

    sudo apt update
    

    如果指令傳回錯誤,請確認 Compute Engine VM 是使用允許所有 Cloud API 完整存取權的存取權範圍建立。詳情請參閱授予 Compute Engine 執行個體存取權

如要進一步瞭解這些指令,請參閱 Artifact Registry 說明文件:設定 VM 以安裝 Debian 套件

Ubuntu 24.04 LTS

  1. 安裝 Apt 存放區簽署金鑰:

    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/google-cloud.gpg
    curl -fsSL https://us-apt.pkg.dev/doc/repo-signing-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/lustre-client.gpg
    
  2. 設定 VM 以存取 Artifact Registry 套件:

    echo 'deb [signed-by=/usr/share/keyrings/google-cloud.gpg] http://packages.cloud.google.com/apt apt-transport-artifact-registry-stable main' \
      | sudo tee /etc/apt/sources.list.d/artifact-registry.list
    
  3. 更新 Apt 並安裝 apt-transport-artifact-registry 套件:

    sudo apt update && sudo apt install apt-transport-artifact-registry
    
  4. 設定 Apt 從存放區擷取套件:

    echo "deb [signed-by=/usr/share/keyrings/lustre-client.gpg] ar+https://us-apt.pkg.dev/projects/lustre-client-modules-dkms lustre-client-ubuntu-noble main" \
      | sudo tee -a /etc/apt/sources.list.d/artifact-registry.list
    
  5. 更新存放區來源:

    sudo apt update
    

    如果指令傳回錯誤,請確認 Compute Engine VM 是使用允許所有 Cloud API 完整存取權的存取權範圍建立。詳情請參閱授予 Compute Engine 執行個體存取權

如要進一步瞭解這些指令,請參閱 Artifact Registry 說明文件:設定 VM 以安裝 Debian 套件

安裝 Lustre 用戶端套件

按照操作說明安裝 Lustre 用戶端套件。

Ubuntu 22.04 LTS

執行下列指令。

sudo apt install lustre-client-modules-dkms/lustre-client-ubuntu-jammy
sudo apt install lustre-client-utils/lustre-client-ubuntu-jammy

Ubuntu 24.04 LTS

執行下列指令。

sudo apt install lustre-client-modules-dkms/lustre-client-ubuntu-noble
sudo apt install lustre-client-utils/lustre-client-ubuntu-noble

這個步驟會編譯用戶端套件,可能需要一段時間。

掛接及存取 Managed Lustre 執行個體

按照「掛接 Managed Lustre 執行個體」中的操作說明進行。