Sample Exchange

 View Only

Update the current SCSI Controller for a Virtual Machine 

Apr 04, 2019 12:09 AM

This script will update the SCSI Controller for a Virtual Machine.

It does not check to see if the VM is configured for a 64-bit Guest OS (BusLogic isn't supported)
It does check to see if VMware Tools are running and shutdown the VM using the Guest OS Shutdown
It does return the VM to the previous running state
It does check to see if the new SCSI Controller value has already been set. 

The Modify-ScsiController function is called at the end of the script.
Here are different examples that show how the function can be used. 

# Examples
# Change to VMware Paravirtual
Modify-ScsiController -VM "Witness3" -Type Paravirtual
# Change to LSI Logic SAS
Modify-ScsiController -VM "APP1" -Type VirtualLsiLogicSAS
# Change all the VM's that have the LSILogic Adapter to the VMware Paravirtual
$CurrentVMs = Get-VM | Get-ScsiController| Select-Object Parent,Type | Where-Object {$_.Type -eq "Paravirtual"}
Foreach ($WorkingVm in $CurrentVMs) {
    # Update the working VM to an alternate adapter
    Modify-ScsiController -VM $WorkingVm.Parent -Type Paravirtual
}

#PowerShell
#scsi
#VM
#vSphere
#Storage
#VMwarePowerCLI
#vSAN
#TraditionalStorage
#VVols
#Controller
#Apache2.0

Statistics
0 Favorited
1 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
ps1 file
ChangeScsiController.ps1   3 KB   1 version
Uploaded - Apr 09, 2024

Tags and Keywords

Comments

Dec 06, 2023 05:52 PM

Do you know of an automated way to inject the pvscsi driver into thousands of windows machines prior to running the script? Function works fine but without the driver the OS BSOD's.

Related Entries and Links

No Related Resource entered.