Use PowerShell to disconnect the CDROMs from all VMs in vCenter

Recently I was moving all VMs from one NFS datastore to another so we could destroy the old volume. Storage vMotion took care of this for the most part, but even after moving the files, vCenter still showed that the VMs were using the old datastore. It turned out this was due to the VMs having mounted ISOs on that datastore. The solution was to eject/unmount the CDrom, but I didn’t want to do “Edit Settings…” and manually remove the CDrom for 200+ VMs.

I found this page which shows how to do almost exactly what I wanted via PowerShell. We’re using the vCenter Server Appliance though, which runs Linux, so I wasn’t sure how to run PowerShell stuff. But that was solved easily enough by installing VMWare’s PowerCLI package on my Windows desktop and connecting to the vCenter remotely:

PS C:usersevandocuments> Connect-VIServer vcenter.example.com

PS C:usersevandocuments> Get-Datacenter -name "Primary Datacenter" | Get-VM | Get-CDDrive | Set-CDDrive -Connected $false -NoMedia


Confirm
Are you sure you want to perform this action?
Performing operation "Setting Connected: False, NoMedia: True." on Target "CD/DVD drive 1".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Connect-VIServer pops up a username/password box where you put in your creds. The next command disconnects the cdrom for every VM in the “Primary Datacenter” datacenter in vCenter. I haven’t tried it but I think you can use different containers to scope the command however you want (cluster, resource pool, folder, etc). See here for other “location” options.

How I fixed my Wii’s noisy disc drive & read errors.

I got my Wii in late 2006 and around 2009 I noticed it was starting to sound like a circular saw when the disc drive was spinning. This was annoying but it didn’t affect the games so I never thought much about it.

About two weeks ago, however, New Super Mario Bros. Wii stopped working:

The Wii basically worked except for the disc drive. As soon as I put a disc in, I’d get the error above – even if I didn’t start start the game. I tried blowing in the disc slot (the only thing I could think of… worked for my old NES!) but the problem continued. I figured I had two choices: buy another Wii or attempt to fix mine. Since mine was already essentially useless I figured it couldn’t hurt anything to try fixing it.

After some searching I quickly learned that to do any work inside a Wii requires a Tri-Wing screwdriver just to open the case. I went to the hardware store and got a Tri-Wing bit but it was too big to be of any use on the Wii. I found this Silverwing Tri-Wing screwdriver on Amazon for under $5 that did the trick.

With trusty screwdriver in hand, I opened the Wii thusly:

With it now open I followed this guy’s advice:

Bending these small triangles down created a gap that stopped the vibration & the noise and made the Wii playable again.

Bend these small pieces down to stop the Wii disc drive's loud noise.
Bend these small pieces down to stop the Wii disc drive's loud noise.

It has some new weird sounds when the disc first spins up and when it spins it down (I assume the braking mechanism) but it’s practically silent during gameplay. Yay!