PowerShell Script to configure iSCSI Network Cards as per Microsoft Best Practices.

PowerShell Script to configure iSCSI Network Cards as per Microsoft Best Practices.
Hi Guys, Today i was able to achieve something exciting.I was able to automate the configuration settings for a Virtual Machine which has iSCSI networkcards connect to it using PowerShell and a utility called as nvspbind http://archive.msdn.microsoft.com/nvspbind

The Script could be run on virtual machines which have iSCSI NIC’s connected to them which are in turn connected to a NetAPP Storage.

We faced lots of performance issue’s with our SQL Virtual Machines and we had a case with PSS to solve the issue, PSS suggested to perform the below set of steps on a iSCSI Network Card of virtual machines to resolve the issue.

They Suggested for all VM’s which have an iSCSI nic attached we need to perform the following set of activities.

a) The Network Properties  for iSCSI Nics should have only “internet protocol version4”  checked and rest of all properties should be unchecked.

b) “Register this connection’s address  in DNS” should be unchecked and “Disable NetBIOS  over TCPIP” should be selected.

c) Access the advanced properties of each iSCSI Network card and set the Checksum offload for “IPV4”, “Large Send Offload”, “TCP Checksum Offload” and “UDP Checksum Offload” as DISABLED and also set the Jumbo packets to 9014 Bytes.

 

d) Run the NetSH commands to set the offload settings globally


 

“It was a painful task to set each of the above properties manually,”

Hence i created a script for our team to automate the entire process using wmi and a free tool from microsoft called as nvspbind which helps in binding and unbinding Network Adapter properties

Below Script works on the following assumption
a) iSCSI network cards in your VM are named as iSCSI1 and iSCSI2 (This is generally done   to provide redundancy)
b) iSCSI NICs have an IP address assignment starting with 192.
c) You have downloaded and kept nvspbind in a folder called as “c:install”
The above three assumptions can be further modified as per your environments iSCSI NIC Card naming conventions and iSCSI ip address assignment conventions and also where you find it suitable to place  nvspbind
Here’s the entire script for your reference

 

Once you Run this script you would see that the iSCSI NIC’s are indeed set as per Microsoft Best practices 🙂

Please follow and like us:

Share this post

Post Comment