VMware Cloud Community
steddyeddie
Contributor
Contributor
Jump to solution

Create VM with SCSI controller type LSI logic SAS with PowerCLi

Hey guys,

Im having trouble creating a VM with the SCSI controller type to 'LSI Logic SAS'. From the New-VM cmdlet im struggling to find where to create the controller type?

If you create a VM without specifying a disk it will create one of 4GB type Thick SCSI (0:0) Hard disk 1 with SCSI controller 0 BusLogic Parrall by default.

What im wanting to do is create a harddisk that is Thin prov and create SCSI controller thats set to LSI logic SAS.

New-VM -Name VMSTORE23 -VMHost $esxhost -MemoryMB 4096 -NumCpu 2 -NetworkName "Vlan 6 Virtual Machine Network" | Get-NetworkAdapter | Set-NetworkAdapter -Type Vmxnet3 -MacAddress "00:50:56:00:00:21" -Confirm:$false

I recived some help from here from LucD who helped me Pipe the network card value into teh New-VM cmdlet like so. But im not able to add a pipe for the harddisk also like:

| Get-HardDisk | Set-HardDisk -Datastore $datastore -StorageFormat thin

And i have no idea how to change the SCSI conroller type or create it with the correct config?

Any help would be great,

Thanks in advance

Eddie

0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert
Jump to solution

Greetings, steddyeddie-

You should be able to use the Set-HardDisk and Set-ScsiController cmdlets to set the harddisk's storage format and the SCSI controller type, respectively.  You were almost there on the Set-HardDisk part.  Try something like:

## get the VM object 
$vmVMSTORE23 = Get-VM VMSTORE23
## set the harddisk storageformat to thin
$vmVMSTORE23 | Get-HardDisk | Set-HardDisk -StorageFormat Thin
## set the SCSI controller type
$vmVMSTORE23 | Get-ScsiController | Set-ScsiController -Type VirtualLsiLogicSAS

You could pack this in to your existing command to keep it as a one-liner, but for the sake of readability...

Enjoy

View solution in original post

0 Kudos
4 Replies
mattboren
Expert
Expert
Jump to solution

Greetings, steddyeddie-

You should be able to use the Set-HardDisk and Set-ScsiController cmdlets to set the harddisk's storage format and the SCSI controller type, respectively.  You were almost there on the Set-HardDisk part.  Try something like:

## get the VM object 
$vmVMSTORE23 = Get-VM VMSTORE23
## set the harddisk storageformat to thin
$vmVMSTORE23 | Get-HardDisk | Set-HardDisk -StorageFormat Thin
## set the SCSI controller type
$vmVMSTORE23 | Get-ScsiController | Set-ScsiController -Type VirtualLsiLogicSAS

You could pack this in to your existing command to keep it as a one-liner, but for the sake of readability...

Enjoy

0 Kudos
steddyeddie
Contributor
Contributor
Jump to solution

The 'Get-ScsiController' cmdlet is missing. Hav you any isea how to import it? I thought all cmdlets would be installed with PowerCli?

The term 'Get-ScsiController' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Thanks for your help

Eddie

0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

Are you running the latest PowerCLI version 4.1U1? Because that version contains the Get-ScsiController cmdlet. You can check your PowerCLI version with the Get-PowerCLIVersion cmdlet.

Regards, Robert

Message was edited by: RvdNieuwendijk

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
steddyeddie
Contributor
Contributor
Jump to solution

Matt,

Loving ya work, thanks again!

0 Kudos