透過命令列(CLI)介面匯入作業系統映像檔,或從其他虛擬化平台遷移虛擬機器
在部署虛擬機器之前,請使用命令列(CLI)介面將作業系統映像檔上傳並匯入 CubeCOS。 映像檔上傳遵循分階段的流程。
我們的網站上提供現成的雲端映像檔。 前往下載專區
透過 SCP 或 WinSCP 上傳圖片
請使用 SCP(或在 Windows 上使用 WinSCP)將您的映像檔傳輸至 CubeCOS 儲存路徑:
請替換以下變數:
<image-name>:映像檔名稱<format>:以下任何一種受支援的虛擬硬碟格式。- qcow2
- 原始
- vmdk
- vhd
- 卵子
- img
- 核心
<your-cluster-vip>:請替換為您的叢集 VIP。 對於單節點部署,請使用該節點的管理 IP 位址。
scp <image-name>.<format> root@<your-cluster-vip>:/mnt/cephfs/glance/.
連線至命令列(CLI)介面
以 admin 使用者身分透過 SSH 連線至該裝置:
$ ssh admin@<your-cluster-vip>
Password:
Welcome to the Cube Appliance
Enter "help" for a list of available commands
controller>
匯入映像檔
請根據您要匯入的內容選擇匯入模式:
- 作為映像檔:用於設定新虛擬機器的雲端作業系統映像檔與範本。
- 作為硬碟:針對從其他平台(例如 VMware 或 Hyper-V)匯出的虛擬機器硬碟,可直接匯入專案中作為可開機硬碟。
- As an template image
- As a volume
-
執行映像檔匯入指令:
Admin CLI terminalcontroller> iaas image import -
選擇映像檔來源位置。
請選擇
local從本地檔案系統匯入,或選擇usb從 USB 裝置匯入。:::資訊[USB 儲存裝置預設為停用狀態]
若要啟用 USB 存取功能,請以管理員身分登入,並透過 命令列(CLI)介面 > 調校 > 設定,將調校選項
cubesys.probeusb設為true。:::
Admin CLI terminal1: usb2: localEnter index: 2 -
請選擇要匯入的映像檔。
請替換以下變數:
<image-name>:映像檔名稱<format>:以下任何一種受支援的虛擬磁碟格式:qcow2、raw、vmdk、vhd、ova、img 及 kernel。
Admin CLI terminal1: <image-template-name>.<format># ubuntu2204.qcow2 is an example image to be importedEnter index: 1 -
請輸入映像檔名稱:
請替換以下變數:
<imported-image-name>:設定映像檔匯入 CubeCOS 後將顯示的映像檔名稱。
Admin CLI terminalSpecify image name: <imported-image-name> -
請選擇網域:
Admin CLI terminal1: defaultEnter index: 1 -
請選擇租戶:
您的 CubeCOS 叢集中可能包含許多租戶(專案)。 請選擇租戶(專案)作為映像檔的儲存位置。
Admin CLI terminal1: adminEnter index: 1 -
若要匯入範本映像檔或雲端映像檔,請針對原生 CubeCOS 映像檔選擇 來自 Bigstack:
Admin CLI terminalImage source:1: from Bigstack2: from another hypervisorEnter index: 1 -
選擇匯入的範本映像檔的顯示狀態。
public映像檔:此映像檔將供叢集中的所有專案使用。private映像檔:此映像檔僅限目標專案存取。
Admin CLI terminalVisibility:1: public2: privateEnter index: 1 -
請選擇儲存位置:
預設的 Ceph SDS 會標記為
CubeStorage,或任何其他已整合的外部儲存裝置。Admin CLI terminal1: CubeStorageEnter index: 1 -
請選擇虛擬機器作業系統。
:::警告[選擇正確的作業系統非常重要]
選擇錯誤的類型可能會對效能造成顯著影響:
:::
Admin CLI terminalSelect OS (big impacts to performance if it's windows):1: CentOS2: Fedora3: Ubuntu4: Debian5: Windows6: Rocky7: FreeBSD8: CoreOS9: Arch10: OthersEnter index: 10 -
請等待匯入完成:
Admin CLI terminalImporting...[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-vol21Importing migrate-vol21 complete. It is safe to remove the local image file.
-
執行映像檔匯入指令:
Admin CLI terminalcontroller> iaas image import -
選擇映像檔來源位置。
請選擇
local從本地檔案系統匯入,或選擇usb從 USB 裝置匯入。:::資訊[USB 儲存裝置預設為停用狀態]
若要啟用 USB 存取功能,請以管理員身分登入,並透過 命令列(CLI)介面 > 調校 > 設定,將調校選項
cubesys.probeusb設為true。:::
Admin CLI terminal1: usb2: localEnter index: 2 -
請選擇要匯入的映像檔。
請替換以下變數:
<image-name>:映像檔名稱<format>:以下任何一種受支援的虛擬磁碟格式:qcow2、raw、vmdk、vhd、ova、img 及 kernel。
Admin CLI terminal1: <image-template-name>.<format># ubuntu2204.qcow2 is an example image to be importedEnter index: 1 -
請輸入映像檔名稱:
請替換以下變數:
<imported-image-name>:設定映像檔匯入 CubeCOS 後將顯示的映像檔名稱。
Admin CLI terminalSpecify image name: <imported-image-name> -
請選擇網域:
Admin CLI terminal1: defaultEnter index: 1 -
請選擇租戶:
您的 CubeCOS 叢集中可能包含許多租戶(專案)。 請選擇租戶(專案)作為映像檔的儲存位置。
Admin CLI terminal1: adminEnter index: 1 -
若要匯入範本映像檔或雲端映像檔,請針對原生 CubeCOS 映像檔選擇 來自 Bigstack:
所有命令列(CLI)介面已匯入
Admin CLI terminalImage source:1: from Bigstack2: from another hypervisorEnter index: 2 -
請選擇儲存位置:
預設的 Ceph SDS 會標記為
CubeStorage,或任何其他已整合的外部儲存裝置。Admin CLI terminal1: CubeStorageEnter index: 1 -
請選擇虛擬機器作業系統。
:::警告[選擇正確的作業系統非常重要]
選擇錯誤的類型可能會對效能造成顯著影響:
:::
Admin CLI terminalSelect OS (big impacts to performance if it's windows):1: CentOS2: Fedora3: Ubuntu4: Debian5: Windows6: Rocky7: FreeBSD8: CoreOS9: Arch10: OthersEnter index: 10 -
請等待匯入完成:
Admin CLI terminalImporting...[14:31:03] Converting image to RAW format ...[ 0.0] Setting up the source: -i disk /mnt/cephfs/glance/rocky_9.qcow2[ 1.1] Opening the source[ 9.6] Inspecting the source[ 14.2] Checking for sufficient free disk space in the guest[ 14.2] Converting Rocky Linux 9.5 (Blue Onyx) (rocky9) to run on KVMvirt-v2v: This guest has virtio drivers installed.[ 71.6] Setting a random seed[ 71.7] SELinux relabelling[ 77.3] Mapping filesystem data to avoid copying unused and blank areas[ 78.8] Closing the overlay[ 79.0] Assigning disks to buses[ 79.0] Checking if the guest needs BIOS or UEFI to boot[ 79.0] Setting up the destination: -o disk -os /tmp[ 80.0] Copying disk 1/1[ 84.5] Creating output metadata[ 84.5] Finishing off[14:32:37] Importing image migrate-vmdk21 ...Importing image: 100% complete...done.[14:32:58] Finished creating image migrate-vmdk21Importing migrate-vmdk21 complete. It is safe to remove the local image file.