User Tools

Site Tools


program_lang:powershell_print_vmscsi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
program_lang:powershell_print_vmscsi [2025/11/27 22:37]
manu
program_lang:powershell_print_vmscsi [2025/11/27 22:40] (current)
manu
Line 47: Line 47:
                 ControllerType= $SCSIController.Type ​                       # Type de contrôleur (e.g., VirtualLsiLogicController)                 ControllerType= $SCSIController.Type ​                       # Type de contrôleur (e.g., VirtualLsiLogicController)
                 Persistence ​  = $disk.Persistence ​                          # Type de persistance (e.g., Persistent)                 Persistence ​  = $disk.Persistence ​                          # Type de persistance (e.g., Persistent)
 +                OS_Linux_Suggest = "/​dev/​sdX (Lsscsi: [0:​$($disk.ScsiController.BusNumber):​$($disk.UnitNumber):​0])"​
 +                OS_Windows_Hint ​ = "​Disque X (Location: Port $($disk.ScsiController.BusNumber),​ Target $($disk.UnitNumber))"​
             }             }
             ​             ​
Line 59: Line 61:
  
 # 1. Option A: Pour toutes les VMs de vCenter # 1. Option A: Pour toutes les VMs de vCenter
-$AllVMs = Get-VM +#$AllVMs = Get-VM 
-$Result = Get-VMDiskInfo -VMs $AllVMs+#$Result = Get-VMDiskInfo -VMs $AllVMs
  
 # 2. Option B: Pour une seule VM (décommenter et remplacer le nom) # 2. Option B: Pour une seule VM (décommenter et remplacer le nom)
Line 76: Line 78:
  
 <​code>​ <​code>​
-VMName,​DiskLabel,​SCSIBus,​SCSIUnit,​SCSIAddress,​DiskSizeGB,​VmdkPath,​ControllerType,Persistence +"VMName","DiskLabel","​SCSIAddressVMX","​SCSIBus","SCSIUnit","DiskSizeGB","VmdkPath","​OS_Linux_Suggest"​,"​OS_Windows_Hint"​ 
-web-prod-01,​Hard Disk 1,0,0,0:0,​40.00,​[datastore1] web-prod-01/web-prod-01.vmdk,VirtualLsiLogicController,Persistent +"web-prod-01","Hard Disk 1","​scsi0:​0","0","0","40.00","[datastore1] web-prod/​web-prod.vmdk","/​dev/​sda (Lsscsi: [0:​0:​0:​0])"​,"​Disque 0 (Location: Port 0, Target 0)" 
-web-prod-01,​Hard Disk 2,0,1,0:1,​100.00,​[datastore1] web-prod-01/web-prod-01_1.vmdk,VirtualLsiLogicController,​Persistent +"web-prod-01","Hard Disk 2","​scsi0:​1","0","​1","100.00","[datastore1] web-prod/​web-prod_1.vmdk","/dev/sdb (Lsscsi: [0:0:1:0])","​Disque 1 (LocationPort 0, Target 1)" 
-db-dev-05,Hard Disk 1,0,0,0:0,60.00,​[datastore2] db-dev-05/​db-dev-05.vmdk,​VirtualSCSIController,​Persistent+...
 </​code>​ </​code>​
program_lang/powershell_print_vmscsi.1764279462.txt.gz · Last modified: 2025/11/27 22:37 by manu