VMware Cloud Community
gss4w
Contributor
Contributor
Jump to solution

Configure SCSI Controller Type

Hi,

Does anyone have any advice on how to create a Windows Server 2003 VM with a BusLogic controller instead of LSI Logic. I saw a thread that talked about how to add a new BusLogic controller to a guest, but I'm not sure how to modify the code make it change an existing LSI logic controller to BusLogic. Also if anyone has ideas on how to change the type during VM creation that would actually be preferable for me.

http://communities.vmware.com/message/963127#963127

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

It should be enough to change the operation property to edit.

But I'll check it later and get back.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

It should be enough to change the operation property to edit.

But I'll check it later and get back.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
gss4w
Contributor
Contributor
Jump to solution

That seem to work. Thanks again for the help.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

For info, I have created a filter so you can pipe the object from New-VM to it.

Connect-VIServer -Server <VC-name>

filter set-SCSIController {
  $vm = Get-View $_.ID
 
  $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
  $spec.deviceChange = @()
  $spec.deviceChange += New-Object VMware.Vim.VirtualDeviceConfigSpec
 
  $spec.deviceChange[0].device = New-Object VMware.Vim.VirtualBusLogicController
  $spec.deviceChange[0].device.busNumber = 0
  $spec.deviceChange[0].device.ControllerKey = 100
  $spec.deviceChange[0].device.DeviceInfo = New-Object VMware.Vim.Description
  $spec.deviceChange[0].device.DeviceInfo.label = "SCSI Controller 0"
  $spec.deviceChange[0].device.DeviceInfo.summary = "BusLogic"
  $spec.deviceChange[0].device.hotAddRemove = $true
  $spec.deviceChange[0].device.key = 1000
  $spec.deviceChange[0].device.scsiCtlrUnitNumber = 7
  $spec.deviceChange[0].device.sharedBus = "noSharing"
  $spec.deviceChange[0].operation = "edit"
 
  $vm.ReconfigVM_Task($spec)
}
 
New-VM -Name <VM-name> -VMHost (Get-VMHost <ESX-hostname>) -GuestId winNetStandardGuest | set-SCSIController


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

gss4w
Contributor
Contributor
Jump to solution

Thanks again for the help. The filter works great at switching the controller type; however, when I first power on the VM it says that the controller has been created for an LSI Logic adapter (I attached a screenshop of the message). I understand that is message is to be expected, and it would also come up if I had changed the controller type using the GUI. Do you know if there is a way to change the disk type at the time of disk creation? We had some old scripts for creating specific VM groups for use in our lab that were basically bash scripts running on our ESX boxes using vmware-cmd and directly modifying the vmx files. Now that the VI Toolkit is out I'm looking to see if we can convert them to using supported API features.

0 Kudos
BenEuers
Contributor
Contributor
Jump to solution

Would you mind including the code to create a lsi logic controller rather than a buslogic? I've tried the obvious but still end up with a buslogic controller.

Cheers

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sure, this filter function should do the trick

filter set-SCSILsiLogicController {
  $vm = Get-View $_.ID
 
  $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
  $spec.deviceChange = @()
  $spec.deviceChange += New-Object VMware.Vim.VirtualDeviceConfigSpec
 
  $spec.deviceChange[0].device = New-Object VMware.Vim.VirtualLsiLogicController
  $spec.deviceChange[0].device.busNumber = 0
  $spec.deviceChange[0].device.ControllerKey = 100
  $spec.deviceChange[0].device.DeviceInfo = New-Object VMware.Vim.Description
  $spec.deviceChange[0].device.DeviceInfo.label = "SCSI Controller 0"
  $spec.deviceChange[0].device.DeviceInfo.summary = "Lsi Logic"
  $spec.deviceChange[0].device.hotAddRemove = $true
  $spec.deviceChange[0].device.key = 1000
  $spec.deviceChange[0].device.scsiCtlrUnitNumber = 7
  $spec.deviceChange[0].device.sharedBus = "noSharing"
  $spec.deviceChange[0].operation = "edit"
 
  $vm.ReconfigVM_Task($spec)
}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos