Category Archives: Cisco

Check your Cisco UCS environment for issues with vCheck

Do you use Cisco UCS? If you do then this will interest you.  vCheck is basically a FREE HTML reporting framework that was written to originally check a VMware environment but as it uses PowerShell it is easily adjustable to check anything that is PowerShell enabled, like for instance…. UCS environments.

One of the objectives of me putting vCheck into github was the hope that people would be able to easily pick up the framework and create their own projects to check other PowerShell enabled products, this has already been done with a number of different products as listed below:

Download Link Github Project Example Output Page
vCheck for vSphere Click here Click here
vCheck for Exchange 2010 Click here Click here
vCheck for vCD Click here Coming soon
vCheck for SCVMM Click here Click here
vCD Audit script Click here Click here
vCloud Air Audit Click here Click here

And now you can add Cisco UCS to the list, Joshua Barton has done a great job of using the framework to create a new vCheck edition that will enable UCS Admins to run a check on their systems and bring back any known issues that may be a problem.  Don’t forget, this as with all the other vCheck editions is a community project so you can add your own checks very easily in the plugins folder, if you need help then check out this early video which was recorded of me showing how to easily do that.

So what does it check currently?

  • General Details
  • Recent Faults
  • Unassociated Profiles
  • High Pool Utilization
  • Fault Retention Policy
  • Default Adapter Behavior
  • Non-Functioning Enabled Ports
  • Switching Mode
  • Inactive Servers
  • Uplink Flow Control
  • LACP Policies
  • UDLP Policies
  • Maintenance Policies
  • Default Pool Schema
  • Chassis Discovery Policy
  • Power Policy
  • SEL Policy

What does it look like?

As you can see, the html file that is created, which can also be scheduled to be sent to you as an email looks pretty awesome:

UCS-vCheck

 

The full example can be seen here: http://www.foobartn.com/assets/examples/example-report.html

How do I download this and get involved?

Visit the Github Rep here: https://github.com/FooBartn/vCheck-UCS/tree/dev

Download it directly from here: https://github.com/FooBartn/vCheck-UCS/archive/dev.zip

And make sure you thanks Joshua on twitter via @FooBartn

PowerShell at VMworld 2012 San Francisco

Its that time again! – VMworld, and let me tell you, this year its going to be epic!

I wanted to give you a list of all the PowerShell and PowerCLI sessions listed in this years Session Catalogue for San Francisco, if you don’t have these booked make sure you add them straight away as room is running out fast !

I am personally looking forward to presenting with some superstars this year such as:

  • Luc “The Master” Dekens
  • Jake “Head in the Clouds” Robinson
  • William “API Guru” Lam
  • Eric “PowerTool” Williams
  • Aidan “I am the center of excellence” Dalgliesh

We have some great decks and some awesome demos planned, don’t miss them.  And if you see me come say hi and tell me how you use PowerCLI, you never know I may have a spare sticker, poster and badge to get rid of.

Sessions

INF-VSP1252 – What’s New with vSphere Automation

Click here to add
In this session Technical Marketing automation experts William Lam and Alan Renouf will take you through VMware Automation.You will learn which products are available, which products to use and how Automation fits into the VMware Suite of products. In this session Alan and William will take you through the exciting features available to use when automating VMware products, both beginners and experts will learn how to use new features to make your life easier and more productive. Monday, Aug 27, 2:30 PM – 3:30 PM

Wednesday, Aug 29, 9:30 AM – 10:30 AM

William Lam – Sr. Technical Marketing Engineer, VMware, Inc.

Alan Renouf – Sr. Technical Marketing Architect, VMware, Inc.

INF-BCO2155 – vCloud DR for Oxford University Computing Services – Real World Example

image
Resiliency is a key aspect of any infrastructure—it is even more important in infrastructure-as-a-service solutions. This session will include a tour of a real world vCloud DR solution deployed at Oxford University Computing Services (OUCS). Throughout the session there will be detailed guidance on how both the management and resource clusters were designed, deployed and automated. Furthermore the details of how SRM in conjunction with VMware vSphereTM PowerCLI (PowerCLI) was used to automate the end-to-end recovery of a vCloud Director–based infrastructure. This session will offer a perfect complimentary follow on from the whitepaper regarding the high-level process produced by Duncan Epping and Chris Colotti and the Automation session by Alan Renouf and Aidan Dalgleish. The paper combined with the Automation session will describe the process and the automation principles whereas this session will describe a complete real world implementation. Monday, Aug 27, 3:30 PM – 4:30 PM

Aidan Dalgleish – Consulting Architect, VMware, Inc.

Adrian Parks – Senior Systems Administrator, Oxford University Computing Services

Gary Blake – Senior Consultant, VMware, Inc.

INF-VSP1329 – PowerCLI Best Practices: The Return!

image
Building on the success of our PowerCLI Best Practices sessions from VMworld 2011, we want to show you our next collection of PowerCLI best practices. This session will show and demonstrate PowerCLI in all its aspects managing and automating not just VMware vSphere® but also VMware vCloud Director®, VMware® View™, VMware vShield™ and more Tuesday, Aug 28, 3:00 PM – 4:00 PM

Wednesday, Aug 29, 8:00 AM – 9:00 AM

Alan Renouf – Sr. Technical Marketing Architect, VMware, Inc.

Luc Dekens – Systems Engineer, Eurocontrol Maastricht.

INF-VSP2448 – Automating Bare Metal to the Cloud and Beyond

image
When working in the cloud automation is key, working at the scale of the cloud VMware customers need an easy and reliable method of deployment which gives guaranteed results 100% of the time. Cisco, VMware and Bluelock will show you how to automate the build of your complete vCloud Director Infrastructure from the bare metal up to the cloud and beyond. Learn how PowerShell can be used to create a single easily readable and adaptable script to ensure your system is built quickly and efficiently, watch as a system is built before your very eyes with no magic tricks or rabbits in sight. Tuesday, Aug 28, 12:00 PM – 1:00 PM

Eric Williams – Technical Marketing Engineer, Cisco Systems Inc.

Alan Renouf – Sr. Technical Marketing Architect, VMware, Inc.

Jake Robinson – Solutions Architect, BlueLock

INF-VSP1856 – Become a Rock Star with PowerCLI and vCenter Orchestrator

image
Automation is the future of cloud, and in this session attendees will learn how to identify areas in their environment that are primed for less administrator interaction. The combination of PowerCLI and VMware® vCenter™ Orchestrator puts considerable power in even the greenest users. Attendees will learn how to identify areas for automation and start learning to discern which tool is best suited for the job and when to use them together. Monday, Aug 27, 4:00 PM – 5:00 PM

Josh Atwell – Systems Administrator, Cisco Systems Inc.

INF-VSP2164 – Automation of vCloud Director Disaster Recovery

image
Resiliency is a key aspect of any infrastructure—it is even more important in infrastructure-as-a-service solutions. This session will include guidance, examples and demonstrations of the use of VMware vSphereTM PowerCLI (PowerCLI) to automate the recovery of a vCloud Director–based infrastructure. In particular the session will focus on the automation of the recovery steps for vCloud Director managed vApp workloads, that cannot be recovered with vSphere Site Recovery Manager (SRM). This session will offer a perfect complimentary follow on from the whitepaper regarding the high-level process released by Duncan Epping and Chris Colotti. The paper discussed the process and this session will describe the automation Tuesday, Aug 28, 4:30 PM – 5:30 PM

Alan Renouf – Sr. Technical Marketing Architect, VMware, Inc.

Aidan Dalgleish – Consulting Architect, VMware, Inc.

Group Discussions

GD27 – PowerCLI with Alan Renouf

image
During this group discussion we will talk about what can be automated, discuss the merits of using PowerShell and PowerCLI, show examples and talk about the best methods of achieving integration. We will also discuss tips and tricks you have learned and the best methods for automating the VMware products. Come prepared with examples and questions and remember this is a Group Discussion! Monday, Aug 27, 10:30 AM – 11:30 AM

Thursday, Aug 30, 12:00 PM – 1:00 PM

Alan Renouf – Sr. Technical Marketing Architect, VMware, Inc.

Hands on Labs

HOL-INF-10 – Script and Develop Your Cloud Solution with PowerCLI and the vSphere Web Client SDK

This lab is presented as two 30 minute lightning labs to help you extend your VMware solution. The PowerCLI module covers automating vSphere and vCloud Director. Novice users will learn to use the tool and more advanced users will get familiar with the new functionality available in the latest release of the product. You will walk away with a better understanding of PowerCLI and how it can help you in your day-to-day work. The vSphere Web Client SDK module teaches you several techniques for extending the vSphere Web Client. The goal of this module is to demonstrate the close integration that is possible with the vSphere Web Client SDK, and the ease with which you can integrate your own solutions into the vSphere Web Client. HOL

Attend the self paced Hands on Lab.

Videos

Still cant decide ?  Take a look at some of the session videos where the presenters explain more information…..

Optimized PowerShell performance with Cisco UCS PowerTool

imageIn the last post I gave a quick overview of one of the many cool features of the Cisco UCS PowerTool PowerShell Module, I showed how they had made it easy for the admin to pick up their toolkit and use it, how navigation over 1000+ cmdlets could be made easier, if you didn’t read it then you can find the post here.

I quickly realized this was not going to be a one blog post affair as there are so many great features in this PowerShell module which impressed me, features I have not seen before in PowerShell (I may be wrong).

How fast is your code ?

One thing I have seen both developers and scripters fight with is the speed at which things can be done, most times when not using PowerShell to just manage the local machine there is an element of accessing an external system.  There are many ways you can access these external systems depending on the company and the way the cmdlets are written.  Its great that PowerShell often has a certain amount of caching, when objects are retrieved from the remote systems or machines they can be altered locally and then sent back to the original destination.

It’s the sending back and retrieving information which can often cause some PowerShell cmdlets to be slow when working on large systems or when working with multiple systems.  Developers of PowerShell Modules and snapins often do a great job of optimizing this to make things faster.

In Cisco UCS PowerTool I saw a method I had not seen before which I thought was both a very system admin friendly and also optimized way of doing this.

The following example code shows how to create a simple boot policy, for the purpose of this post it doesn’t really matter what the code looks like but keep in mind that after the end of each line, and during the line there will be calls to the Cisco UCS API retrieving and setting data, at the end of the below code we may have called the API around 10 times, add this up into a more complex piece of code and then ask it to work on multiple systems and our external calls soon mount up, each external call having an impact on the final speed of the script.

$BootPolicy = Get-UcsOrg -Level root  | Add-UcsBootPolicy -Descr "Test Boot Policy" -EnforceVnicName "no" -Name "Test-BootPol" -RebootOnUpdate "no"
$BootLan = $BootPolicy | Add-UcsLsbootLan -ModifyPresent -Order "2" -Prot "pxe"
$BootLan | Add-UcsLsbootLanImagePath -BootIpPolicyName "" -ISCSIVnicName "" -ImgPolicyName "" -ImgSecPolicyName "" -ProvSrvPolicyName "" -Type "primary" -VnicName "1"
$BootPolicy | Add-UcsLsbootVirtualMedia -Access "read-only" -Order "1"
$BootStorage = $BootPolicy | Add-UcsLsbootStorage -ModifyPresent -Order "3"
$BootSanImage = $BootStorage | Add-UcsLsbootSanImage -Type "primary" -VnicName "0"
$BootSanImage | Add-UcsLsbootSanImagePath -Lun 0 -Type "primary" -Wwn "20:00:00:00:00:00:C0:00"

How Cisco makes this faster

The Cisco UCS PowerTool team have put some thought into this and as well as the performance enhancements built into the cmdlets they have also introduced a couple of cmdlets to allow you to make a single optimized call to the API – this is a fantastic idea as you can basically build up your code in a nice block and then send it all, optimized for the API in one call to the Cisco UCS API.

Lets take a look at our second example of this code:

Start-UcsTransaction
	$BootPolicy = Get-UcsOrg -Level root  | Add-UcsBootPolicy -Descr "Test Boot Policy" -EnforceVnicName "no" -Name "Test-BootPol" -RebootOnUpdate "no"
	$BootLan = $BootPolicy | Add-UcsLsbootLan -ModifyPresent -Order "2" -Prot "pxe"
	$BootLan | Add-UcsLsbootLanImagePath -BootIpPolicyName "" -ISCSIVnicName "" -ImgPolicyName "" -ImgSecPolicyName "" -ProvSrvPolicyName "" -Type "primary" -VnicName "1"
	$BootPolicy | Add-UcsLsbootVirtualMedia -Access "read-only" -Order "1"
	$BootStorage = $BootPolicy | Add-UcsLsbootStorage -ModifyPresent -Order "3"
	$BootSanImage = $BootStorage | Add-UcsLsbootSanImage -Type "primary" -VnicName "0"
	$BootSanImage | Add-UcsLsbootSanImagePath -Lun 0 -Type "primary" -Wwn "20:00:00:00:00:00:C0:00"
Complete-UcsTransaction

I feel the need, the need for speed**

** Anytime you can get a movie reference in a blog post its gotta be worth it Winking smile

As you can see from the above code, we have added a Start-UcsTransaction at the start and a End-UcsTransaction at the end, so what does this do ?

It allows all the code in between these statements to be gathered by the Cisco UCS PowerTool and optimized, then at the end one call is made to the API sending the complete data.

Performance boost or what ?!

I think the benefits of this are clear, more efficient, optimized and less frequent calls to the API can only mean faster code.

I think its great that Microsoft created PowerShell and third parties are continuing to pick it up as it becomes the default scripting language for the datacenter, in my eyes this is one area where a third party company has taken a fresh new look at the way things are performed and made a clear enhancement.  Very cool stuff, and there is more to come in further posts, I haven’t even got to the best feature yet !

Getting started with Cisco UCS PowerTool

imageToday I was lucky enough to grab some time with Eric Williams and colleagues over at Cisco, they held a one day training course on their UCS PowerTool which is a PowerShell module for managing UCS Systems, if you haven’t seen the Cisco UCS systems I suggest you get out from under that rock and check them out, they are fantastic implementation of a PowerShell module, currently they are available as a beta under the Cisco Developer network here.

Eric and the PowerTool Developers have done a fantastic job on PowerTool, at the moment they have 1498 cmdlets, I wont list them all here as that would be a post unto itself.  A huge amount of cmdlets and that means a huge amount of coverage, they have around 99.1% coverage.

There were many areas in this module that impressed me, most of all was the fact that only 35 of these cmdlets were written manually, the other cmdlets were generated automatically using the UCS Manager XML API and the schema, and I’m not talking about cmdlets which are just basic cmdlets either, these are fully pipeline enabled cmdlets !

In this post I will just mention one of their features which impressed me but I have a list of more to add so make sure you keep an eye out for further posts on this.

Getting Started

The Module comes with a getting started guide which can be found here, this is well worth a read and is full of examples.  At the time of writing this these are the only examples available as the cmdlets do not yet have help so the normal Get-Help cmdletname –Examples will not work.

How do you navigate 1498 cmdlets ?

One of the first things I wondered when I saw they had so many cmdlets was how do you find the one you need, obviously PowerShell has built in methods for this like using Get-Command with wildcards etc but with 1498 cmdlets this would only get you so far.

I was then shown Get-UCSCmdletMeta, this cmdlet is a fantastic way of finding not only cmdlets but also what cmdlets are used in conjunction with that cmdlet and also other cmdlets which you are likely to need, lets start with an example, say I wanted to get the VLANs I had setup in Cisco UCS, I would use the cmdlet as follows:

SNAGHTML13588856

As you can see it shows the verbs we can use with this and also the Noun so we know instantly what cmdlets are available for use with VLAN’s, it doesn’t end their either, it also gives us a PipelineClassId, these are basically the type of classes which can be piped into this cmdlet, that’s pretty cool.. but wait…

The even cooler thing about this is we can also see the cmdlets which this cmdlet can pipe into, to do this we can add a –tree parameter like so:

SNAGHTML135d6b55

Its great to see people putting thought into how to make things easier for users to use their cmdlets, this is a great way of showing the cmdlets and helping find your way around.