-
XenServer Ghost Devices Woes
February 1, 2016
As you may recall from my previous article, XenServer and HP Firmware Woes, I was involved in a rather large XenServer upgrade project.
Anyone that has done some XenServer updates/upgrades surely has come across the “ghosted nics” issue before. I’m certainly not alone since CTP Alexander Ervik Johnsen also wrote a little something on his blog the other day. You can read about his solution here.
As you might have guessed, Ghost or Phantom NICs are a bad thing. The solution sounds simple enough: get rid of them. From a technical perspective, it’s not a difficult thing to do. As Alexander Ervik Johnsen mentioned, it’s a matter of following these steps:
- Log in as a local admin account (TIP: make sure you know this one BEFORE you start upgrading)
- Open a command prompt
- Issue the command “set devmgr_show_nonpresent_devices=1”
- Launch Device Manager by typing devmgmt.msc in the same command prompt session (so the device manager session “sees” the environment variable)
- In Device Manager, select View -> Show hidden devices
- Now the Ghosted NIC’s should be visible, and you should be able to uninstall them just by right-clicking them and selecting uninstall
It’s a quite straightforward procedure to follow, but it can become a very tedious job if you need to go through these for a high number of VM’s.
And there’s more to it. From time to time, Device Manager does not seem to respond to the uninstall command. You click uninstall, you do a refresh, and the device is still there. Issuing multiple uninstall commands won’t help you either.
So then there is the option to dive into the Registry and carve out the Ghost device by hand. It can be done, but it will take time and is not without any risk.
The solution? Enter a marvelous tool I (re)discovered recently: GhostBuster (by wvd_vegt, https://bitbucket.org/wvd-vegt/ghostbuster/src/master/). It scans for ghosted devices, shows them in a nice GUI, so you can select the Ghosted NIC by selecting “Add Device”.
When selected, you hit the Remove Ghosts button
And you’re done.
Ghostbuster even comes in a portable format, so there’s no need to install it every time.
So, to make my life a bit easier, I created a small ISO file that I can mount on a VM. That ISO contains a couple of things:
- start.cmd -> sets the devmgr environment variable and starts Device manager with “View Hidden” already enabled
- the MMC used by start.cmd, which is good old Device Manager with “View Hidden” enabled.
- the portable version of Ghostbuster
I’ve thought about automating it some more, like using GhostBuster to clean stuff automatically. The biggest issue is that in my environment, the number of ghosted nics is not always the same, and it’s not always the “Realtek” either, I’ve seen cases where I have the Realtek nic, and 3 ghosted Xenserver NICs together. In that type of situation, I’d like to control things myself because this usually means something else is also very much messed up with that VM.
Maybe I’ll do the automation part in the future, but I use the ISO as-is for now. If you like it too, you can find it in the Downloads section.
You can always find the most current files by going to https://www.carlwebster.com/where-to-get-copies-of-the-documentation-scripts/ and looking in the Bart Jacobs’ Toolbox section.
Thanks
Bart Jacobs
One Response to “XenServer Ghost Devices Woes”
February 8, 2016 at 8:13 am
Now why didn’t I think of this. I get so annoyed with ghosted network interfaces. Next time I upgrade XenTools I will have this handy.