How can i know which virtual machine out of 100 virtual machine in my enviorment have SCSI Bus Sharing enabled ?
DO i need to go and check each and every virtual machine or is there any quick way to know that ? Using power cli or some thing.
Please suggest.
after you connect to the vcenter server in power cli ucan use below scripts:
Get-Cluster | Get-VMHost | Get-VM | Get-ScsiController | Where-Object {$_.BusSharingMode -eq ‘Physical’} | Select {$_.Parent.Name}, {$_.Parent.Host}, BusSharingMode | Sort {$_.Parent.Host} ### This returns any VM’s set to BusSharingMode of Physical
Get-Cluster | Get-VMHost | Get-VM | Get-ScsiController | Where-Object {$_.BusSharingMode -eq ‘Virtual’} | Select {$_.Parent.Name}, {$_.Parent.Host}, BusSharingMode | Sort {$_.Parent.Host} ### This returns any VM’s set to BusSharingMode of Virtual
after you connect to the vcenter server in power cli ucan use below scripts:
Get-Cluster | Get-VMHost | Get-VM | Get-ScsiController | Where-Object {$_.BusSharingMode -eq ‘Physical’} | Select {$_.Parent.Name}, {$_.Parent.Host}, BusSharingMode | Sort {$_.Parent.Host} ### This returns any VM’s set to BusSharingMode of Physical
Get-Cluster | Get-VMHost | Get-VM | Get-ScsiController | Where-Object {$_.BusSharingMode -eq ‘Virtual’} | Select {$_.Parent.Name}, {$_.Parent.Host}, BusSharingMode | Sort {$_.Parent.Host} ### This returns any VM’s set to BusSharingMode of Virtual
Great answer!
Looks like $_.Parent.Host is now $_.Parent.VMHost and, since you select BusSharingMode in the output, I condensed the search for physical and virtual bus sharing modes into one where statement with the -or operator. Here's the updated command:
Get-VM | Get-ScsiController | Where-Object {$_.BusSharingMode -eq ‘Physical’ -or $_.BusSharingMode -eq ‘Virtual’} | Select {$_.Parent.Name}, {$_.Parent.VMHost}, BusSharingMode | Sort {$_.Parent.VMHost}