xenserver 模板导出导入
由于业务需求,新增一台xenserver,需要将原先创建好的模板环境导入到新的母机上面,此处记录一下
1、导出模板
# 获取需要导出的模板uuid
[root@localhost ~]# xe template-list| grep -B1 'centos'
uuid ( RO) : cd78604c-4e7b-d6b5-df4a-31b45a1477c1
name-label ( RW): centos_6.9_x64 - nginx 1.10 环境
--
uuid ( RO) : 003912cc-8034-765c-b36e-a30642d5f4c9
name-label ( RW): centos_6.9_x64 - db 模板
--
uuid ( RO) : 909a8fcd-b8bd-25c4-ea50-cefc9c9c69e4
name-label ( RW): centos_6.9_x64 - init (系统已优化)
--
uuid ( RO) : 57869574-fd74-9a21-2352-0ea12c4066cf
name-label ( RW): centos_6.9_x64 - web 模板
# 将指定的模板导出
[root@localhost ~]# xe template-export template-uuid=909a8fcd-b8bd-25c4-ea50-cefc9c9c69e4 filename=/data/'centos_6.9_x64 - init'.xva
2、导入模板
# 查找要导入磁盘的uuid
[root@localhost ~]# xe sr-list | grep -B1 Disk
uuid ( RO) : 9ce44ce9-61b3-868f-0d05-226b2dff364a
name-label ( RW): Disk 2
# 将模板导入
[root@localhost ~]# xe vm-import filename=/data/"centos_6.9_x64 - init.xva" sr-uuid=9ce44ce9-61b3-868f-0d05-226b2dff364a