ユーザ用ツール

サイト用ツール


os:xcpng:movevm

VMの移動

Pool間でのVM移動

poolをまたいでの直接の移動はサポートされていないため、export、importを介した移動となる

  1. 元VMでexpoert
  2. fileコピー
  3. 移行先Poolでimport

今回は、snapshotを作成してのexport、importを行う。
また、fileの移動はnfsを利用することで割愛するものとした

zfs/nfsについては割愛する。

準備作業

元、先のpoolでnfsマウント

# mkdir -p /mnt/xcp_share
# mount -t nfs <nfsサーバ>:<共有Dir>  /mnt/xcp_share

VM エクスポート

対象vm、snapshotを探す

VM一覧

# xe vm-list
# xe vm-list name-label=xxxx

snapshot一覧

# xe vm-list params=snapshots name-label=VMNAME
# xe snapshot-list

snapshotの詳細

# xe vm-param-list uuid=fcc49d6b-7309-xxxx-xxxx-123456789abc

特定のパラメータ

# xe vm-param-get uuid=fcc49d6b-7309-xxxx-xxxx-123456789abc param-name=name-label

export

# xe vm-export uuid=<snapshot_uuid> filename="/mnt/xcp_share/src_snapshot.xva"

圧縮する場合1)2)

# xe vm-export uuid=<snapshot_uuid> filename="/mnt/xcp_share/src_snapshot.xva" compress=zstd
# xe vm-export uuid=<snapshot_uuid> filename="/mnt/xcp_share/src_snapshot.xva" compress=true

VM インポート

import先のsrを探す

# xe sr-list

import

# xe vm-import filename=/mnt/xcp_share/src_snapshot.xva sr-uuid=7a5b89abc-1f2d-xxxx-xxxx-123456789abc
1)
zstdはxcp-ngのみ対応
2)
importの際は指定不要
os/xcpng/movevm.txt · 最終更新: 2025/05/19 03:15 by hayashi