VMware Cloud Community
goodface
Enthusiast
Enthusiast

connet cd-rom on host

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

Reply
0 Kudos
12 Replies
LucD
Leadership
Leadership

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

Reply
0 Kudos
goodface
Enthusiast
Enthusiast

powercli.JPG

Reply
0 Kudos
LucD
Leadership
Leadership

Are you connected to the vCenter ?

Do you have a cluster called WEE ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
goodface
Enthusiast
Enthusiast

hi

i connected vcenter then i wrote your command but no list just it is wait ?powercli.JPG

dodo is fake

Reply
0 Kudos
LucD
Leadership
Leadership

You have to connect to the vCenter to execute my script


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
goodface
Enthusiast
Enthusiast

i connected vcenter then i wrote your script  but no list just it is waitpowercli.JPG

Reply
0 Kudos
LucD
Leadership
Leadership

Hit <Enter> one more time, so PowerShell knows you finished entering code.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
goodface
Enthusiast
Enthusiast

same i cant see list

power.JPG

Reply
0 Kudos
LucD
Leadership
Leadership

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 ?

vmcd.png

The current script will list the VMs that have a type 2 CD/DVD.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sivagndl
Enthusiast
Enthusiast

Hi

Try This one..

Get-Cluster <Cluster Name>|get-vm|Get-cddrive|Where-Object{$_.Connectionstate -eq "Connected"}|select Parent,hostdevice,Name

Reply
0 Kudos
goodface
Enthusiast
Enthusiast

Type 1 and 3

Reply
0 Kudos
LucD
Leadership
Leadership

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

Reply
0 Kudos