The easiest way to connect to you iSCSI storage LUNs from Windows Server 2008 is by using the iSCSI initiator GUI. With the GUI you can easily make a connection with your iSCSI Storage by giving the ip-address and dynamically discover the LUNs (or Volumes) it has to offer.
As I’m working on scripts to automate the installation and configuration of Windows Server 2008 systems, I was also looking for a way to configure the local disks and volumes of a Server, without having to use the GUI and manual instructions. Luckily Windows offers some nice tools for scripting. The scripting and configuration of the local disks and volumes can best be done with diskpart.exe. Which offers it’s own commandline interface and the option to use a preconfigured script with all the commands.
This post offers step-by-step instructions for the diskpart.exe command.
This article is updated with additional diskpart command information, provided by Olav Meijer.
The additions to the diskpart sample scripts are marked in red.