We all know that feeling when browsing your virtual inventory en seeing CD/DVD’s connected to several virtual machines. Time to clean-up and disconnect all those annoying DVD’s. We don’t want to do this all by hand because it will take too much time and with PowerCLI it’s just a simple commando.
So… PowerCLI to the rescue 🙂 The command goes as follows:
Get-VM | Get-CDDrive | Set-CDDrive -Connected:$false
If your VM’s are Windows VM’s, you’re fine. But wait… you have Linux VM’s? Oke, well than you’re screwed. A simple task as removing a DVD from a Linux VM will cause you downtime.
So what happened here? Actually this behavior is quiet normal as you know how Linux works. Linux will mount the DVD-drive hardware-file to a folder in the operating system. VMware recognizes this and sees that the media is probably not hot-swappable. Therefor it comes with a Virtual Machine Message-question.
The problem here is that VMware chooses to pause the VM until the question is answered. So the VM will not continue until you have chosen an answer. When you do not expect this behavior, because Windows VM’s will disconnect the DVD-drive just fine, you’ll have downtime.