博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Finding VMs with Duplicate MAC Addresses
阅读量:6411 次
发布时间:2019-06-23

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

At one of my customers' sites today, I saw an error message that I've not seen before: VM MAC Conflict.  "Well, that's certainly not good," I thought, as I poked around at the error message.  To my chagrin, I could only find that error message for a single VM in the environment, and that error message wouldn't tell me with which other VM it was conflicting.  So, I could only think of one way to figure out what was going on with this conflict: look at the MAC Address assigned to every NIC on every VM in the environment, and figure out what was causing the conflict.  Easy!


No, really, it was easy.  Had I done it by hand, I would certainly have driven myself crazy, but PowerCLI made it nice and easy.  I just used this command:


(get-vm | get-networkadapter | ? {$_.MacAddress -eq "<offending MAC Address>").parent


Lo-and-behold, it returned 2 VMs.  One was the known VM that had flagged the error and the other was a powered-off VM.  Maybe that's why it wasn't also flagging the error, but regardless, we easily identified the source of the problem and were able to resolve it.


P.S. if you ever need to find all duplicate MAC addresses in an environment, you can use these commands:


$allNICs = get-vm | get-networkAdapter
$dupeMACs = (compare-object $allNICs.macAddress ($allNICs.macAddress | select -unique)).inputObject
foreach ($thisMAC in $dupeMACs){
   "="*17 + "`n$thisMAC`n" + "="*17
   ($allNICs | ? {$_.macAddress -eq $thisMAC}).parent.name

}

本文转自学海无涯博客51CTO博客,原文链接http://blog.51cto.com/549687/1981255如需转载请自行联系原作者

520feng2007

你可能感兴趣的文章
JavaScript简介
查看>>
SQL Server附加数据库拒绝访问解决方法汇总
查看>>
SM2算法原理及实现
查看>>
RHCA教材翻译计划
查看>>
js-小括号在不同场合下的作用
查看>>
我的友情链接
查看>>
kvm中虚拟机的硬盘扩容
查看>>
Android (Launch Mode) 四种启动模式
查看>>
透视学理论(二)
查看>>
Dubbo/HSF在Service Mesh下的思考和方案
查看>>
Django form表单
查看>>
CTYL-9.14(tomcat端口与阿里云安全组,域名与tomcat配置,域名与反向代理)
查看>>
Java 多线程相关问题记录
查看>>
LNMP架构介绍、MySQL安装、PHP安装、 Nginx介绍
查看>>
简单的Spark+Mysql整合开发
查看>>
阿里java面试经验大汇总(附阿里职位需求)
查看>>
Python全套零基础视频教程+软件2018最新编程视频!
查看>>
内存管理之1:x86段式内存管理与保护模式
查看>>
20180925上课截图
查看>>
IO输入/输出流的简单总结
查看>>