随着技术的发展许多厂商都发布了基于虚拟化的网络设备镜像,这些镜像默认在PnetLab是没有的,需要我们手动添加,把第三方的qcow2设备镜像添加到PnetLab中主要分三步。
1.上传镜像文件
将镜像文件上传到/opt/unetlab/addons/qemu,镜像文件目录名一定要为xxx-xxx如:hillstone-sg6000,test-1,镜像文件名为hda.qcow2,hdd.qcow2,按照顺序排列
2.创建模板文件
在/opt/unetlab/html/templates/目录下下创建xxx.yml,所有的templates文件都放在/opt/unetlab/html/templates/
目录里面,可以复制一个已有的来修改保存,也可以自己创建一个
eve-ng模板文件目录按cpu做了区分/opt/unetlab/html/templates/intel/ |/opt/unetlab/html/templates/amd/
模板文件内容
huaweiusg6kv.yml
---
type: qemu
description: Huawei USG6000v
name: HUSG6000v
cpulimit: 1
icon: Firewall.png
cpu: 2
ram: 4096
ethernet: 6
console: vnc
qemu_arch: x86_64
qemu_version: 4.1.0
qemu_nic: virtio-net-pci
qemu_options: -machine type=pc,accel=kvm -vga std -usbdevice tablet -boot order=cd
...
3.修改config文件
第一次需要创config.php文件
mv /opt/unetlab/html/includes/config.php.distribution /opt/unetlab/html/includes/config.php
修改config.php文件,添加新设备的模板名称和版本
<?php
// TEMPLATE MODE .missing(显示所有的设备) or .hided(隐藏没有镜像文件设备)
DEFINE('TEMPLATE_DISABLED','.missing') ;
/* Define custom templates:
*
* Create for exemple /opt/unetlab/html/templates/mytemplate.yaml and Create /opt/unetlab/html/templates/othertemplate.yaml
* Then uncomment lines below
*/
$custom_templates = Array(
//模板名称 版本
'hillstone' => 'hillstone5.5R1',
);
?>
启动镜像需要cpu开启虚拟化
更多内容请关注bogl