查看及自訂 VM 資訊主頁

完成下列任務,瞭解如何查看及自訂 Compute Engine 虛擬機器 (VM) 執行個體的資訊主頁:

  1. 建立 Compute Engine VM 執行個體。
  2. 查看預設資訊主頁。
  3. 自訂預設資訊主頁。
  4. 清除所用資源。

如要直接在 Google Cloud 控制台按照逐步指南操作,請按一下「Guide me」(逐步引導)

逐步引導


事前準備

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Compute Engine and Cloud Monitoring APIs.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Compute Engine and Cloud Monitoring APIs.

    Enable the APIs

  8. 建立 VM 執行個體

    如果您還沒有 VM 執行個體,請先建立:

    1. 前往 Google Cloud 控制台的「VM instances」(VM 執行個體) 頁面

      前往「VM instances」(VM 執行個體) 頁面

      如果您是使用搜尋列尋找這個頁面,請選取子標題為「Compute Engine」的結果

    2. 點選「Create instance」(建立執行個體) 建立 VM。使用導覽選單中的選項,設定執行個體。
    3. 在「Machine configuration」(機器設定) 選項中,執行下列操作:
      1. 在「Name」(名稱) 欄位輸入描述性名稱。
      2. 在「Machine type」(機型) 預設下拉式選單,依序選取「Shared-core」(共用核心) >「e2-small」
    4. 確認「OS and storage」(OS 與儲存空間) 選項顯示「Debian GNU/Linux」。如果沒有,請依序點選「OS and storage」(OS 與儲存空間) 和「Change」(變更)。在「Boot disk」(開機磁碟) 對話方塊中,將「Version」(版本) 設為「Debian GNU/Linux」
    5. 按一下 [建立]。

    查看 VM 的觀測能力資訊主頁

    觀測能力資訊主頁會顯示使用率指標、處理量指標,以及記錄相關資料:

    1. 前往 Google Cloud 控制台的「VM instances」(VM 執行個體) 頁面

      前往「VM instances」(VM 執行個體) 頁面

      如果您是使用搜尋列尋找這個頁面,請選取子標題為「Compute Engine」的結果

    2. 在「VM instances」(VM 執行個體) 頁面中,按一下執行個體名稱。
    3. 選取「Observability」(觀測能力) 分頁標籤。

      如有建立 VM,可能需要過幾分鐘後,圖表才會顯示資料。

    4. 查看「Observability」(觀測能力) 分頁中的圖表。

    建立自訂觀測能力資訊主頁

    如要建立可編輯的觀測能力資訊主頁副本,請按照下列步驟操作:

    1. 在「Observability」(觀測能力) 工具列中,按一下「Save as dashboard」(儲存為資訊主頁)
    2. 點選「Submit」(提交)
    3. 按一下「View in Monitoring」(在 Monitoring 中查看)

      您現在正在查看可自訂的資訊主頁。這個資訊主頁是由 Cloud Monitoring 管理。

      如要新增小工具,請按一下「Add widget」(新增小工具) 並完成對話方塊。 舉例來說,如要查看含有指標資料的記錄檔,請按一下「Add widget」(新增小工具),選取「Logs」(記錄檔),然後按一下「Apply」(套用)

      如要移除或修改小工具,請使用小工具工具列中的選項。

      如要調整小工具的位置或大小,請使用指標。

    4. 如果您修改了副本,請按一下「Save」(儲存)

    5. 在導覽窗格中,選取「Dashboards」(資訊主頁)

      在「My Dashboards」(我的資訊主頁) 窗格,您會看到新的資訊主頁列於其中。

    您已成功自訂 Compute Engine VM 執行個體的觀測能力資訊主頁。您可以按照同樣的程序,為許多其他 Google Cloud 資源自訂資訊主頁。

    查看 Monitoring 建立的 VM 資訊主頁

    Cloud Monitoring 會建立及管理多個資訊主頁,用於顯示 VM 執行個體的指標。您可以透過 Cloud Monitoring 的「Dashboards」頁面存取這些資訊主頁:

    1. 在 Google Cloud 控制台中,前往「Dashboards」(資訊主頁) 頁面:

      前往「Dashboards」(資訊主頁)

      如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果

    2. 如要查看執行個體專屬資訊主頁,請在「My Dashboards」(我的資訊主頁) 窗格中按一下「VM instances」(VM 執行個體)

      「VM instances」(VM 執行個體) 頁面會列出您的 VM,並包含 VM 專屬資訊主頁的連結。這些資訊主頁是由 Cloud Monitoring 建立及代管。

    3. 如要查看所有 VM 的指標,請在導覽窗格中依序選取「Dashboards」(資訊主頁) 和「GCE VM Instance Monitoring」(GCE VM 執行個體監控) 資訊主頁。

      如要建立這個資訊主頁的可編輯副本,請按一下「Copy Dashboard」(複製資訊主頁)

清除所用資源

如要避免系統向您的 Google Cloud 帳戶收取您在本頁所用資源的費用,請按照下列步驟操作。

如果您建立新專案,但現在已不再需要該專案,請刪除專案

如果您使用的是現有專案,請執行下列操作:

  1. 如果您已建立 VM,請刪除該 VM:

    1. In the Google Cloud console, go to the VM instances page.

      Go to VM instances

    2. Select the checkbox for the instance that you want to delete.
    3. To delete the instance, click More actions, click Delete, and then follow the instructions.
  2. 刪除您建立的資訊主頁:

    1. 在 Google Cloud 控制台中,前往「Dashboards」(資訊主頁) 頁面:

      前往「Dashboards」(資訊主頁)

      如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果

    2. 找到您建立的資訊主頁,然後按一下「Delete」(刪除)

後續步驟