0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

KVMで仮想マシンを別のホストにコピーする方法

0
Posted at

コピー元ホスト

・VMの設定情報(xml)のエクスポート

sudo virsh dumpxml zabbix6 > /tmp/vm.xml

・VMの設定情報(xml)の転送

scp ./vm.xml user@xxx.xxx.xxx.xxx:/tmp

・VMのイメージファイル(qcow2)の転送

scp /var/lib/libvirt/images/vm.qcow2 user@xxx.xxx.xxx.xxx:/tmp

・コピー先ホストにログイン

ssh user@xxx.xxx.xxx.xxx

コピー先ホスト

・イメージファイルの移動

mv -i /tmp/vm.qcow2 /var/lib/libvirt/images/

・VM一覧の確認

sudo virsh list --all

・VMの設定情報(xml)のインポート

sudo virsh define /tmp/vm.xml

・VMのイメージファイル(qcow2)の配置

sudo mv -i /tmp/vm.qcow2 /var/lib/libvirt/images/

・VM一覧の確認

sudo virsh list --all

・VMの起動

sudo virsh start vm

・VMのステータス確認

sudo virsh list --all
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?