May 17, 2012

WP-vSphereStats : In the wild

I told myself I would post the first person in the wild that used my vSphere Stats WordPress plugin. And here is the first I found from Steve’s site: www.virtualizationandwaffles.com

Cool environment Steve!

Now I wonder who will have the biggest?

.nick

 

Show And Tell : First vSphere Plugin for WordPress!

I can’t wait to see what crazy stuff you come up with next…

That was something Chad Sakac told me a few months ago. Back before my latest Celerra VSA version (get it here), or my UIM appliance (sorry that one is vSpecialists eyes only right now).

I really have not done anything off the wall recently. Most of my day to day effort is dedicated to absorbing the information fire-hose that my team deals out on a daily basis. I have a couple of side projects I have been wanting to catch up on but they are all to big to start at the moment.

And to be honest it has been getting to me. I like contributing to the vSphere community and it has been a while (in my head at least) since I released something for that purpose.

So in that spirit I had a brainstorm Friday evening (2 days ago). I had been working on my blog and had a sudden crazy idea…

What if there was a WordPress plugin that would display stats from my vSphere home lab or work? Wouldn’t that rock??

Turns out there isn’t one. Or at least there wasn’t one till till now. After a weekend of coding I am happy to present the first WordPress Plugin for VMware vSphere: WP-vSphereStats

If you are super observant you may have noticed the plugin is actually running in the sidebar on the left. Basically the way it works is pretty simple.

The WP-vSphereStats plugin comes in two pieces. One is the WordPress Plugin itself. It is tested and compatible with WordPress 2.9 and above. It uses the new widget changes in 2.8 and is dependent on some helper changes in 2.9.

The second piece is a Windows command line tool used to pull stats from your vSphere Environment and posts them to a web service enabled by the WP plugin. The combination of these pieces means some pretty cool features:

  1. The WP plugin allows you to run multiple widgets with different stats

  2. All web service calls to your blog are secured by a key that is randomly generated. This prevents outsiders from changing you stats.

  3. I tried to bring a wide range of interesting stats and safe for public stats. These include: total CPU, RAM, Storage, # of Hosts, # VMs, # of VMotions, Power States, etc.

  4. The WP Plugin has error control to alert you when there is a problem with the web call (from admin settings).

  5. The command line tool has two modes. One where you create a configuration file that is saved where you specify. The other where you point it to a configuration and update a WordPress blog. This allows you to update multiple blogs, schedule as you like, and securely caches login information for you vSphere Environment in XML.

  6. I stayed away from creating new tables in the database. Everything is as lightweight as possible.
  7. And best of all, the install is a snap. Two zip files extracted and you’re done.

This whole mini-project was a mini-vacation for me from working on my VMworld session and studying for my CCNP test next week. I tried to keep the whole program simple to allow easier support for me and  more fun for you. I scrapped the idea of an installed Windows Service and opted for the command line tool. But, I did spare no expense in time making sure the WP plugin was slick as can be. My apologies to those that don’t use WordPress. I may find time to write for another CMS but, if you are feeling intrepid, feel free to convert to your own purpose :)

To download and use the WP-vSphereStats plugin go here: WP-vSphereStats plugin

The plugin is in the process of being added to the WordPress Codex. Should be available from there by the end of the week.

And as always please leave comments if you like or dislike. Feedback always helps, especially if you have an idea on how to improve.
See you at VMworld 2010

.nick

vSphere Mini Monitor : Now With More Cowbell!

The Twitter fail whale error message.
Image via Wikipedia

Roughly three weeks ago I released my first vSphere tool called the vSphere Session Monitor. The response to this was extremely positive and hopefully accomplished my goal of encouraging others to spend some time experimenting with their own ideas. In my mind, the success of adoption of cloud technologies within an organization will be tied to how they grasp the extensibility of virtualization using vSphere.

For me, a lot changed in the last three weeks. I announced I was joining EMC and leaving my current company which, when the dust settled, ended up resulting in a nice two week temporary unemployment period.

Back when I released VSM 1.0 and before the icons were dry on the shortcuts, I had already written up a mental list of features I wished I had added to it. So I quickly got busy working on the new version. However, progress was quickly slowed down to a crawl by the fact that I no longer had an environment to test against. So after spending half a week getting a decent lab setup I finally got back to finishing the new tool. I feel this version will really show that there are almost unlimited possibilities to what you can do with the API’s that VMware has provided.

First things first, the vSphere Session Monitor will from now on be officially renamed the vSphere Mini Monitor. This is version 2.0 and brings a massive list of features, brand new UI, and structured approach to how it is designed.

So here is what is new in 2.0:VMM UI

New UI
Because of all the new features I had to revamp the UI to be better organized and look slicker.

Saved Configuration
One big request from the last release was the ability to save credentials when the VSM (now VMM) was closed. The new VMM will save all configurations when closed including username, password, vCenter URL, and alerts and channel settings. I also implemented encryption of all security-sensitive data (passwords, tokens). These configurations are stored per unique user securely for multiple user workstations and all encrypted credentials will not work for another user.

Alerts
Now instead of just monitoring sessions on your vCenter server, the VMM will now monitor a large number of changes to multiple objects. Within the UI there is now the ability to turn on or off specific Alert categories. Here is a list of the possible choices:

Sessions
New Session*
List Sessions*
Terminated Session (New!)

Datacenter
Not very much here yet

Cluster
Creation
Deletion
Changes (HA, DRS, etc)

Host
Connection/Disconnection
Addition/Removal
Changes (Network, Storage, Maintenance Mode State)

Resource Pool
Creation
Deletion
Changes

Virtual Machine
Creation
Deletion
Changes (Device Add/Remove, CPU, Memory)
Snapshots

Distributed Switch

Creation
Deletion
Changes (Uplinks, Port Groups)

Datastores
Renaming

*original features

As you can see, this was quite a lot of work. All the alerts are based around letting you know something is occurring and if available who is doing it. The really cool ones are at the Virtual Machine and Host level. Those were quite fun to code.

ChannelsVMM Channels
In VSM 1.0 there was only one method to alert the user, the notification tray. But, what if you weren’t looking at your tray? What if you were down the hall eating an apple and getting the newest gossip from the front desk guy/girl? That is where the definition of ‘Channels’ comes in. You can now choose to alert via multiple methods. Here is a list and explanation of each:

Notification Tray
This is pretty similar to the VSM 1.0 except with the addition of new alerts it can be quite a bit busier. I also changed it to condense similar messages into one popup instead of multiple. This means if someone changes the CPU count, removed a CD device, and renames a VM you will see one popup showing all three changes.

Email
Pretty self-explanatory, this will basically send an email to you or a DL with the exact text as the notification tray popups. This requires SMTP relay rights for the IP that VMM is sending from to the email domain VMM is sending to for the server specified in the settings. This really comes in handy when you are going to be out of office or away from your desk and want to still see the alerts.

RSS Feed
This is my second favorite channel and works really well. Basically you set an output path, either local or UNC, that VMM will drop an RSS.XML file into. You can have the path be a folder on a web server or run a script to copy it to one. This will provide an RSS 2.0 compliant feed of the last thirty VMM alerts and will be updated each new alert. This is very handy for those that don’t like the notification tray or want to share alerts among a team.

Twitter
Yes, you read that right. By far my favorite feature in the new VMM 2.0 is that you can now use Twitter as a channel for alerting. This required quite a bit of elbow grease and testing but works wonderfully.

When you enable this channel the VMM will open a browser window prompting you to Authorize VMM for a Twitter account. It will also open an input window for you to enter the corresponding PIN number. After you login into the chosen Twitter account and approve the VMMTool application, Twitter will supply a PIN which you type/copy/paste into the VMM input window. This will authorize VMM to update this account’s tweetstream with alerts. This authorization is per workstation and per user. It will stay authorized until you remove access via Twitter or delete the VMM application. All this is done via OAuth and even the tokens used are still encrypted at rest just to be sure.

This rocks for several reasons. If you are a Twitter addict like me you check your tweets every five minutes. Now your vCenter server will keep you up to date on what is going on from your cellphone or Twitter client. Big things to remember on this are: Don’t use your personal Twitter account for this. Make sure you make the Twitter account private to control who sees the tweets. Also, Twitter’s API is a little hit or miss sometimes(Fail Whale). Even though I get a update successful message back, sometimes the tweet may not show. I didn’t build in tweet validation yet so your mileage may vary. And remember that you don’t own the data on Twitter.

The purpose of the vSphere Mini Monitor is to provide a simple extension of the vSphere Web SDK to allow for real-time alerting of important user-based events on your vCenter server. It is not meant to replace a holistic monitoring platform. I wrote it to be secure, multithreaded, and lightweight. It is simply a cool geeky tool.

One quick disclaimer: I do not endorse using the VMM for anything other than your whitebox home lab in the closet under the stairs and even then only late at night when the wife and kids are asleep. I am not responsible for anyone opening up Visual Studio or a Java IDE and spending countless hours drinking Mountain Dew and learning object class structure. This product is not endorsed or affiliated with EMC Corporation at all. I technically don’t work for EMC till next week but, I am future-proofing this post.

To download the vSphere Mini Monitor click one of the links below. I have built both x86 and x64 versions. I only ask three things in return for this tool:

  1. Please post a comment below with your feedback. Bad, good, or indifferent.
  2. If you are a Twitter user follow me at @lynxbat to catch updates as they come out.
  3. Think real hard about the last cool idea you had. Now plan sometime this week and start working on it.

Download x86 version
Download x64 version

.nick

Look I’m A Tool! : vSphere Session Monitor 1.0

Patio hacking

(version 2.0 is now released! Go here)

So eight days ago I decided I was going to give another try to write an application that uses the VMware vSphere Web SDK. I had attempted this at least a year ago and never finished anything because of *insert excuse here*.

I always have ideas for cool (at least in my mind) tools swirling in my head. Even though I am a data center quadruple threat kind of guy (Microsoft, VMware, Cisco, and EMC), I like to do scripting and development to sharpen my mind. I always thought I was going to be a developer in college and love to turn ideas into reality.

So last week I fired up Visual Studio 2008 and started spending some nights coding. Along the way I found out some interesting things, caused a great blog post, and had a blast learning more about vSphere. I have a tendency to roll my challenges together and so decided to make this slick as possible including:

  • Making it a Tray Icon (A must for this app)
  • Doing all forms in WPF which I have never worked with before (XAML crash course)
  • Making all background processes multithreaded and eliminating the need for timers
  • Learning how to effectively use PropertyCollector.WaitForUpdates method to touch vCenter as little as possible
  • Building a proper MSI setup

On top of all this I went and wrote all the operations, connections, and credential pieces into classes for re-usability.  I am a bit of a perfectionist and probably went WAY overboard without much gain.

So without further self flagellation and glorification I present the: [drain file 2 url vSphere Session Monitor]

 

This little bad boy right here’s only purpose is to keep you informed of who is on your vCenter server.
Let me walk you through the steps to try it out.

Download the x86 installer from here: [drain file 2 url vSphere Session Monitor]

I do not endorse using this tool in production. Please test in a lab environment until you (if ever!) are comfortable using elsewhere.

Run the installer on the workstation of your choice. You must have .NET 3.5 installed. Also this workstation must have the ability to hit the vCenter Web SDK which is https://*your vCenter Server/sdk

After the application is installed, launch it from your new desktop shortcut or Program Files menu.

The application will prompt you for your vCenter fully qualified domain name (FQDN):

It will then prompt for you vCenter credentials:

If you entered everything correctly the tool will open up the main page:

And down in your notification tray a little pop-up will list current vCenter sessions:

 

Couple quick UI things to get out of the way:

  • To close the application, click the “X” in the main window.
  • Minimizing will hide the form. You can bring it back or hide it with a left-click on the notification tray icon.
  • If you right-click on the tray icon it will list the current users on the vCenter host.
  • The “Change Credentials” button will allow you to switch username and password. And the ‘Change vCenter Server” will let you change the FQDN you entered.

I bet at this point you are thinking: “Well Nick, that is cool and dandy but I can get that info from my vSphere client! Way to reinvent the wheel…”
Well… now for the best part. This is the real reason I wrote this little app. It all started with my senior engineer, Justin. He had a nasty habit of yelling out “What are you doing?” every time someone did something on a vCenter server. That got me thinking; “It would be cool if something popped up telling Justin someone logged in. And it would be even cooler if you didn’t have to have the vSphere Client running to do it.”
So with the vSphere Session Manager, the instant someone logs into your vSphere vCenter, you see this:

Not super fancy but if you want to know when someone is playing in your pool (like Justin) this will let you know.
Here are couple features I was going to add but will (maybe) later:

  • Storing of credentials (encrypted) – not too difficult, a little RSA key generation, mix in some environment specific salt, and dehydrate a class to XML.
  • Allow multiple vCenter hosts – You can open multiple monitors to watch each vCenter for now

So that is a few hours of my life dedicated to seeing how easy it is to utilize the VMware vSphere Web SDK. And from a datacenter guy I can definitely say that the documentation, community (thanks @sjin2008), and SDK made this a pretty easy task. I highly recommend everyone take your cool tool ideas and try something out too.

Do me a favor and leave comments with feedback/questions. Thanks!

 

.nick

Hello Hyper-V : Meet Reality (part deux)

Well my blog post yesterday drew way more attention that I thought it would. Part of the attention was a comment from the esteemed Ben Armstrong (twitter & blog).

He provided wonderful feedback and I have decided to highlight it here with my response. Not sure if I am breaking a blogosphere rule but, I shall claim etiquette ignorance and proceed.

Here are Ben’s comments:

Ben Armstrong
January 22nd, 2010 at 12:27 am

Hi Nick,

Just thought I would drop in to clarify some of the issues you raise around the issue of operating system support.

What we often talk about on the Hyper-V team is “Support versus support”. Hyper-V can run Windows NT 4.0 – and I would love it if we said that we support it, but we cannot say that – because Microsoft as a whole does not support Windows NT 4.0. And it really changes the story when you are the OS maker.

For example – let’s imagine that we did state that we supported Windows NT 4.0 on Hyper-V, and we compared the support experience between Microsoft and VMware:

VMware:

Customer encounters a problem with Windows NT 4.0 on ESX. They contact VMware – who after investigating the issue declares that “sorry – this is a bug in Windows NT 4.0, you should contact Microsoft”. When the customer contacts Microsoft they are told that Windows NT 4.0 is not supported. The customer still has a problem, but they do not feel lied to.

Microsoft:

Customer encounters a problem with Windows NT 4.0 on Hyper-V. They contact Microsoft – who after investigating the issue declares that “sorry – this is a bug in Windows NT 4.0, and even though we said we supported Windows NT 4.0 on Hyper-V we did mean that we supported Windows NT 4.0″.

Can you see why we (Microsoft) do not feel that we can make such statements? Meanwhile VMware currently states that they support every Microsoft OS from MS-DOS 6.22 onwards.

In regards to Linux support – when we state that we support a Linux distribution on Hyper-V, it means that we have signed formal support agreements with the owner of that Linux distribution. For example – if you have an issue running SuSE on Hyper-V, you can contact Microsoft product support. They will then work with Novel support engineers directly to solve the issue – without requiring you to bounce back and forth between the two companies.

As an aside – the problem with this approach is that it makes it hard to support versions of Linux like CentOS, where there is not a corporate entity who can sign a support agreement. That was one of the motivating points releasing our integration components under GPL – so that community supported distributions could provide the same level of support for Hyper-V as they provide for other platforms.

Cheers,
Ben

First off, thanks for the comments Ben. I appreciate your providing clarity and participating in a discussion

I completely understand the predicament around legacy Windows versions. Because of the dual ownership, Microsoft does have to maintain standards around support.

But, I disagree that at a higher-level this is a problem. I see this as the difference between strategic and tactical viewpoints with hypervisors (great post on this from Steve Kaplan here).
Here is an example:

Let’s say we have a customer that has 20 legacy servers running Windows NT 4.0.
They don’t have the budget to purchase replacement software, the original application creator is gone (and they didn’t have the source in escrow), and it is completely incompatible with new OS server versions.

With Hyper-V not only will they not be able to P2V (physical to virtual migration) these servers. They also would get zero support from Microsoft for Hyper-V hosts that encounter issues with these VM‘s. There is a built-in out for the support person on the other end of the phone. This translates into an implementation impossibility and extreme operational risk.

With VMware vSphere, not only is the P2V actually supported (allowing abstraction of the OS) but the VM’s themselves are supported on the hypervisor. That means if there is a specific issue with hypervisor configuration VMware will support, fix, and help with making this successful. I know people that have not only successfully virtualized legacy operating systems but, have also done it with extremely proprietary configurations (@tscalzott).

The hypervisor is a layer and a toolkit meaning the intent is to provide abstraction as well as options for business needs. Hyper-V is missing these options which, because of the tactical approach MS has, make it more limited in application. My points is the missing options and not an effort to downplay the features it does possess.

Microsoft’s (and your focus) on integrated support is because of the tactical approach to the hypervisor. Hyper-V it is built on the same platform as the server product and blends layers rather than abstracts. Support can be integrated but, in an abstraction model that is done successfully (empirically proven with VI3 & vSphere) this is not a critical need. When layers are abstracted you break the dependencies that exist in blended/tactical models. Integrated support is a core marketable value in tightly coupled dependency situations like hypervisor to storage, networking, and server components. In fact, that is one of the primary reasons VMware tightly maintains and accelerates their hardware compatibility list (HCL). Where abstraction does not exist this is essential and with vSphere is assumed by the ESX host. With Hyper-V the HCL is much broader because it is based on the underlying server operating system. But that is because Microsoft has abstracted hardware using the operating system (Windows Server). Problem is, that means all you have done is create another dependency upon a relocated layer. In fact if you think about it, the operating system with Hyper-V is now a layer above and below the hypervsior. This is a completely different approach to virtualization.

I am not saying Hyper-V has taken the wrong approach, I am just trying to clarify the real value of each product and the completely different approach. Microsoft has invested interest in businesses moving operating systems to newer Server version from a revenue perspective. Their motivation is inherit in their approach and marketing as evidenced by both the blog & your comments. Why would Microsoft invest major effort in reducing their ability to consume operation system market share?

On the other hand VMware’s interest in providing a extremely stable hypervisor with a robust feature-set that will work for as many possible deployment models as possible. They are successful despite the operating system choices of their customers. Being a customer I can testify that VMware support is extremely helpful in supporting guest OS’s on their platforms. While they won’t make changes application configurations (not stated at least), they do posses a massive knowledge base of how to successfully virtualize their long list of possible options.

However, in forward looking design scenarios Hyper-V does stand differently against newer Windows Server versions. With an apples to apples design using Windows Server 2008 and beyond, the battle is more over the cost, operational capability, and long-term value than support or compatibility choices.
Hyper-V does not have options that compete against VMware in heterogeneous operating system space and once you cross that line and make statements against operating system approaches, you have broadened the argument beyond an apples to apples comparison.

I really do appreciate the feedback and feel free to hit me back.

 

.nick

Reblog this post [with Zemanta]