How To Deploy STC VM by QEMU?

Introduction

Virtual STC inclulde 3 components:

  • License Server VM
  • Application: Spirent TestCenter
  • Virtual TestCenter: STC port VM

Different platoform have diff version, e.g Virtual TestCenter have ESXi platform or QEMU platform, different platform have diff License, if use incorrect platform or License, will have alarm, e.g:

So I summarized hwo to deploy STC VM by QEMU in the article.

Install CentOS 7 and config basic config

Config network adapter after install system

[root@localhost ~]# more /etc/sysconfig/network-scripts/ifcfg-ens192 
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens192
UUID=18aeb3df-a3ce-4550-96d3-3bbe236cdb01
DEVICE=ens192
ONBOOT=yes
IPADDR0=10.75.58.101
PREFIX0=24
GATEWAY0=10.75.58.1
DNS1=x.x.x.x
DOMAIN=cisco.com

Change hostname and added local DNS

[root@localhost ~]# hostnamectl status
   Static hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 7722efff25664298a497dec2458b7288
           Boot ID: 17cda692aefc4a0a9ff7fa53498cd8d4
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1127.el7.x86_64
      Architecture: x86-64
[root@localhost ~]# 
[root@localhost ~]# hostnamectl set-hostname frank
[root@localhost ~]# 
[root@localhost ~]# hostnamectl status --static
frank
[root@localhost ~]# more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.75.58.101    frank     frank.cisco.com
[root@localhost ~]# 
[root@localhost ~]# ping frank
PING frank (10.75.58.101) 56(84) bytes of data.
64 bytes from frank (10.75.58.101): icmp_seq=1 ttl=64 time=0.069 ms
64 bytes from frank (10.75.58.101): icmp_seq=2 ttl=64 time=0.024 ms
^C
--- frank ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.024/0.046/0.069/0.023 ms
[root@localhost ~]# 
[root@localhost ~]# more /etc/resolv.conf
# Generated by NetworkManager
search cisco.com
nameserver x.x.x.x

Deploy Virtual TestCenter

There are four ways,due to image is QEMU, so suggest to use first or second:

  1. Server is Linux, direct to use KVM/QEMU + PCI Passthrough
  2. Server is Linux, direct to use KVM/QEMU + Bridge
  3. Server is ESXI, require nested virtualization, ESXI do PCI Passthrough first, then Linux VM do PCI Passthrough second… <— my testbed
  4. Server is ESXI, direct to use KVM/QEMU + Bridge on Linux VM

After install the STCv by install guide (can be found at the end of the article), do “installer/setup_setup_mgmt_bridge.py –n ens192 –b admin“, centos’s ens192 and vnet0 will link to bridge “admin”, as follow:

[root@frank ~]# brctl show  
bridge name	bridge id		STP enabled	interfaces
admin		8000.000c290edc77	no		ens192
							vnet0

Nested Virtualization + Passthrough – Failed

Conclusion is not working in my testbed… Maybe have workaround, but that take us lots of time… so I just summarize the procedure that can be reviewed in future.

Enable Virtualization at CentOS7 VM

Enable PCI Passthrough on ESXI

Assign the PCI card in CentOS7 VM

ESXI report error (not capture the alarm) and cannot assign the passthrough card after did the step, so rollback ESXI passthrough…

Just Enable Passthrough on STCv – Failed

Enable IOMMU

Although we enable IOMMU at ESXI page, but linux not auto enable, check by “dmesg | grep -i -e DMAR -e IOMMU”, change grub.cfg to enable:

[root@frank ~]# more /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on"
GRUB_DISABLE_RECOVERY="true"

Then write to grub2.cfg by follow cmd:

[root@frank ~]# grub2-mkconfig -o /etc/grub2.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-1127.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1127.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-7722efff25664298a497dec2458b7288
Found initrd image: /boot/initramfs-0-rescue-7722efff25664298a497dec2458b7288.img
done

[root@frank ~]# more /etc/grub2.cfg |grep iommu
	linux16 /vmlinuz-3.10.0-1127.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on 
	linux16 /vmlinuz-0-rescue-7722efff25664298a497dec2458b7288 root=/dev/mapper/centos-root ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet intel_iommu=on

Laungh with passthrough

Enable passthrough and laungh STCv by follow cmd (bus info can be found by “lshw -c network” or “lspci“)

./launchvm.py --driver dpdk --port-type hostdev --test-dev 0000:13:00.0,0000:1b:00.0 --ports 2 --cpu 5

But STCv hang and couldn’t boot successful, don’t know why, need check by Spirent, so stop at here.

Just use Bridge on STCv – Workable

Set up vP1 and vP2

[root@frank /]# more /etc/sysconfig/network-scripts/ifcfg-ens224
DEVICE=ens224
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=virbr1

[root@frank /]# more /etc/sysconfig/network-scripts/ifcfg-ens256
DEVICE=ens256
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=virbr2

Set up virbr1 and virbr2

[root@frank network-scripts]# more ifcfg-virbr1
DEVICE="virbr1"
BOOTPROTO="static"
ONBOOT="yes"
TYPE="Bridge"
NM_CONTROLLED="no"

[root@frank network-scripts]# more ifcfg-virbr2
DEVICE="virbr2"
BOOTPROTO="static"
ONBOOT="yes"
TYPE="Bridge"
NM_CONTROLLED="no"

Bound with STCv in Launcher script

10.  Test Bridge virbr1, virbr2

Check by STC Application

Config license server at “Tools -> License Management -> Virtual License -> add”; Then connect to chassis and checking license; will success if no other issue, as follow:

Reference

Thanks JiaMing’s help at “Nested Virtualization” and “Passthrough” part. Follow is official install guide:

本文出自 Frank's Blog

版权声明:


本文链接:How To Deploy STC VM by QEMU?
版权声明:本文为原创文章,仅代表个人观点,版权归 Frank Zhao 所有,转载时请注明本文出处及文章链接
你可以留言,或者trackback 从你的网站

留言哦

blonde teen swallows load.xxx videos