VMotion Failing?

These VMware PowerCLI commands, came in handy a month or so ago. I’d thought I’d share. Credit is given in the links below.

What do you do when, you see a mounted ISO not being used? Left abandoned and discarded? Does it drive you absolutely mad? Do you go all stabby Joe? Does the OCD kick in and you need to find and unmount the entire world. Then the below may help.

In all seriousness though, a mounted ISO will cause a VMotion to fail.

Detect which VMs have CDs mounted

Get-VM | Where-Object {$_ | Get-CDDrive | Where-Object { $_.ConnectionState.Connected -eq "true" } } | Select-Object Name

Detect which VMs have CDs mounted and unmount the ones found

Get-VM | Where-Object {$_ | Get-CDDrive | Where-Object { $_.ConnectionState.Connected -eq "true" } } | Get-CDDrive | Set-CDDrive -Connected $false -Confirm:$false

Rescan HBAs in a cluster

Get-Cluster 'Cluster 1' | Get-VMHost | Get-VMHostStorage -RescanAllHba -RescanVmfs



Up next 0001-setting_up_my_blog_v1 0003-citrix_synergy_2014_anaheim
Latest posts 0104-change-synology-password-cli 0105-free-git-ebook 0103-using-brew-bundle-to-backup-and-restore-mac-app-store-and-brew-apps Update macOS with an all in one alias Mac App Store Command Line Interface 0100-macos-softwareupdate-cli Markdown Crash Course Video What’s New with Fusion and Workstation [HCP1833] File IO in Python Overview of vSphere 7 Video 0095-what_is_iso Migrating Website HTML details Tag Microsoft RD Client iOS App 0091-create_vmware_esxi_usb_install_media Intel NUC Lab Hosts Hardware Setup 0089-installng_microsoft_sql_2016 Installing the First Two Domain Controllers in the VMware ESXi 6.7 Lab Environment 0088-deploy_vcsa_in_lab Macchanger Utility, and Usage Install a Kali Linux VM in a VMware ESXi 6.7 Environment Install Ubuntu 18.04 Virtual Machine in a VMware ESXi 6.7 Environment Install xRDP on Ubuntu 18.04 Install Chromium on Ubuntu 18.04 Install OpenSSH on Ubuntu 18.04 Install VMware Workstation 14 on Ubuntu 18.04 Nested ESXi server Laboratorium Rattus The Animal Within Who is Veeam? RSAC OnDemand Videos 0075-create_win10_sandbox_vm