跳至內容

當我在 Amazon EC2 中使用 VM Import/Export 時,如何解決收到的「ClientError: BLSC-style GRUB found」錯誤?

1 分的閱讀內容
0

我想使用 VM Import/Export 將虛擬機器 (VM) 映像匯入至 Amazon Elastic Compute Cloud (Amazon EC2),或匯出 Amazon Machine Image (AMI)。該映像來自 Red Hat Enterprise Linux (RHEL) 8、CentOS 8 或 Oracle Linux 8。但是,我收到「ClientError: BLSC-style GRUB found, but unable to detect default kernel」錯誤。

簡短說明

如果 VM Import/Export 無法偵測您 VM 映像中的預設核心,則會發生「ClientError: BLSC-style GRUB found」錯誤。

若要在 Amazon EC2 中使用 VM Import/Export,您必須在 /etc/default/grub 檔案中將 GRUB_ENABLE_BLSCFG 參數設為 false。根據預設,GRUB_ENABLE_BLSCFG 設為 true。如果參數為 true,則 GRUB2 會使用來自 /boot/loader 檔案的 blscfg 檔案與項目,而不是來自 grub.cfg 檔案的 menuentry 項目。因此,您會收到「ClientError: BLSC-style GRUB found」錯誤訊息。

如果 VM Import/Export 無法偵測您 VM 映像中的預設核心,則會發生「ClientError: BLSC-style GRUB found」錯誤。

解決方法

**先決條件:**確認您使用支援的作業系統 (OS) 與核心版本。

如果您使用支援的 OS 與核心,但仍收到「ClientError: BLSC-style GRUB found」錯誤訊息,請完成以下步驟:

  1. 使用文字編輯器 (例如 vi) 開啟 /etc/default/grub 檔案。<br id=hardline_break/> 範例命令:

    sudo vi /etc/default/grub
  2. 將 GRUB_ENABLE_BLSCFG 參數設為 false。<br id=hardline_break/> 範例文字:

    GRUB_ENABLE_BLSCFG=false
  3. 執行以下命令以重新建置 GRUB 組態檔案:

    grub2-mkconfig -o /boot/grub2/grub.cfg
  4. 測試 VM,確認其在內部部署環境中仍可正常運作。然後,匯入新的 VM 映像,或匯出 AMI。

  5. (選用) 在匯入新映像或匯出 AMI 之後,將參數設回 true。

AWS 官方已更新 10 個月前