XenServer7.6命令行导出导入虚拟机(迁移)
一:命令行方法导出虚拟机(先关闭虚拟机)
1.1:打印虚拟机列表
xe vm-list
uuid ( RO) : 43dfac04-515e-7769-b2d2-444d4b7cb198 name-label ( RW): hk-zabbix-01 power-state ( RO): halted
1.2:查看挂载盘
df -h
[root@xenserver-hk-01 ~]# df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 2.0G 44K 2.0G 1% /dev tmpfs 2.0G 504K 2.0G 1% /dev/shm tmpfs 2.0G 4.1M 2.0G 1% /run tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup /dev/sda1 18G 8.9G 7.9G 53% / xenstore 2.0G 0 2.0G 0% /var/lib/xenstored /dev/loop0 45M 45M 0 100% /var/xen/xc-install /dev/sda4 512M 2.0M 510M 1% /boot/efi /dev/sda5 3.9G 708M 3.0G 20% /var/log //192.168.10.10/soft 500G 49G 452G 10% /run/sr-mount/21c3c475-28c7-26b7-2abb-9bd8b011eb1e
192.168.10.10:/nfs/iso 18G 8.9G 7.9G 53% /run/sr-mount/a3ab3cfb-645d-54a0-9c49-9462bd66a7c3
1.3:导出虚拟机到共享存储盘
xe vm-export vm=hk-zabbix-01 filename=/run/sr-mount/21c3c475-28c7-26b7-2abb-9bd8b011eb1e/hk-zabbix-01.xva
1.4:导入虚拟机
xe vm-import filename=/run/sr-mount/21c3c475-28c7-26b7-2abb-9bd8b011eb1e/hk-zabbix-01.xva
因硬盘未创建SR,有报错
[root@xenserver 21c3c475-28c7-26b7-2abb-9bd8b011eb1e]# xe vm-import filename=/run/sr-mount/21c3c475-28c7-26b7-2abb-9bd8b011eb1e/hk-zabbix-01.xva Error: No SR specified and Pool default SR is null
在能访问到共享盘的机器上登陆xencenter,用界面做导入操作,可以成功
感谢:
https://www.codercto.com/a/3311.html