附加 RHEL ELS 授權


當 Red Hat Enterprise Linux (RHEL) 版本達到維護期結束,且作業系統映像檔使用隨選授權時,這些 VM 的支援和存取權將受到生命週期階段的維護政策限制。

如需延長支援服務 (提供影響程度重大的安全性修正和選定的緊急優先順序錯誤修正),您可以附加 RHEL Extended Life Cycle Support (ELS) Add-On。ELS 外掛程式適用於主要版本的最新次要版本,如下所示:

  • 針對 RHEL 7,ELS 外掛程式適用於最新的次要版本,也就是 RHEL 7.9 或 RHEL 7.9 for SAP。RHEL 7 的 ELS 加購項目開放使用至 2028 年 6 月 30 日。
  • 對於 RHEL 6,ELS 外掛程式適用於最新的次要版本,也就是 RHEL 6.10。RHEL 6 的 ELS 加購項目開放下載至 2024 年 6 月 30 日。

詳情請參閱 RHEL 生命週期常見問題

本文說明如何將 ELS 外掛程式附加至 RHEL VM,這些 VM 已取得映像檔的隨選授權,且已達到維護期限。將 RHEL 6.10 VM 遷移至 Google Cloud時,系統會自動將 ELS 外掛程式附加至 RHEL 6.10 VM。

附加 ELS 授權

針對每個 VM 執行下列操作,附加 ELS 授權:

  1. 停止 VM 並在開機磁碟中附加授權

  2. 驗證授權並啟動 VM

  3. 在 VM 上安裝 Red Hat Update Infrastructure (RHUI) ELS 用戶端套件

帳單

將 RHEL ELS 連結至磁碟後,Compute Engine 會在帳單中新增額外的 SKU。

舉例來說,如果您使用 RHEL 7,帳單就會包含一個 RHEL 7 委刊項和一個 RHEL 7 ELS 委刊項。

系統會根據付費映像檔的定價收取 RHEL VM 的費用。

限制

  • 您必須先停止 VM,才能附加授權。

事前準備

  • ELS 外掛程式僅適用於最新的次要版本。針對每個 RHEL VM,請連線至 VM 並執行下列指令,以便更新至最新的次要版本:

    sudo yum -y update
  • 請確認您在啟動磁碟上具備下列權限:

    • compute.disks.get
    • compute.disks.update
  • 如果尚未設定,請先設定驗證機制。驗證是指驗證身分,以便存取 Google Cloud 服務和 API 的程序。如要在本機開發環境中執行程式碼或範例,您可以選取下列任一選項,向 Compute Engine 進行驗證:

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. After installing the Google Cloud CLI, initialize it by running the following command:

      gcloud init

      If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

    2. Set a default region and zone.

附加 RHEL ELS 授權

請按照下列程序,將 RHEL ELS 授權附加至 Linux VM 的開機磁碟:

  1. 使用 gcloud compute instances stop 指令停止 VM:

    gcloud compute instances stop VM_NAME
    

    VM_NAME 替換為要停止的 VM 名稱。

  2. 使用 gcloud compute instances describe 指令列出與 VM 相關聯的磁碟:

    gcloud compute instances describe VM_NAME --format="yaml(disks)"
    

    VM_NAME 替換為 VM 名稱。

  3. 確認輸出結果是否類似下列內容:

    disks:
    - autoDelete: true
      boot: true
      deviceName: persistent-disk-0
      diskSizeGb: '20'
      index: 0
      interface: SCSI
      kind: compute#attachedDisk
      licenses:
      - https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/RHEL_VERSION
      mode: READ_WRITE
      source: https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks/VM_NAME
      type: PERSISTENT
    

    請注意,目前尚未附加任何 userLicenses

  4. 執行 gcloud compute disks list 指令,取得開機磁碟的名稱:

    gcloud compute disks list
    
  5. 使用 gcloud beta compute disks update 指令更新開機磁碟,並加入 RHEL ELS 授權 URI:

    gcloud beta compute disks update BOOT_DISK_NAME \
       --zone ZONE \
       --update-user-licenses="https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/RHEL_ELS_VERSION"
    

    更改下列內容:

    • RHEL_VERSION:RHEL 版本。例如:rhel-7-server

    • BOOT_DISK_NAME:在先前步驟中取得的開機磁碟名稱

    • ZONE:包含開機磁碟的區域

    • RHEL_ELS_VERSION:RHEL ELS 版本。例如:rhel-7-els

驗證 RHEL ELS 授權

請按照下列程序,確認 RHEL ELS 授權已附加至 Linux VM 啟動磁碟:

  1. 使用 gcloud beta compute disks describe 指令取得開機磁碟相關資訊:

    gcloud beta compute disks describe BOOT_DISK_NAME \
       --zone ZONE
    

    更改下列內容:

    • BOOT_DISK_NAME:要檢查附加授權的啟動磁碟名稱

    • ZONE:包含開機磁碟的區域

  2. 確認輸出結果是否類似下列內容:

    creationTimestamp: '2021-05-05T15:26:27.835-07:00'
    id: '727854272460268924'
    interface: SCSI
    kind: compute#disk
    labelFingerprint: 42WmSpB8rSM=
    lastAttachTimestamp: '2021-05-05T15:26:27.836-07:00'
    licenseCodes:
    - '1000006'
    - '6213885950785916969'
    licenses:
    - https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/RHEL_VERSION
    multiWriter: false
    name: VM_NAME
    physicalBlockSizeBytes: '4096'
    selfLink: https://www.googleapis.com/compute/beta/projects/PROJECT_NAME/zones/ZONE/disks/DISK_NAME
    selfLinkWithId: https://www.googleapis.com/compute/beta/projects/PROJECT_NAME/zones/ZONE/disks/DISK_ID
    sizeGb: '20'
    sourceImage: https://www.googleapis.com/compute/beta/projects/IMAGE_PROJECT/global/images/IMAGE
    sourceImageId: '7397991294075835597'
    status: READY
    type: https://www.googleapis.com/compute/beta/projects/PROJECT_NAME/zones/ZONE/diskTypes/DISK_TYPE
    userLicenses:
    - https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/RHEL_ELS_VERSION
    users:
    - https://www.googleapis.com/compute/beta/projects/PROJECT_NAME/zones/ZONE/instances/VM_NAME
    zone: https://www.googleapis.com/compute/beta/projects/PROJECT_NAME/zones/ZONE
    
  3. 檢查上一個步驟的輸出內容,確認 userLicenses 欄位是否有適當的授權字串,藉此驗證 RHEL ELS 授權已附加至 Linux VM 開機磁碟。

    如果 userLicenses 欄位未包含預期的授權字串,您可能需要清除使用者授權,然後再更新。詳情請參閱 gcloud beta compute disks update 指令

  4. 使用 gcloud compute instances start 指令啟動 VM:

    gcloud compute instances start VM_NAME \
       [--csek-key-file ENCRYPTION_KEY]
    

    更改下列內容:

    • VM_NAME:要啟動的 VM 名稱

    • ENCRYPTION_KEY:選用標記,如果開機磁碟已加密,則指定客戶提供的加密金鑰 (CSEK) 檔案路徑

安裝 RHUI ELS 用戶端套件

將授權字串附加至 RHEL 磁碟後,請連線至 VM 並執行下列指令,在 VM 上安裝 RHUI ELS 用戶端套件:

RHEL 7

  1. 請確認您使用的是 RHEL 7.9 或 RHEL 7.9 for SAP:

     cat /etc/redhat-release
     

  2. 下載並安裝最新更新:

     sudo yum -y update
     

  3. 移除 RHUI 用戶端套件,並安裝 RHUI ELS 用戶端套件:

     sudo yum -y remove google-rhui-client-rhel7 google-rhui-client-rhel79-sap google-rhui-client-rhel7-sap
     sudo yum makecache
     sudo yum -y install google-rhui-client-rhel7-els
     

RHEL 6

  1. 確認您使用的是 RHEL 6.10:

     cat /etc/redhat-release
     

  2. 下載並安裝最新更新:

     sudo yum -y update
     

  3. 移除 RHUI 用戶端套件,並安裝 RHUI ELS 用戶端套件:

     sudo yum -y remove google-rhui-client-rhel6
     sudo yum makecache
     sudo yum -y install google-rhui-client-rhel6-els
     

查看稽核記錄

請按照下列程序查看授權更新記錄:

  1. 前往 Google Cloud 控制台中的「活動」頁面。

    前往「活動」

  2. 在「類別」的「篩選器」窗格中,針對「活動類型」選取「設定」

  3. 在「Categories」的「Filters」窗格中,針對「Resource type」選取「Disk」