I found this KB 2004578 and thought that of course should this be done with PowerCLI
I made a function to be able to do it just by sending the VM parameter, it can be done if the VM is already shutdown with a simple one-liner
1
Get
-VM
v2vtest2 | Get
-ScsiController
|
where
{$_.
Type
-eq
"Paravirtual"
} |
Set
-ScsiController
-Type
VirtualLsiLogicSAS
But I wanted a more sophistical approach where my function shutdown the VM properly and then change the controller and starts the VM, the tricky part here was to check that the VM actually had shutdown before I change controller
01
function Change
-ScsiController
{
04
Stop a VM and replace the SCSI controller and start it again
07
Use this function to change scsi cntroller
12
Author: Niklas Akerlund / RTS
16
[Parameter(Position=0,Mandatory=
$true
,HelpMessage=
"A virtual machine"
,
17
ValueFromPipeline=
$True
)]
22
Shutdown
-VMGuest
-VM
$VM
-Confirm
:
$false
23
while (
$VM
.PowerState
-eq
"PoweredOn"
)
28
Get
-ScsiController
-VM
$VM
|
where
{$_.
Type
-eq
"Paravirtual"
} |
Set
-ScsiController
-Type
VirtualLsiLogicSAS