- 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,478)
- Windows Server 2012 (Windows Server “8″) – Storage Spaces (11,618)
- Enterprise Computing: Why Thin Provisioning Is Not The Holy Grail for Utilisation (9,796)
- Comparing iSCSI Targets – Microsoft, StarWind, iSCSI Cake and Kernsafe – Part I (7,610)
- Windows Server 2012 (Windows Server “8″) – Virtual Fibre Channel (7,598)
- Review: Compellent Storage Center – Part II (7,474)
- Why Does Microsoft Hyper-V Not Support NFS? (6,905)
- How To: Enable iSNS Server in Windows 2008 (6,416)
- Data ONTAP 8.0 – Part III (5,804)
- How Many IOPS? (4,825)
- A Ten Year Flash Array? No Thanks! (217)
- What is EMC’s Project Nile? (30)
- Comparing and Contrasting All Flash Arrays – All Vendors (27)
- Why Does Microsoft Hyper-V Not Support NFS? (23)
- Nimble Storage Reaches Successful IPO – What Next? (20)
- XtremIO: What You Need to Know (Updated) (19)
- Netapp: The Inflexibility of Flexvols (15)
- Windows Server 2012 (Windows Server “8″) – Storage Spaces (14)
- HP Discover – All-Flash Podcast (14)
- Another View on HP Moonshot (12)