Tag Archives: VMWorld

VMworld 2015–San Francisco–PowerCLI Session

Firstly, I want to say I had a blast at VMworld SFO this year, it was a fantastic show and it really felt like everyone was buzzing with excitement and interest in VMware, the announcements, the partners and just about everything else that was going on.  I think this may be one of my favorite years to date.


On top of the general excitement there was of course the awesome group discussions, meet the experts, sessions and customer meetings which I took part in, I was lucky enough to present on some awesome topics this year, the normal PowerCLI deep dive I give with Luc (see below) and also a fantastic new technology called Instant Clone (AKA VMfork). The instant clone presentation is not yet available but for those who are into PowerCLI I wanted to let you know that Luc and my session was made available for everyone to view via PowerCLI, including the information we gave on best practices and also a technical preview of PowerCLI.


If you are going to VMworld Barcelona do not worry, we are already adjusting our session to be even better with more best practices and even more information on the awesomeness of PowerCLI.  Well worth attending and watching this as well.


Automating Tags and Tag Category creation and assignment with PowerCLI

Fimageor a couple of releases now PowerCLI has been able to work with vSphere Tags, A tag is a label that you can apply to objects in the vSphere inventory.

After creating a tag, you can assign that tag to a category. Categories allow you to group related tags together. When you define a category, you can also specify the type of objects to which its tags can be applied to and whether more than one tag in the category can be applied to an object.

For example, if you want to tag your virtual machines by the owner, you can create a category called “Owner” and specify that it applies to virtual machines only and that only a single tag can be applied to a virtual machine at any time. The tags in this category could be Alan, John or Fred etc.

I have had a few people ask me how they can use PowerCLI to work with external systems, CMDBs, databases or even just a CSV file.

One example of this is where a company could have various information about hosts or datastores or virtual machines, like the project that purchased these, a cost code or an owner.  This data is generally stored somewhere else but it would be great to see this information straight in the vSphere Web Client where you manage the objects so that you can instantly contact the owner or work out which project the object is being used for etc.

The below video shows how we can use PowerCLI and this generic script I created to import the data, create the tags and tag categories and assign them to the machines, it uses a csv as input but this could obviously be changed to anything which can be read in PowerShell, like a API, database, application etc etc.

Automating tags and tag categories video

Example Script

This script is the script I created as an example which relates each of the items in the Name column to an object in the inventory then for each of the other column headers it will create a category and then the tags that are under the categories, once this has been done it will apply the tags to the objects in the Name column.

Connect-viserver myvc.corp.local -user administrator@vsphere.local -pass Pa$$w0rd
$CMDBInfo = Import-CSV C:\Software\cmdbinfo.csv

# Get the header names to use as tag category names
$TagCatNames = $cmdbinfo | Get-Member | Where {$_.MemberType -eq "NoteProperty"} | Select -Expand Name

# Create the Tag Category if it doesnt exist
Foreach ($Name in ($TagCatNames | Where {$_ -ne "Name"})) {
    if (-Not (Get-TagCategory $Name -ea SilentlyContinue)) {
        Write-Host "Creating Tag Category $Name"
        New-TagCategory -Name $Name -Description "$Name from CMDB" | Out-Null
        # Create Tags under the Tag Categories
        $UniqueTags = $cmdbinfo | Select -expand $name | Get-Unique
        Foreach ($Tag in $UniqueTags) {
            if (-Not (Get-Tag $Tag -ea SilentlyContinue)) {
                Write-Host "..Creating Tag under $Name of $Tag"
                New-Tag -Name $Tag -Category $name -Description "$Tag from CMDB" | Out-Null
            # Assign the Tags to the VMs/Hosts
            $cmdbinfo | Where {$_.($Name) -eq $Tag} | Foreach {
                Write-Host ".... Assigning $Tag in Category of $Name to $($_.Name)"
                $TagAssignment = Get-Tag -Category $Name -name $Tag
                New-TagAssignment -entity $($_.Name) -Tag $Tagassignment | Out-Null

VMworld 2014 Orchestration, Automation & Optimization Panel

One of the highlights for VMworld 2014 in San Francisco this year for me was on the first day, I was asked by the vBrownbag team to sit on the “Opening Acts 2014 Orchestration, Automation, & Optimization Panel”, we had some great conversations and a few laughs along the way as well.  I have posted the video here for you to watch, also make sure you check out the complete list of Opening Act Panels from the vBrownbag Opening Acts feed here.


Automation Tip 7–Testing


One of the great things about automation is the ability to achieve consistent results, same thing every time, but go careful. What happens for example if your automation task is incorrect, if it doesn’t achieve what you want it to do.

Guess what?

You will get the undesired result every time.  Or as I like to say, you will retrieve mass produced crap!

This is exactly why testing in automation is key, both functional and scale testing, what happens when you start working at a larger scale, do things still react in the same way, do you still get the desired results?

Sometimes testing will show areas where throttling mechanisms may need to be used, take for example the ability to create a virtual machine, when we automate this we may produce 10 virtual machines in the same timescale, maybe 100, 1000 or even more.  Does your hardware allow you to do this? How does the storage or the network or the IP management system manage working at this rate? Throttling may cause a slight delay in the process but it will certainly ensure everything is available for future workflows.

In summary, testing will help you be aware of your bottlenecks and stop mass produced crap!

More Automation tips

More tips from this series created by myself and Thomas Corfmat for a session at VMworld 2013 can be found below (updated as published), if you have a login for VMworld.com you can also watch the full session here.

Automation Tip 1 – Measure It!

Automation Tip 2 – Find your standards

Automation Tip 3 – Its all about people

Automation Tip 4 – Select the right mix of people

Automation Tip 5 – Simplify, Don’t automate a broken process

Automation Tip 6 – Automate incrementally

Automation Tip 7 – Testing

Automation Tip 8 – Documentation

Automation Tip 9 – End to end automation

Automation Tip 10 – Follow the “Automation Triangle”

Automation–its not just a tick box!

During VMworld 2013 I presented together with Thomas Corfmat a session entitled “Automating the Software Defined Datacenter, How do I get started?” this was meant as a introduction on how someone who was interested in automation could start with VMware products and what they could achieve.

One of the first things we mentioned in this session is that there is no one size fits all, there isn’t one tick box that you can click and then suddenly “enable automation”, this is a common misconception by the C-Level staff of many organizations as they see automation in a slide deck and want some of it!  Automation is actually a combination of products, workflows and scripts created to give you the specific results you need.

Continue reading Automation–its not just a tick box!

VMworld PowerCLI Group Discussion–Part 3–Launching and Using


Following on from the previous posts in this series, this post will take us through the group discussion held at VMworld this year and expand on the items noted during the session.

This post will focus on what people in the session used PowerCLI for and also the various ways people used to launch the scripts.

Continue reading VMworld PowerCLI Group Discussion–Part 3–Launching and Using

VMworld PowerCLI Group Discussion–Part 2–Resources

ResourcesFollowing Part 1 of these posts where we discussed getting started in PowerCLI I now give you Part 2 of the note taking by Nigel Boulton at VMworld in the PowerCLI Group Discussion.

In this part of the session we discussed what resources were available to people using PowerCLI.

As with the previous post I will expand on the notes taken and give you the complete list below.

If you have more resources make sure you add a comment and share them with others.

Continue reading VMworld PowerCLI Group Discussion–Part 2–Resources

VMworld PowerCLI Group Discussion–Part 1–Getting Started

imageAlways my favorite session at VMworld, the group discussion gives others a chance to share their experience and give their view on a product.

I have hosted a PowerCLI Group Discussion for the past 2 years and have found them a great way to learn and share information.

This year with some great note taking by my beautiful assistant Nigel Boulton I thought it would be useful to type up these notes from the session and share them on my blog.

Continue reading VMworld PowerCLI Group Discussion–Part 1–Getting Started

VMworld 2013 Barcelona–Where I will be


After what I think has been my most enjoyable VMworld yet in San Francisco I am fully looking forward to VMworld 2013 Barcelona, I have lots of sessions to present and always enjoy the European VMworld as it seams to me to be slightly more technical, maybe people adjust their slides a little after the announcements from the US VMworld to include more working details or maybe the Europeans are just that little bit more technical, I will let you decide!

If you are attending and wondering where to find me then please do look out for me and say hi at the following places”:

My Sessions Continue reading VMworld 2013 Barcelona–Where I will be