- Storage White Papers
I’ve been spending some time recently working with Microsoft’s Hyper-V virtualisation platform and one of the major hassles I’ve experienced is having to use the command line rather than GUI for certain functions. If you’re not aware, Windows 2008 Core is a stripped down version of a standard Windows 2008 Server deployment and so has no GUI interface. That makes administering features such as iSCSI a little more challenging as this isn’t one of the features of Server Management.
If you use iSCSI in your Windows environment, you will be familiar with the standard iSCSI GUI. This GUI makes administering iSCSI incredibly simple (with functions like Quick Connect) or of course you can use the more advanced features that allow the configuration of security and other features. Image 1 shows an example of the iSCSI Initiator page from one of my Hyper-V test machines. You can just about see that some of the connections are established and some are inactive.
Of course there is no GUI to use in 2008 Core, so the fallback is to use the iscsicli.exe command. You can find a description of the iscsicli commands using the following link from Microsoft: iSCSI Users Guide. This Word document provides details on how to create, display and delete iSCSI connections from the command line. For example to list target devices, use the command “iscsicli listtargets” as shown in Image 2.
While these commands are good and useful, there are two problems; firstly they require logging onto the server to run them (I want to run them centrally) and secondly, the available commands don’t give me exactly what I want to know. To get the data I want, I’ve utilised WMI (Windows Management Instrumentation), which provides a huge amount of information on a running Windows system. The iSCSI details are all stored in classes that start MSiSCSI and MSiSCSIInitiator. I’ve created two Powershell scripts, called iSCSIListSessions and iSCSIListDevices. The first lists active and pending iSCSI sessions, the second is a bit more useful and lists sessions and the associated devices.
Each script requires the host name to be specified as a command line parameter. See Images 3 & 4 for example output. I’ve also attached both scripts to this post for download if anyone is interested in using them. Note: You use these scripts at your own risk. The scripts are pretty basic and assume the userid you’re logged in with is the one for accessing the remote server, so you need WMI permission on your logged in userid for this to work. If I get time, I may produce something more flexible that would allow credentials to be overridden.
Make sure you rename the file extension from .txt to .ps1 before using the scripts.
- Netapp: The Inflexibility of Flexvols (12,343)
- Windows Server 2012 (Windows Server “8″) – Storage Spaces (11,507)
- Enterprise Computing: Why Thin Provisioning Is Not The Holy Grail for Utilisation (9,694)
- Comparing iSCSI Targets – Microsoft, StarWind, iSCSI Cake and Kernsafe – Part I (7,521)
- Windows Server 2012 (Windows Server “8″) – Virtual Fibre Channel (7,410)
- Review: Compellent Storage Center – Part II (7,374)
- Why Does Microsoft Hyper-V Not Support NFS? (6,770)
- How To: Enable iSNS Server in Windows 2008 (6,314)
- Data ONTAP 8.0 – Part III (5,764)
- How Many IOPS? (4,727)
- Comparing and Contrasting All Flash Arrays – All Vendors (32)
- The Maturing of Flash Storage (10)
- Black Friday Comes Early for Violin (2)
- The Virtual Machine is a Legacy Construct (2)
- Reinventing The Storage Array and Learning From Blackblaze (2)
- Performance Tier or Capacity Tier? – No It’s the Working Set (1)
- Quick Thought: Gartner SSD Market Analysis (1)
- Storage IPO Season – Violin Memory and Pure Storage (1)
- HP 3PAR 7450 All Flash Array (1)
- Tech News: Hitachi, HP & Simplivity (1)