Category Archives: PowerShell

EMC PowerShell Cmdlets – Where to start

I managed to finally find time recently to install the EMC PowerShell Cmdlets and have a play, this was mainly evenings and lunchtimes but when else do we get spare time in our working days !

I thought it would be useful to share my experience and show what EMC are doing in the world of PowerShell.

Why you need PowerShell for Storage

As I have mentioned before I use PowerShell as kind of a glue to grab pieces of information from various sources and tie them in together until I have the results I need and then output them into a nice report, so wouldn’t it be great if we could use these Cmdlets to integrate our EMC storage and VMware vCenter environment (Much like the VSI for vCenter) to grab the information from both sources and give us a nice output with information from both sources expanding the datastore to give us LUN information so we know how it looks underneath (further post coming with the script).

Another way to use PowerShell may be to create multiple LUNs, what if I want to add 50 LUNs to my EMC Storage and then assign them to the hosts within my vCenter, then going back to vCenter and telling it about the LUNs and formatting these ready for use, well you get the point.

Continue reading →

Backing up the ESXi System Image

ESXi is based on a system image, VMware used to call this a firmware but some people found this misleading, most people still refer to it as firmware but in this post I will refer to it as a system image.

The system image is a unified image which is the same whether booting from USB, Hard Disk, PXE or any other media. The logic in the first boot will provide auto configuration based on the kind of installation you have.

One thing to remember about ESXi is that it is memory based, so once booted the system image is entirely loaded into memory, ESXi doesn’t care if the original media disappears after boot, there is no reliance on the boot device for running after booting.

ESXi is essentially made up from a number of tardisks (VM TAR files) or archives, these tardisks are mounted into the empty root filesystem in order of enumeration, one of these is called the state tardisk or state.tgz.

The state tardisk is made up of any file in /etc which is marked as sticky, VMware uses the sticky bit to flag the files which are to be included as part of this tardisk but only if they reside under /etc, these are files like esx.conf, inetd.con, passwd….  These are the files which will be persisted after boot.

Continue reading →

PowerCLI 4.1.1 Poster

Recently VMware updated PowerCLI to version 4.1.1, this includes some cool updates including several new cmdlets and a few fixes behind the scenes to make things run faster and fix type names.

With the new version now comes a new poster, many of you will have already seen the PowerCLI Poster, I know thousands have already been given out at VMworld USA, VMworld Europe and also a limited edition version at the Dutch VMUG.  VMware have done a great job updating this and also asking some of the top users of PowerCLI what should also be included or changed.

If you were unlucky enough not to have one of these above your desk on the wall at the moment then it will only be a matter of time, VMware will soon be hopefully giving you the chance to get one of these posters by ordering them online, I am not sure of the details as yet or how much these will cost (if anything) but will keep you updated as I know more.

For now if you want to check out the latest and greatest poster then please click the image below to download the PDF version or click here to find out the history of this poster and how it has become the masterpiece that it is. Continue reading →

Automated support bundles

I received an email recently from a gentleman asking if it was possible to export the support bundles for each host on a daily basis, this can be useful for not only having an archive of your system logs to help resolve problems and work out when they started but also useful for auditing purposes.

At the moment he was doing this manually every day by using the virtual infrastructure client as can be seen below – you can imagine how long this was taking !

Exporting the logs from the vCenter Client

image

1.  Select the File menu and then Export, Export System Logs…

SNAGHTML3030b74

2.  Select the hosts which you want to download the system logs for and click OK

Continue reading →

Say goodbye to VESI

Goodbye old friendOne of the most frequent questions I get asked at user groups or by people who know I am responsible for the community PowerPack is which product should they use, normally the question is PowerGUI or VESI ?

My standard answer was to always ask them if they preferred trains or turtles but the answer is very easy now.

VESI is the product known as any of the following:

  • VESI
  • Virtualisation EcoShell
  • The Virtualisation EcoShell
  • vEcoShell
  • The Green one
  • The one with the turtle

From now this product is no more, you can still download it at the moment but no further development time will be spent by Vizioncore or Quest on this product, but wait, do not despair, there is good news.

Continue reading →

Out-WordCloud–PowerShell Fun

Whilst producing the presentation for VMworld I created a hypnotic slide which showed every cmdlet in PowerCLI 4.1 in a word cloud type picture, this picture was then rotated and zoomed until the audience believed we had given them a fantastic session – well kind of anyway !

The word cloud i created for that slide was actually created using wordle.net, a website which you can use to create word clouds, each word must be entered on the first page of the site, if a word is entered more than once it will make it bigger than the rest, the more times the bigger the word will be.  Now I could have typed each and every cmdlet into the site and then got it to generate the image for me but where is the fun in that ?

So I created a simple function which you can pass multiple words and it will do it for us, please see below for the code and a short video of me creating a word cloud of all the PowerCLI 4.1 U1 cmdlets:

Just a bit of fun really but someone may find it useful !

Function Out-WordCloud ($Words) {
	$ie = New-Object -com InternetExplorer.Application
	$ie.visible=$true
	$ie.navigate('http://www.wordle.net/create')
	while($ie.ReadyState -ne 4) {start-sleep -m 100}
	$ie.document.getElementById("paste").value=$Words
	$go = $ie.Document.body.getElementsByTagName('BUTTON') | Where {$_.innertext -eq 'GO'}
	$go.click()
}

$Words = Get-Command -Module Vmware.VimAutomation.core | `
 Select -ExpandProperty Name | Out-String

Out-WordCloud $Words

Continue reading →

VMware Session 3: PowerCLI & Onyx

Following on in the series of presentations (listed below) given by VMware on the 8th October in London please find below the PowerCLI & Onyx slide deck and MP3 file.

Other presentations given:

VMware Session 1: Exploring VMware APIs

VMware Session 2: vSphere APIs for Performance Monitoring

This presentation focused on PowerCLI and Onyx, they skipped some of the easy stuff that normally goes at the start of a PowerCLI deck mainly because the London crowd is used to me force feeding them PowerCLI on a regular basis !

Its a great deck and a good listen on the MP3, some interesting questions and comments made throughout the deck.

This presentation was given by Vladimir Goranov and Yavor Boychev who are both part of the PowerCLI team. (See if you can spot the mistake on slide 7 Winking smile)

The MP3 file can be downloaded from here and the presentation is embedded below: Continue reading →

VMware Session 2: vSphere APIs for Performance Monitoring

Following my first post located here called ‘Exploring VMware APIs’ which was held on October 8th in London, I have now uploaded the second slide deck and MP3 file.

This time the presentation was on “vSphere APIs for Performance Monitoring”, there were some great tips in here on how to optimise your code and the presenter was fantastic, the kind of guy you could watch present about anything – very theatrical !

This presentation was given by Balaju Parimi and Ravi Soundararajan – make sure you listen to the MP3 which can be downloaded here.

Continue reading →

VMware Session 1: Exploring VMware APIs

On October 8th in London VMware arranged for some of the top GURUs to come to London and give some exclusive presentations on VMware API’s, performance, PowerCLI and Onyx.

It was a great day with around 60-70 attendees, luckily for those of you who didn’t attend we managed to record the session in MP3 format and also get hold of the presentations.

This is session 1 of the day and is entitled “Exploring VMware APIs” by Preetham Gopalaswamy, please make sure you download it and have a listen, there is some really great stuff in here.

Firstly, the below is a video shot on the day which explains more about what we were trying to achieve: Continue reading →

VMware View 4.5 – More PowerShell Cmdlets

Its probably not news to you that VMware have now released View 4.5, just one of the many cool announcements made at VMworld 2010 – San Francisco.

Did you know however that View now has some PowerShell cmdlets ? – Yeah that’s right.

The Good

I think its great that VMware are putting so much time and effort into PowerShell and giving windows admins a great tool to manage their VMware infrastructure with, one thing I always tell anyone who will listen is that PowerShell is “the glue” that sits in between your applications to enable a common programmatic interface allowing you to glue all these applications together to give you the end results you need, whether it be deploying a VM and then installing Windows and then installing Exchange and then following on to add the mailboxes and patch the server and even send you an email at the end to say its done or simply just adding an “A host” record to a DNS server for a VMHost after installing ESX and patching the host using the Update manager cmdlets.

The possibilities are endless, well as endless as your imagination !

So yes, the point here is that its a great thing that VMware continue to add PowerShell enablement to their apps giving us the freedom to automate them.

With View 4.5 we are given 45 cmdlets to manage our View environment, these are listed below: Continue reading →