Tag Archives: PowerCLI

Customisation: Lesson 3 – Networking

Lessons so far in this blog post series:

Lets get down and dirty, by now you should not only starting to become familiar with the way things are working but also probably trying new things out, Great !

Now, as there are multiple ways of configuring your vSwitches/Portgroups and Nics I will explain a few ways that should show you the basics, everything else you should be able to work out from there.  As always any questions or comments are welcome !

So, the first thing we need to do is think about how we would configure this without scripts, often when I am writing a script I will write down the procedure a step at a time following it through in the GUI, I will then convert this into a script.

 

Continue reading Customisation: Lesson 3 – Networking

Managing VMware Infrastructure with Windows PowerShell

Following my previous post where I gave you a quick review of Hal Rottenberg’s ‘ Managing VMware Infrastructure with Windows PowerShell’ book it is my pleasure to tell you that not only can you now buy the book but you can also see some sample chapters and sample code on the Sapien Press website so head over to the site and sample before you buy.

 

Believe me it really is a good book, also quite funny in places.

Customisation: Lesson 2 – Service and Firewall Configuration

Following on from my last post in this series which showed us how to configure the ntp time source (Customisation: Lesson 1 – Time Source) lets get straight into it and start configuring more advanced areas.

In this post I will show you how to open some of the firewall ports on your host which are needed for various applications and services to talk to our ESX Host.

In the last post we setup the NTP server, I figure it would be a good start to make sure that now we have added the time server to our host we should start the NTP Service or as the Linux type people will know it, the NTP Daemon or NTPD.

So, if we use the Get-VmHostService cmdlet which is part of the VI Toolkit we can easily start our required service.  This cmdlet will give us a list of the services on our host and there current state:

Continue reading Customisation: Lesson 2 – Service and Firewall Configuration

Customisation: Lesson 1 – Time Source

I thought I would help people learn the VI Toolkit whilst also creating a nice script which you can customise to your own environment, hopefully this is a script that will save you time in the future.

The script we are going to build together in step by step instructions is a Customisation script.

You have built your host and now have to go through the configuration and tweaks of all the after-build areas, you have to make sure that these are setup the same on each host so that things like VMotion and DRS work so what better than a script to help us limit the amount of mistakes when typing names or missing steps.

Continue reading Customisation: Lesson 1 – Time Source

VI Toolkit Presentation

imageThis week I gave a presentation to the UK PowerShell User Group at the Microsoft HQ in the UK, this was also available over live meeting and seemed to go quite well, despite the issues with the projectors, wifi, sound and rooms we were in.

For those people who couldn’t make the live meeting or the UK PowerShell User Group I have uploaded my slide deck for you to have a look through.

Download the slides here in PDF format… http://virtu-al.net/Downloads/VMwareVIToolkitPSUKUG27-03-09.pdf

My Presentation followed a nice insight into the 2008 Active Directory cmdlets that are being released by Microsoft, Jonathan Medd gave a great comparison of this and the Quest tools and also showed us a nice demo of the new Recycle bin feature in 2008 Active Directory.

 

These were both recorded and presented over Live Meeting, I will include a link so that you can watch them as soon as it is available.

VI Toolkit One-Liner: VM Guest Disk Sizes

A Simple One-liner today but it shows you how to add information along the pipe line to enable new properties which can be formed using other cmdlets or simple math statements on existing properties:

This one-liner will give you the VM disk or partition sizes for each of your VMs:

ForEach ($VM in Get-VM ){($VM.Extensiondata.Guest.Disk | Select @{N="Name";E={$VM.Name}},DiskPath, @{N="Capacity(MB)";E={[math]::Round($_.Capacity/ 1MB)}}, @{N="Free Space(MB)";E={[math]::Round($_.FreeSpace / 1MB)}}, @{N="Free Space %";E={[math]::Round(((100* ($_.FreeSpace))/ ($_.Capacity)),0)}})}

Continue reading VI Toolkit One-Liner: VM Guest Disk Sizes

VI Toolkit One Liner: Correct HAL ?

I have just re-worked an old script which I created to check each VM to ensure they are using the correct HAL based on the amount of processors they have installed, as it turns out I managed to get this into a nice one-liner:

Or to break it down so it fits on my blog…

Output:

hal

VI Toolkit One Liner: Who’s busy ?

Most of my work with the VI Toolkit has been scripts so far, well the work that I  have added to this blog anyway, I use one-liner’s on a daily basis to make my job easier.

It was suggested to me that I should add some one-liners to my blog as I’m going to be busy over the next couple of weeks so I had a quick tinker.

This one-liner is quite a simple but long one-liner just to get started:

View the top 10 VM’s which have been using memory for the last 48 Hours:

Continue reading VI Toolkit One Liner: Who’s busy ?

PowerGUI VMware PowerPack 2.1.5 released

image

Scott and Kirk have done it again, they are really kicking out the updates to this powerpack recently and this one adds some great features:

1. As you can see by the image, they have greatly improved the icons making a great visual experience.

2. You may notice a new Action on the menu… Generate vDiagram

image 

Yes that’s right, Kirk has taken my Visio script, torn it up, threw it out and come up with something completely amazing.

Continue reading PowerGUI VMware PowerPack 2.1.5 released

VI Toolkit Lab @ VMWorld

Whilst at VMWorld I managed to sit in on the very popular VI toolkit Lab, this was one of around 10 labs which were running during the day and people could go up and run through some testing on a pre-built lab environment all for themselves.

This gives people a great opportunity to play and mess with things that they may not get a chance to do in there normal line of work.

Continue reading VI Toolkit Lab @ VMWorld