Friday, July 13, 2012

Virtual CD - becomes "Show Stopper" for Manual / DRS vMotion - How to solve


Virtual CD - becomes "Show Stopper" for Manual / DRS vMotion - How to solve

1) Tool Based Disconnect (As per docs - host wise)
2) Power CLI based Disconnect (By ESX, Cluster, Datacenter) - Single Shot

Method1 - Tool Based
There is a tool by "Eric Sloof" - This Tool Scans all Virtual Machines and shows if they have a CD connected to it. After scanning the VM’s you can disconnect all the CD’s with a click of  a button.

Method2 - Script Based -I like this way - Power of Reach to ESX / Cluster / Data Center

Execute Script on one ESX Host & disconnect Virtual CD for All VM's on ESX
(Get-VM -Location ( Get-VMHost "ESX host name HERE")) | `
ForEach ( $_ ) { Get-CDDrive $_ | `
Where { $_.IsoPath.Length -gt 0 -OR $_.HostDevice.Length -gt 0 } | `
Set-CDDrive -NoMedia -Confirm:$False }

Execute script on Whole cluster:
(Get-VM -Location ( Get-Cluster "Cluster Name HERE")) | `
ForEach ( $_ ) { Get-CDDrive $_ | `
Where { $_.IsoPath.Length -gt 0 -OR $_.HostDevice.Length -gt 0 } | `
Set-CDDrive -NoMedia -Confirm:$False }

Why not by Datacenter:
(Get-VM -Location ( Get-Datacenter "Datacenter Name HERE")) | `
ForEach ( $_ ) { Get-CDDrive $_ | `
Where { $_.IsoPath.Length -gt 0 -OR $_.HostDevice.Length -gt 0 } | `
Set-CDDrive -NoMedia -Confirm:$False }


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.