Follow @chaderoth

Tuesday, January 8, 2019

Use PowerCLI To Find VMs With Connected ISOs And Disconnect While Handling Linux Locked Media

In this post I will be building off of my last two posts which stemmed from a problem I ran into where I attempted to find and disconnect all ISOs connected to VMs in my environment. Please go back and read my previous posts, but as a quick recap; if you attempted to disconnect an ISO from a Linux VM before ejecting the media in the guest your Linux VM will become unresponsive until you answer a dialog that displays in vCenter.

In my previous post I showed you how to find all Linux VMs, in this case CentOS Linux VMs, properly eject the media inside of the guest using the Invoke-VMScript, and disconnect the ISO from the VM. That post; however, only covered Linux VMs.