https://docs.mirantis.com/openstack/fuel/fuel-6.1/
由于在测试高可用时,我是用esxi虚拟机测试,测试过程中遇到了网络问题:虚拟机间网络不通,故从网络上找到了在vSwitch中抓包的方法。
1、首先先打开ESXi主机的ssh。
2、ssh连接ESXi主机,上传脚本a.sh,此脚本是老外编写 :
---------------------------------------------------------------------------------------
# William Lam
# http://www.virtuallyghetto.com/
if [[ $# -ne 1 ]] && [[ $# -ne 4 ]]; then
echo -e "Usage: $0 -l -v [vSWITCH] -p [PORT]
"
echo " -l List all ports of vSwitch(s)"
echo " -v vSwitch to query"
echo " -p Port to query on vSwitch"
echo -e "
$0 -l"
echo -e " $0 -v vSwitch0 -p 1234
"
exit 0
fi
if [ ! -e /sbin/vsish ]; then
echo "Script is only supported running on an ESXi host as vsish is not available by default on ESX"
exit 1
fi
VSISH_VSWITCH_PATH=/net/portsets
if [ $# -eq 1 ]; then
for vSwitch in $(vsish -e ls ${VSISH_VSWITCH_PATH});
do
VSWITCH=$(echo ${vSwitch} | sed 's////g')
for port in $(vsish -e ls ${VSISH_VSWITCH_PATH}/${vSwitch}ports);
do
PORT=$(echo ${port} | sed 's////g')
PORTINFO=$(vsish -e get ${VSISH_VSWITCH_PATH}/${vSwitch}ports/${port}status | sed 's/^[ ]*//;s/[ ]*$//');
CLIENT=$(echo ${PORTINFO} | sed 's/ /
/g' | grep "clientName:" | awk -F ":" '{print $2}')
MACADDRESS=$(echo ${PORTINFO} | sed 's/ /
/g' | grep "unicastAddr:" | uniq | sed 's/unicastAddr://;s/(.*)./1/')
echo -e "${VSWITCH} ${PORT} ${MACADDRESS%%::*} ${CLIENT}"
done
done
fi
if [ $# -eq 4 ]; then
QUERY_PATH="${VSISH_VSWITCH_PATH}/${2}/ports/${4}/status"
echo "Querying port path: ${QUERY_PATH}"
PNICS=$(vsish -e ls /net/portsets/${2}/uplinks/ | sed '$!N;s/
/ /;s////g')
echo -e "pNICS for vSwitch: ${PNICS}
"
vsish -e get "${QUERY_PATH}"
fi
---------------------------------------------------------------------------------------
3、使用脚本查看虚拟机网卡连接的虚拟交换机端口:
/vmfs/volumes/55b08c38-81076980-4852-f80f41f72abc/ISO # sh a.sh -l
vSwitch0 33554433 00:00:00:00:00:00 Management
vSwitch0 33554434 00:00:00:00:00:00 vmnic0
vSwitch0 33554435 00:50:56:57:2a:bc Shadow
vSwitch0 33554436 f8:0f:41:f7:2a:bc vmk0
vSwitch0 33554455 00:50:56:b6:2c:3a itportal
vSwitch0 33554486 00:50:56:b6:3a:bc ibmopenstack43
vSwitch0 33554507 00:50:56:b1:ce:ad NTP
vSwitch0 33554510 00:50:56:b1:79:aa wjw-CentOS6.5-Tomcat
vSwitch1 50331649 00:00:00:00:00:00 Management
vSwitch1 50331650 00:00:00:00:00:00 vmnic1
vSwitch1 50331651 00:50:56:57:2a:bd Shadow
vSwitch1 50331683 00:0c:29:23:fe:62 VMware
vSwitch1 50331689 00:50:56:b1:5c:56 linux-oracle
vSwitch1 50331755 00:50:56:b1:7f:5b wjw-CentOS6.5-Tomcat
vSwitch2 67108865 00:00:00:00:00:00 Management
vSwitch2 67109189 00:00:00:00:00:00 vmnic2
vSwitch2 67109190 00:50:56:57:2a:bb Shadow
vSwitch2 67109194 00:50:56:b1:b0:cf NTP
vSwitch2 67109196 00:50:56:b1:fc:32 zhouzunyi_test_fuel_61
vSwitch2 67109197 00:50:56:b1:86:3f zhouzunyi_test_fuel_controller2
vSwitch2 67109198 00:50:56:b1:f5:fb zhouzunyi_test_fuel_controller2
vSwitch2 67109199 00:50:56:b1:7d:8b zhouzunyi_test_fuel_controller1
vSwitch2 67109200 00:50:56:b1:e7:40 zhouzunyi_test_fuel_controller1
vSwitch2 67109201 00:50:56:b1:46:6d zhouzunyi_test_fuel_controller3
vSwitch2 67109202 00:50:56:b1:82:4c zhouzunyi_test_fuel_controller3
vSwitch2 67109203 00:50:56:b1:43:04 zhouzunyi_test_fuel_compute1
vSwitch2 67109204 00:50:56:b1:e6:63 zhouzunyi_test_fuel_compute1
vSwitch2 67109205 00:50:56:b1:52:89 zhouzunyi_test_fuel_cinder1
vSwitch2 67109206 00:50:56:b1:d9:51 zhouzunyi_test_fuel_cinder1
vSwitch2 67109208 00:50:56:b1:91:fa zhouzunyi_test_fuel_controller3
vSwitch2 67109209 00:50:56:b1:a5:e5 zhouzunyi_test_fuel_controller2
vSwitch2 67109210 00:50:56:b1:93:83 zhouzunyi_test_fuel_controller1
vSwitch2 67109211 00:50:56:b1:0c:00 zhouzunyi_test_fuel_compute1
vSwitch2 67109212 00:50:56:b1:37:13 zhouzunyi_test_fuel_cinder1
vSwitch2 67109213 00:00:00:00:00:00 zhouzunyi_test_fuel_61
vSwitch2 67109214 00:00:00:00:00:00 NTP
4、监听指定端口抓包:
/vmfs/volumes/55b08c38-81076980-4852-f80f41f72abc/ISO # pktcap-uw --switchport 67109199 -o ctrl1.pcap
5、下载数据包,用wireshark分析。
其它推荐学习资料:
ESXi虚拟交换机VLAN的三种配置EST、VST、VGT:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003806
http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1004127
http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1010778
http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1004252
我的openstack节点的网络规划是:
则“物理网卡”eth1需要在ESXi中使用VGT配置:
此外,基于ns_IPaddr2的实现机制:命名空间桥接虚拟网桥,需要启用端口组的混杂模式,否则VIP无法被其它节点ping通:
最后,端口组所在虚拟交换机也要开启混杂模式。