VMware Cloud Community
tuensel2k
Contributor
Contributor

Binding a vmkernel Portgroup to an iscsi softwareadapter

Hello,

im trying to bind my vmkernel portgroups that i use for iscsi storage to the iscsi softwareadapter but im stuck..

My script as far it is:

$vs = New-VirtualSwitch -VMHost $vmHost -Name vSwitch3 -Nic vmnic2,vmnic5 -Mtu 9000

$vmk = New-VMHostNetworkAdapter -VMHost $vmHost -PortGroup "Storage 1" -VirtualSwitch $vs -IP storageip1 -SubnetMask 255.255.255.0

Get-VirtualPortGroup -VMHost $vmHost -Name "Storage 1" | Get-NicTeamingPolicy | Set-NicTeamingPolicy -MakeNicActive "vmnic2" | Set-NicTeamingPolicy -MakeNicUnused "vmnic5"

$vmk = New-VMHostNetworkAdapter -VMHost $vmHost -PortGroup "Storage 2" -VirtualSwitch $vs -IP storageip2 -SubnetMask 255.255.255.0

Get-VirtualPortGroup -VMHost $vmHost -Name "Storage 2" | Get-NicTeamingPolicy | Set-NicTeamingPolicy -MakeNicActive "vmnic5" | Set-NicTeamingPolicy -MakeNicUnused "vmnic2"

Thanks in advance Smiley Happy

0 Kudos
3 Replies
LucD
Leadership
Leadership

Did you already configure the iSCSI target with the New-IScsiHbaTarget cmdlet ?

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
tuensel2k
Contributor
Contributor

Hey LucD,

i think i have a little understanding problem

Maybe ways changed how to configure esxi hosts to access iscsi storage.

I thought that you first have to create the virtual switch, than the vmkernel portgroup and after that bind the vmkernel portgroups for iscsi traffic to the iscsi softwareadapter.

In times where i used the service console the command was something like:

esxcli swiscsi nic add -n vmk0 -d vmhba33

And after that step i could configure the iscsi targets, things changed?

Edit:

i tryied following command:

$hba = Get-VMHost $vmHost | Get-VMHostHba -Type "iScsi"

New-IScsiHbaTarget -IScsiHba $hba -Address "Storagetargetip"

The result is that my esxi host crashes after a rescan of the hba, i think i did a bad mistake..

Help please Smiley Happy

0 Kudos
Thushyaa
Contributor
Contributor

Hello

specify more details about your esx(i) hardware configuration, what is your goal software iSCSI, dependant hardware iscsi or hardware iSCSI.

Use this guide but you have to be very clear and should know what you are doing if you are planing for other than SOFTWARE ISCSI setup.

http://www.vmware.com/pdf/vsphere4/r40/vsp_40_iscsi_san_cfg.pdf

Thanks

0 Kudos