I have a cluster and there are 2 hosts on cluster . I want to see all the machines connected on the cd-rom. how to find with powercli. i am using esxi 5.0
cluster name : dodo
host name : toto
host name : toto1
To clarify, you want to list all VMs in the cluster that have their CD/DVD drive connected to the ESXi host CD/DVD drive ?
Like this ?
Get-Cluster dodo | Get-VM |
Where {Get-CDDrive -VM $_ | where {$_.HostDevice}} |
Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Are you connected to the vCenter ?
Do you have a cluster called WEE ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
hi
i connected vcenter then i wrote your command but no list just it is wait ?
dodo is fake
You have to connect to the vCenter to execute my script
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i connected vcenter then i wrote your script but no list just it is wait
Hit <Enter> one more time, so PowerShell knows you finished entering code.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
same i cant see list
That could mean that none of your VM in that cluster have a CD/DVD connected to the ESXi host's CD/DVD.
Which VM do you want to see ? With which type of CD/DVD connection ?
The current script will list the VMs that have a type 2 CD/DVD.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi
Try This one..
Get-Cluster <Cluster Name>|get-vm|Get-cddrive|Where-Object{$_.Connectionstate -eq "Connected"}|select Parent,hostdevice,Name
Type 1 and 3
Try something like this
Get-VM | Get-CDDrive |
Where {$_.ExtensionData.Backing -is [VMware.Vim.VirtualCdromIsoBackingInfo] -or
$_.ExtensionData.Backing -is [VMware.Vim.VirtualCdromRemoteAtapiBackingInfo]} |
Select @{N="VM";E={$_.Parent.Name}},Name,IsoPath,RemoteDevice,
@{N="ClientDevice";E={$_.ExtensionData.Backing -is [VMware.Vim.VirtualCdromRemoteAtapiBackingInfo]}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference