跳到主內容
版本:3.1

透過命令列(CLI)介面匯入作業系統映像檔,或從其他虛擬化平台遷移虛擬機器

在部署虛擬機器之前,請使用命令列(CLI)介面將作業系統映像檔上傳並匯入 CubeCOS。 映像檔上傳遵循分階段的流程。

資訊

我們的網站上提供現成的雲端映像檔。 前往下載專區

透過 SCP 或 WinSCP 上傳圖片

請使用 SCP(或在 Windows 上使用 WinSCP)將您的映像檔傳輸至 CubeCOS 儲存路徑:

請替換以下變數:

  • <image-name>:映像檔名稱
  • <format>:以下任何一種受支援的虛擬硬碟格式。
    • qcow2
    • 原始
    • vmdk
    • vhd
    • 卵子
    • img
    • 核心
  • <your-cluster-vip>:請替換為您的叢集 VIP。 對於單節點部署,請使用該節點的管理 IP 位址。
The local terminal
scp <image-name>.<format> root@<your-cluster-vip>:/mnt/cephfs/glance/.

連線至命令列(CLI)介面

以 admin 使用者身分透過 SSH 連線至該裝置:

The local terminal
$ ssh admin@<your-cluster-vip>
Password:
Welcome to the Cube Appliance
Enter "help" for a list of available commands
controller>

匯入映像檔

請根據您要匯入的內容選擇匯入模式:

  1. 作為映像檔:用於設定新虛擬機器的雲端作業系統映像檔與範本。
  2. 作為硬碟:針對從其他平台(例如 VMware 或 Hyper-V)匯出的虛擬機器硬碟,可直接匯入專案中作為可開機硬碟。
  1. 執行映像檔匯入指令:

    Admin CLI terminal
    controller> iaas image import
  2. 選擇映像檔來源位置。

    請選擇 local 從本地檔案系統匯入,或選擇 usb 從 USB 裝置匯入。

    :::資訊[USB 儲存裝置預設為停用狀態]

    若要啟用 USB 存取功能,請以管理員身分登入,並透過 命令列(CLI)介面 > 調校 > 設定,將調校選項 cubesys.probeusb 設為 true

    :::

    Admin CLI terminal
    1: usb
    2: local
    Enter index: 2
  3. 請選擇要匯入的映像檔。

    請替換以下變數:

    • <image-name>:映像檔名稱
    • <format>:以下任何一種受支援的虛擬磁碟格式:qcow2、raw、vmdk、vhd、ova、img 及 kernel。
    Admin CLI terminal
    1: <image-template-name>.<format>
    # ubuntu2204.qcow2 is an example image to be imported
    Enter index: 1
  4. 請輸入映像檔名稱:

    請替換以下變數:

    • <imported-image-name>:設定映像檔匯入 CubeCOS 後將顯示的映像檔名稱。
    Admin CLI terminal
    Specify image name: <imported-image-name>
  5. 請選擇網域:

    Admin CLI terminal
    1: default
    Enter index: 1
  6. 請選擇租戶:

    您的 CubeCOS 叢集中可能包含許多租戶(專案)。 請選擇租戶(專案)作為映像檔的儲存位置。

    Admin CLI terminal
    1: admin
    Enter index: 1
  7. 若要匯入範本映像檔或雲端映像檔,請針對原生 CubeCOS 映像檔選擇 來自 Bigstack

    Admin CLI terminal
    Image source:
    1: from Bigstack
    2: from another hypervisor
    Enter index: 1
  8. 選擇匯入的範本映像檔的顯示狀態。

    1. public 映像檔:此映像檔將供叢集中的所有專案使用。
    2. private 映像檔:此映像檔僅限目標專案存取。
    Admin CLI terminal
    Visibility:
    1: public
    2: private
    Enter index: 1
  9. 請選擇儲存位置:

    預設的 Ceph SDS 會標記為 CubeStorage,或任何其他已整合的外部儲存裝置。

    Admin CLI terminal
    1: CubeStorage
    Enter index: 1
  10. 請選擇虛擬機器作業系統。

    :::警告[選擇正確的作業系統非常重要]

    選擇錯誤的類型可能會對效能造成顯著影響:

    :::

    Admin CLI terminal
    Select OS (big impacts to performance if it's windows):
    1: CentOS
    2: Fedora
    3: Ubuntu
    4: Debian
    5: Windows
    6: Rocky
    7: FreeBSD
    8: CoreOS
    9: Arch
    10: Others
    Enter index: 10
  11. 請等待匯入完成:

    Admin CLI terminal
    Importing...
    [14:23:44] Converting image to RAW format ...
    (100.00/100%)
    [14:23:50] Importing image migrate-vol21 ...
    [=============================>] 100%
    # output truncated
    | visibility | public |
    +---------------------+----------------------------------------------------------------------------------+
    [14:26:08] Finished creating image migrate-vol21
    Importing migrate-vol21 complete. It is safe to remove the local image file.