博客
关于我
记录如何在KVM上手动部署山石vfw
阅读量:188 次
发布时间:2019-02-28

本文共 4169 字,大约阅读时间需要 13 分钟。

准备工作

KVM环境

  • 确认宿主机支持KVM虚拟化,下面命令返回值不应该为空
#egrep '^flags.*(vmx|svm)' /proc/cpuinfo
  • 确认软件版本(建议CentOS7.x)
# cat /etc/redhat-release
  • 安装相关软件
# yum install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install -y

Linux bridge

  • 该bridge用来提供VFW的管理/控制面连通性
  • 创建bridge后将宿主机的管理接口加入到该bridge上
# brctl showbridge name	bridge id		STP enabled	interfacesvirt-mgmt-br		8000.20040fe827d4	no		em1
  • 在该bridge上配置宿主机原来的管理IP和需要的路由

OVS bridge

  • 需要将要加入的OVS bridge建好,例如"xyzbr0"
  • 后续VFW的数据口都会加入到这个bridge上

安装VFW虚机和OVS配置

文件准备

  • 创建并进入目录
# pwd/opt/hillstone-cmd-libvirt# lltotal 2097760-rw-r--r--. 1 root root        258 Jan 11 15:55 hillstone-br0-rw-r--r--. 1 root root        135 Jan 11 14:51 hillstone-br1-rw-r--r--. 1 root root        135 Jan 11 14:52 hillstone-br2-rw-r--r--. 1 root root        135 Jan 11 14:52 hillstone-br3-rw-r--r--. 1 root root        135 Jan 11 14:52 hillstone-br4-rw-r--r--. 1 root root        135 Jan 11 14:52 hillstone-br5-rwxrwxrwx. 1 root root        762 Jan 11 16:07 install.sh-rw-r--r--. 1 root root        133 Jan 11 16:09 xyzbr-network.xml-rw-r--r--. 1 qemu qemu 2148073472 Jan 12 12:17 SG6000-CloudEdge-5.5R5-VM01-v6.qcow2```shell* VFW的镜像文件先要准备好```shell# ll | grep qcow2-rw-r--r--. 1 qemu qemu 2148073472 Jan 12 10:57 SG6000-CloudEdge-5.5R5-VM01-v6.qcow2
  • 加载描述bridge信息的xml文件
# cat xyzbr-network.xml
xyzbr0
# virsh net-define xyzbr-network.xml # virsh net-start xyzbr0# virsh net-autostart xyzbr0
  • 定义管理口的文件(目前使用VFW的eth0/0),指向之前创建的Linux bridge
# cat hillstone-br0
hillstone-br0
  • 定义其它接口的文件,以br1为例,其它只是改一下br编号
# cat hillstone-br1
hillstone-br1
  • 添加安装脚本
# cat install.sh virt-install \    --name hillstone \    --wait 0 \    --os-type linux \    --virt-type kvm \    --accelerate \    --vnc --vnclisten 0.0.0.0 \    --ram 2048 \    --vcpus 2 \    --boot cdrom \    --disk path=/opt/hillstone-cmd-libvirt/SG6000-CloudEdge-5.5R5-VM01-v6.qcow2,device=disk,bus=ide,format=qcow2 \    --serial tcp,host=0.0.0.0:8123,mode=bind,protocol=telnet \    --network network=xyzbr0,model=virtio,target=he0 \    --network network=xyzbr0,model=virtio,target=he1 \    --network network=xyzbr0,model=virtio,target=he2 \    --network network=xyzbr0,model=virtio,target=he3 \    --network network=xyzbr0,model=virtio,target=he4 \    --network network=xyzbr0,model=virtio,target=he5 \    --network network=xyzbr0,model=virtio,target=he6

安装设置和串口登录

  • 安装只需要执行脚本即可
# ./install.sh WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.Starting install...Domain creation completed.#
  • 启动并查看相关信息
# virsh start hillstone## virsh list Id    Name                           State---------------------------------------------------- 4     hillstone                      running## virsh domiflist hillstoneInterface  Type       Source     Model       MAC-------------------------------------------------------he0        bridge     xyzbr0     virtio      52:54:00:9a:51:32he1        bridge     xyzbr0     virtio      52:54:00:44:e3:98he2        bridge     xyzbr0     virtio      52:54:00:9c:ae:d4he3        bridge     xyzbr0     virtio      52:54:00:e8:4b:b8he4        bridge     xyzbr0     virtio      52:54:00:51:ee:11he5        bridge     xyzbr0     virtio      52:54:00:f2:84:0ahe6        bridge     xyzbr0     virtio      52:54:00:74:6d:9d
  • 设置OVS上接口(自然不包含连到Linux bridge)的vlan id,此处先以x来举例
ovs-vsctl set port he2 tag=x
  • telnet登录console口,端口号在创建时候指定,默认用户名密码:hillstone/hillstone
# telnet localhost 8123Trying ::1...telnet: connect to address ::1: Connection refusedTrying 127.0.0.1...Connected to localhost.Escape character is '^]'.login:

#VFW配置和验证

##基本配置

  • 管理口配置和网关配置,供远程ssh/web登录配置
configureinterface eth0/0no ip address dhcpip address 10.25.130.100/16  manage ssh  manage ping  manage snmp  manage httpsexitip vrouter trust-vrip route 0.0.0.0/0 10.25.0.1exit
  • 如果需要配置HA,指定心跳线出口
ha link interface ethernet0/5ha link ip 2.2.2.1 255.255.255.0ha group 0ha cluster 1 node 1
  • 配置业务接口,未来作为内网虚机的网关,下面是一个例子
interface eth0/1zone trustno ip address dhcpip address 10.3.3.254/254 manage ping
  • 如果内网业务需要做DNAT对外网呈现,建议使用web来配置更加方便
  • HA的参数配置(略)

转载地址:http://soln.baihongyu.com/

你可能感兴趣的文章
mysqlreport分析工具详解
查看>>
MySQLSyntaxErrorException: Unknown error 1146和SQLSyntaxErrorException: Unknown error 1146
查看>>
Mysql_Postgresql中_geometry数据操作_st_astext_GeomFromEWKT函数_在java中转换geometry的16进制数据---PostgreSQL工作笔记007
查看>>
mysql_real_connect 参数注意
查看>>
mysql_secure_installation初始化数据库报Access denied
查看>>
MySQL_西安11月销售昨日未上架的产品_20161212
查看>>
Mysql——深入浅出InnoDB底层原理
查看>>
MySQL“被动”性能优化汇总
查看>>
MySQL、HBase 和 Elasticsearch:特点与区别详解
查看>>
MySQL、Redis高频面试题汇总
查看>>
MYSQL、SQL Server、Oracle数据库排序空值null问题及其解决办法
查看>>
mysql一个字段为空时使用另一个字段排序
查看>>
MySQL一个表A中多个字段关联了表B的ID,如何关联查询?
查看>>
MYSQL一直显示正在启动
查看>>
MySQL一站到底!华为首发MySQL进阶宝典,基础+优化+源码+架构+实战五飞
查看>>
MySQL万字总结!超详细!
查看>>
Mysql下载以及安装(新手入门,超详细)
查看>>
MySQL不会性能调优?看看这份清华架构师编写的MySQL性能优化手册吧
查看>>
MySQL不同字符集及排序规则详解:业务场景下的最佳选
查看>>
Mysql不同官方版本对比
查看>>