H9Labs

March 2009 - Posts

  • The GuessMyOS plug-in updated - Supports Netware and BSD

    The GuessMyOS plug-in has been updated to include support for styling Novell Netware and BSD guest operating systems. Unfortunately I do not have either guest OS installed on any of my systems, so if you can, please let me know if my updates actually work. I can at least say that it doesn't cause the system to come crashing down. You can download the latest version here.

  • A facelift for lostcreations.com

    While I am working at Hyper9, lostcreations.com will become h9labs.com to reflect the bleeding edge R&D that I'm doing. The site redesign is primarily cosmetic, and lostcreations.com still works as a URL. I'm just trying to make sure that if you've been coming to my site to get the coolest software in the virtualization industry then you can just keep on coming. If, however, you are new to the game, then h9labs.com and h9labs.hyper9.com work as well.

    -- 
    -a 

  • Following up on Out-DataSet

    There has been some confusion on what people will use Out-DataSet for, and I wanted to take a moment to explain the reasons for its creation in hopes it will explain why you might use it. I was working on a contract gig for Icomasoft (prior to joining Hyper9) where they were taking *any* PSObjects and using the Telerike Grid View and Charting controls to graphically represent the data output from PowerShell scripts/cmdlets, such as Get-VM, Get-Process, etc. A constraint on the contract was that the CTO of Icomasoft wanted the information in the grid view to be an exact replica of what is displayed when Format-Table (default formatter) is used to view objects. So, I could either parse the raw text, which I did try, but ultimately gave up on due to too many variations in column alignment, or I could go with my eventual solution, actually dig into the Format-Table cmdlet and pull the data that I knew had to be there out (FYI - This is what Microsoft's Out-GridView does in PSv2 as well). The CTO of Icomasoft gave me permission to open source Out-DataSet since it was not part of the original contract and thus I released it under the H9Labs brand.

    What are the uses of such a thing? Well, the obvious use is that you can produce data that is formatted exactly as Format-Table formats things. This means that you don't have to worry about which properties to grab from a Process object or a VirtualMachine object, you can simply use Out-DataSet and know that the same format schema that the Format-Table cmdlet uses will be used to populate the data set. This also means that you can write PSv1 code which can bind controls to your data sets, such as grid views, list boxes, etc.

  • Introducing H9Labs PowerShell Cmdlets - Out-DataSet

     

    The free and open source H9Labs PowerShell Cmdlets project consists of a series of PowerShell cmdlets created by the fine folks at H9Labs (that would be us), which we find useful and wanted to give back to the community. To that end, here are the H9Labs PowerShell Cmdlets!

    Out-DataSet

    Out-DataSet is an extremely useful and needed cmdlet. You can use it to pipe any type of data that can be formatted with the built-in cmdlet, Format-Table, into a typed Microsoft .NET System.Data.DataSet. This allows an unlimited manipulation of data that you simply cannot achieve with text globbing. This cmdlet is experimental in nature because it was achieved by reverse engineering the Format-Table cmdlet to pull the data directly from internal data structures that Microsoft does not expose via its public API. This was a necessary task in order to represent the data with 100% accuracy every single time.

    Because the built-in cmdlet, Format-Table, is used to pre-process objects for a DataSet, an internal PowerShell runspace is created in order to execute the FT cmdlet. Internal PS runspace’s only load the built-in format schemas, not any other format schema files, which means that if your objects require an external format file for FT to work correctly, then you must use the Out-DataSet’s FormatSchemas parameter to pass that information in so it is loaded. By default the Out-DataSet cmdlet will attempt to load the VMware VI Toolkit’s format schema if it is available via the Registry.

    Examples

    Here are a few examples of using the Out-DataSet cmdlet.

    Loading the Current Processes into a DataSet

       1:  PS C:\projects\h9labscmdlets> get-process | out-dataset
       2:   
       3:  RemotingFormat          : Xml
       4:  SchemaSerializationMode : IncludeSchema
       5:  CaseSensitive           : False
       6:  DefaultViewManager      : {System.Data.DataViewManagerListItemTypeDescriptor}
       7:  EnforceConstraints      : True
       8:  DataSetName             : DataSet
       9:  Namespace               :
      10:  Prefix                  :
      11:  ExtendedProperties      : {}
      12:  HasErrors               : False
      13:  IsInitialized           : True
      14:  Locale                  : en-US
      15:  Site                    :
      16:  Relations               : {}
      17:  Tables                  : {}
      18:  Container               :
      19:  DesignMode              : False

    You can then print out the data set’s only table to see the information that was loaded.

       1:  PS C:\projects\h9labscmdlets> (get-process | out-dataset).Tables[0] | ft
       2:   
       3:       Handles       NPM(K)        PM(K)        WS(K)       VM(M)      CPU(s)          Id ProcessName
       4:       -------       ------        -----        -----       -----      ------          -- -----------
       5:           102            5         1116          232          32        0.17         372 alg
       6:           616            8         2872         3272          28      122.81         644 csrss
       7:            89            4          900         1620          29        4.56        2336 ctfmon
       8:          1616           81       242376        27408         855      313.03         336 devenv
       9:          1423           72       278244        25760         724       42.92        4008 devenv
      10:           411           10        12756         9444          71       72.75        1332 explorer
      11:           443           16        12584        11744          72       91.58        2356 explorer
      12:           291            8         3504         3176          51       14.78        2292 gnotify
      13:           114           35         9948          240          92        0.69        1552 H9WebServer
      14:            42            2          496          200          14         0.8        1780 HPZipm12
      15:             0            0            0           16           0                       0 Idle
      16:            32            2          612          396          28        1.05        2380 JetBrain...
      17:           249            7         4564          376          46        0.52        3276 jucheck
      18:            88            3          972           48          30        0.13        2168 jusched
      19:           412           10         4016          852          41       16.67         724 lsass
      20:           127            3          936          928          27        1.33        1640 mdm
      21:            93           34         2188         1024          37         6.3        1748 oodag
      22:            75            4         1464         1428          35        1.34        2324 oodtray
      23:           263            6        33548        25084         132        1.86         776 powershell
      24:           163            5         2396          336          44        0.33        2556 rapimgr
      25:           349           14        72856         2352         234           5         772 Reflector
      26:           510           31       356628       101800         572      184.61         816 Reflector
      27:           327            8         4352         1512          51         9.3         712 services
      28:            21            1          168           52           4        0.17         588 smss
      29:           156            6         4776         1744          47        1.31        1400 spoolsv
      30:           221            6         2740          512          60        0.55         900 svchost
      31:           326           13         2028         1568          33        1.69         972 svchost
      32:          1724           58        25968        16976         174      141.72        1056 svchost
      33:            78            3         1344         1004          29        1.98        1104 svchost
      34:           199            6         1700          684          36        0.63        1144 svchost
      35:           118            4         2460          164          36        0.27        1848 svchost
      36:          1160            0            0           44           2      666.22           4 System
      37:          1268           48       328172       102952        1159      149.22        1604 tomcat6
      38:           105            5         8792         6508          52       57.47        2100 TSVNCache
      39:            23            2          564           68          15        0.22         888 vmacthlp
      40:           210            4         1996         1784          37      536.94        1936 VMwareSe...
      41:            33            2          836          780          29        0.39        2200 VMwareTray
      42:           227            7        11188         5112          72       23.33        2248 VMwareUser
      43:           141            6         1300          508          45        0.66        2456 wcescomm
      44:           328            9         5072         2504          49        6.67         668 winlogon
      45:           259           39        16516          848         127         1.7        2532 Xenocode...

    Would You Like to Know More?

    You can read more about and download the H9Labs PowerShell Cmdlets project at its SourceForge project site, http://h9labscmdlets.sourceforge.net/.

     

  • Introducing the H9Labs GuessMyOS Plug-in for VI3

    First of all, how cool is it that these guys are paying me to essentially work on the same stuff I used to do for fun? Many thanks to the fine folks at Hyper9 for funding my exploration of the VMware code base. I couldn't ask for a better group of fellows and fellowettes to work with!

    Down the Rabbit Hole

    As I dig deeper into the VI client code base I find that I am able to do more interesting things, including affecting parts of the VI client that are not even exposed by the plug-in interface. As I was proof-of-concepting some various ideas that were floating around in my too-big-for-my-body head, I realized I could do something visually interesting with the VI client with what I'd uncovered thus far. Hence, the GuessMyOS plug-in for VI3.

    All the Pretty Colors

    So what does the plug-in do? Well, it is pretty simple -- the icons for VMs in the VI inventory tree are replaced with guest OS-specific icons for Windows and Linux guests. You'll notice in the image to left that the VM icons are specific to the guest OS the VM is running -- a Windows flag for Windows and Tux for Linux. Even the power state badges have been preserved. The single Solaris host has not been skinned yet because I haven't created the icon set for Solaris. I am working on that as well as a BSD devil.

    That is So Cool!

    It is isn't it? You're probably wondering how to do something like it yourselves. Well, it's not easy, but it's about to get a lot easier. I have been doing so much with the plug-in architecture in VI3 and vSphere4 lately that I've begun on a plug-in builder that will make it trivial for developers to create their own plug-ins that hook into the deepest bowels of VI3 and vSphere4. I'm not sure how Hyper9 will be making this plug-in builder available yet, but stay tuned to this space to find out!

    Downloading the Plug-in

    You can get the GuessMyOS plug-in at the following link. Stay tuned for an update on the status of all my previous and future plug-ins. Hyper9 is about to make an announcement regarding bleeding edge virtualization development that we hope will make a lot of VI admins (and developers) incredibly happy.

    -- 
    -a

  • Introducing the H9Labs Search Bar Plug-in for VI3

     

    Better Late Than Never

    Dang the inter webs are fast! Before I was able to get a blog post up describing the new plug-in and how to use it, the Twitter world was already alive with news of my latest creation. I suppose I should be flattered, but I do like to stay ahead of things with all the right documentation in order to reduce confusion. Well, better late than never I suppose…

    A Brief Explanation

    As some of you may know, I have released a new VI3 plug-in via H9Labs called the Search Bar Plug-in for VI3. The plug-in adds search capabilities to VI3 clients through an integrated search bar in the upper-left hand corner of the client. This functionality is present by default in VMware’s recently announced vSphere4, but severely lacking in VI3. I, along with my CTO, Dave McCrory (who gave me great advice on the plug-in and produced the H9Labs graphics for it), figured we would simply back port the search capabilities from vSphere4 into VI3.

    The H9Labs Search Bar Plug-in for VI3 in action

    The H9Labs Search Bar Plug-in for VI3 in action

    Installing the Plug-in

    The plug-in should be simple to install. Simply go to the Hyper9 Store and download the installer (free registration required). Because I am now working for Hyper9, you will have to create a free account to access my software. I’m sorry, but those are the breaks necessary to pay a mortgage in today’s US economy.

    Once you have the installer simply double-click on it to launch the installation wizard. The only value you should have to enter is the name of the Hyper9 server you want to the plug-in to interact with. If you don’t have a Hyper9 server I highly recommend that you download one and give it a try at Hyper9.com. If you do not have or do not wish to try a Hyper9 server at this moment then you can simply leave the field blank and click next. Once the installer has completed, you may launch the VI client.

    Using the Plug-in

    Once the VI client has finished starting up you may notice a few additions to the interface.

    A close-up of the H9Labs Search Bar Plug-in for VI3

    A close-up of the H9Labs Search Bar Plug-in for VI3

    For one, there is now a new button in the main toolstrip. This is the Hyper9 button that will launch the Hyper9 interface directly from within the VI client. If you did not specify a Hyper9 server during installation then this button will simply take you to the Hyper9 website.

    The second addition is a little more obvious: there is now a text box located next to the VMware logo in the upper-right hand section of the VI client. Pretty cool huh? Kids, if you want to try adding components directly to the VI client, I will give you this hint. Remember, you’re working in .NET, and you can basically do whatever you want to a program running in .NET by attaching to running memory and manipulating it as you see fit. We in the biz call it gleaming the cube. Okay, we don’t really call it that. Well, okay, I have no idea what the biz is. I’m just saying, that you too can modify the .NET client, but aside from telling that it requires some serious reflection (<– HINT, HINT) on your part, I cannot give your further pointers.

    VI admins can use the search bar to find items in the VI inventory by using pattern matching on names and IP addresses (for VMs and hosts). The search bar’s drop-down menu divides results into several categories.

    • Clusters
    • Datacenters
    • Datastores
    • Folders
    • Hosts
    • Networks
    • ResourcePools
    • Templates
    • VirtualMachines

    You can also short-cut searches to a specific type of object by prefixing the search pattern with the following text:

    • ccr:
    • cr:
    • dc:
    • ds:
    • folder:
    • host:
    • ip:
    • net:
    • rp:
    • template:
    • vm:

    All of the prefixes should be self-explanatory except for perhaps the cr: and ccr: prefixes. Those match compute resources and cluster compute resources, or as the latter is more commonly known, clusters.

    One of the really cool features of the plug-in is that when you find the item you are looking for, double-click on it with your mouse or highlight it and click Enter and the VI inventory will change views to display the item. For example, if you are currently looking the the Hosts and Folders view and you click on a Datastore, the inventory will change to the Datastore view. Cool, huh?

    At any time in the VI3 client a VI admin can use the key combination Ctrl-Shift-f to jump directly to the search bar. While in the search bar a user can type a search and then use the down arrow key to move into the search results and then use the Backspace or Escape keys to go back to the search box.

    You can also simply strike the Enter key while typing in a search and the VI client will transition to the integrated Hyper9 interface and submit your search query to the Hyper9 server, leveraging the wondrous and magical powers of Hyper9. Additionally, you can right-click on hosts and VMs in the VI inventory tree and then click on the Hyper9 menu item to search for that item in the Hyper9 interface as well.

    That’s All I Have to Say About That…

    If you have any questions, check out the search bar’s support forum at the Hyper9 community portal. I will leave you with this screen cast walking you through how to use the plug-in by Hyper9’s resident genius, Zahid Ghauri.

     

Bookmark and Share