Category Archives: VMware

PowerShell User Group–Campbell–CA–Nov 5th

Are you interested in PowerShell? Do you want free Pizza? If the answer to either of these questions is YES then join us!

Are you in the Campbell, California area on 5th Nov 2014?

I will be presenting about PowerCLI and covering the following areas:

  • Introduction to managing VMware products with PowerShell
  • Reporting
  • Deployment
  • Automation
  • Integration
  • Community
  • Where are VMware headed?
  • Question time!

If you are not interested in managing VMware products with PowerShell then attend anyway, we will no doubt reference lots of PowerShell general tips and tricks and definitely have some great conversations about PowerShell in general.

When and Where?

Wednesday, November 5, 2014

6:00 PM to 9:00 PM

 

Groupware Corporate Office

550 Division Street, Campbell, CA (map)

RSVP

Make sure you sign up here.

PowerCLI in the vSphere Web Client–Announcing PowerActions

You don’t know how excited I am to write this!  Around a year ago I presented something we were working on internal as a tech preview for my VMworld session, the response was phenomenal, if you were there you would remember people standing up and clapping and asking when this awesomeness would be available, its taken a while but its here and its worth the wait.  So what is this that I am so excited about?

 

PowerActions is a new fling from VMware which can be downloaded here, it adds the automation power of PowerCLI into the web client for you to use your scripts and automation power back inside the client, have you ever wanted to right click an object in the web client and run a custom automation action, maybe return the results and then work with them further all from the convenience of the web client…. Now you can!

This works in 2 ways….

Console

PowerShell console in the Web Client

Firstly you can access a PowerCLI console straight in the web interface, even in safari, this fling allows for a dedicated host to be used as a PowerShell host and this machine will be responsible for running the PowerCLI actions, once its setup you will access the console from within the web client and all commands will run remotely on the PowerShell host, it even uses your current logged on credentials to launch the scripts meaning you don’t have to connect the PowerCLI session.

 

You can use tab completion on your cmdlets and even use other PowerShell snapins and modules to control any PowerShell enabled infrastructure to extend your automation needs within the vSphere Web Client.

 

MenuRight Click your objects

Secondly you can now right click an object in the Web Client and create a dedicated script which will work against this object, have the ability to extend your web client and take the object as an input to use inside your script.

This comes with 2 options, Create a script and also execute a script.

 

My Scripts and Shared Scripts

Not only can you create your own scripts to run against objects in the web client but advanced admins can create scripts and share them with all users of the web client by storing them in the Shared Scripts section of this fling, read the documentation to find out more about how to do this.  This gives the great ability to have not only shared scripts but actually a golden set of scripts which all users of the web client can use while you keep your items in a separate area “My Scripts”, enabling each user to have their own custom actions.

 

Download and read more

Download the fling from the VMware Labs site here, also make sure you grab the document from the same site and also check out the great post on the PowerCLI Blog for more information here.

 

Check out the video for a quick introduction

To help with the details I shot a quick install and usage video that covers the basics, make sure you read the PDF that comes with the fling and make sure you are active, if you like this then let is know, if you want more then let us know…. basically give us feedback!

Deploying Log Insight with PowerCLI 5.8 R1 new features

PowerCLI 5.8 R1 was recently released and of the great new features included was the ability to now set the OVF/OVA properties of a VM or vAPP stored in an Open Virtualization format.

The new cmdlet allows us to query the file for the properties and interactively find out which entries we need to fill out, we can then fill these entries out and send them as part of the deployment of the VM when using the Import-vApp cmdlet which has been a part of PowerCLI for a while now.  For more information on how we do this check out the recent post on the PowerCLI blog here.

The bit I like about this cmdlet is that we can now dynamically work out which host, network and storage to put the VM on based on our own metrics, like say for instance I wanted to choose the host with the most amount of memory in a cluster or a datastore on that host that had the most room left:

$VMHost = Get-Cluster "Cluster Site A" | Get-VMHost | Sort MemoryGB | Select -first 1
$Datastore = $VMHost | Get-datastore | Sort FreeSpaceGB -Descending | Select -first 1

Another method to see the entries and what needs filling out as part of the OVF/OVA Deployment is to use the cmdlet to store the information inside a variable as shown in the video I created below, this can be used to browse through the properties and fill them out as needed or create a script for later deployment.  Another option for this is to load the settings into a variable and then use one of the advanced PowerShell editors like PowerGUI Script Editor to click through the variable in the variable pane and explore the options and their values as can be seen below:

image

The code

I want to automate the entire build out of my virtual infrastructure like this, I hear you say…. well why not help out, get involved, I started a new Github project where we can all contribute to make sure we are not reinventing the wheel, why not check out the github project here and add your own deployment scripts, so far there are scripts to deploy both Log Insight 2.0 (the one shown in the video) and also vShield Manager 5.5.x.

 

Video: Deploying Log Insight 2.0

VMware PowerCLI 5.8 R1 Released

imageToday VMware released PowerCLI 5.8 R1, in this release they add even more automation awesomeness to this already powerful tool.  It supports all the way back to vCenter and ESXi 4.1 so if your using this version or anything above this I think it’s well worth updating PowerCLI to make sure you take advantage of the new features, speed increases and bug fixes in this version.

The following list is an overview of the new features:

Faster startup – Enhancements have been made to improve the start-up speed of the first PowerCLI cmdlet in a session to ensure access to PowerCLI is now faster, this was something that I know was an issue in the past and Clint Kitson did an excellent post on things to check and making things faster, whilst the PowerCLI team handles manually compiling the .NET PowerCLI Serializers (notice the installer takes a couple of seconds longer) Clints post is still worth checking out as he lists some other things which can also help with the startup speed.

You can now manage storage policies with the Storage Policy-Based Management (SPBM) cmdlets. This functionality is included in a new snap-in for storage, which contains the following cmdlets:

  • Export-SpbmStoragePolicy
  • Get-SpbmCapability
  • Get-SpbmCompatibleStorage
  • Get-SpbmEntityConfiguration
  • Get-SpbmStoragePolicy
  • Import-SpbmStoragePolicy
  • New-SpbmRule
  • New-SpbmRuleSet
  • New-SpbmStoragePolicy
  • Remove-SpbmStoragePolicy
  • Set-SpbmEntityConfiguration
  • Set-SpbmStoragePolicy

This one is awesome and will ensure PowerCLI is an awesome tool for installing the vCloud Suite products, enhancements have been made to support deployment of OVF and OVA files with configuration parameters in the following areas:

  • Get-OVFConfiguration allows you to query an OVF or OVA for deployment properties
  • Import-vApp now has an OvfConfiguration parameter which allows for OVFProperties to be passed during deployment

Following the work in previous releases on automation of tags, you can now filter multiple objects by tag information. A tag parameter has been added to the following cmdlets:

  • Get-Cluster
  • Get-DatastoreCluster
  • Get-Folder
  • Get-ResourcePool
  • Get-DistributedSwitch
  • Get-Datacenter
  • Get-VApp

Enhancements have been made to error reporting by including more details in the error messages returned by the cmdlets, this includes more information from the APIs making sure users have the best information available when diagnosing why vCenter failed with a task.

You can now pass SpbmStoragePolicy objects to the RelatedObject parameter of the Get-HardDisk and Get-VM cmdlets.

You can now provide a filter when working with Datastore Providers.

You can now filter on DistributedSwitch and VMHost when using the Get-VMHostNetworkAdapter cmdlet with provided parameters.

You can now work with vCloud Director and vCloud Air with support for the latest version of the vCloud Director APIs, again a great enhancement and less pain when working with the latest vCD APIs as you no longer need to force the API version for it to work correctly.

vCloud Director cmdlets have been extended to include the New-CIVM and Get-CIVMTemplate cmdlets.

The New-CIVapp cmdlet has been extended with a new parameter set, which allows you to create an empty vApp.

You can now work with the enhanced vCenter Site Recovery Manager 5.8 public APIs,these have been extended by the SRM release and PowerCLI will enable automation of even more areas now!

Download

So why are you still reading this post?  Go download it now! or if you are a vCloud tenant you may want to just download the cmdlets that enable you to work with vCloud as a user from here.

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.

 

WebCommander goes Open Source

You may have heard me talk about Webcommander before at VMworld or during a vBrownbag, if you haven’t and you don’t know about this project then you have been missing out!

WebCommander was designed as a framework to wrap your PowerShell and/or PowerCLI scripts into an easy-to-access web service, give each script a nice easy web form and show the results, give a simple icon on a web page to your end users and allow them to use your scripts and all they need is a web browser!

Have you ever wanted to give your users access to certain virtual infrastructure tasks instead of the entire vCenter Client? Have you ever written tasks in PowerShell which you wished you could easily hand off to the users to run on an ad-hoc basis? Now you can hand off the tasks your users need by simply adding a new script and giving them access to WebCommander.

Previously WebCommander was initially released as a VMware fling and updates were performed by VMware, the community was keen to jump on this and the feedback came in thick and fast, I was amazed to see how some customers were using WebCommander and how they took it to the next level.  The main engineer on the project (Jerry Liu) implemented the feedback fast and released update after update to bring the additions to the latest version.

The final part of this story and the great part is that Jerry has now released WebCommander to the community as an open source project on Github, this is fantastic news as it means more people can now get involved, add new contributions and make changes which can be checked back into the core code for everyone to use.  PowerCLI and PowerShell users alike.

So why wait, head over to the site here, download and contribute to this awesome project!

 

WebCommander Eye candy

image

Working with vCD Edge Gateway Rules in PowerCLI

Recently I was working with someone helping them automate the final part of their script which was used to deploy new customers as they were on boarded in vCloud Director 5.5, as part of this on boarding they needed to work with the Edge Gateway to add new SNAT and DNAT rules which correspond with the customers IP range.

After some investigation and reading this page I was able to find the basics, after some further testing and internal help I found that there is no way to update a single record so I had to retrieve the existing XML ruleset, add the new entry and then upload it.  You can see from the scripts how I do this and if you are feeling adventurous or have the need you could even create some remove- functions!

If you take a look at my Edge Gateway below you can see two existing rules, lets see what the functions do that I created.

TinyGrab Screen Shot 24-07-2014 22.31.21

Using the PowerCLI functions you can easily list the edge gateway rules using the following:

TinyGrab Screen Shot 24-07-2014 22.55.19

Creating a new SNAT rule is just as easy with the New-SNATRule function as you can see below:

TinyGrab Screen Shot 24-07-2014 22.59.55

And also a DNAT Rule with the New-DNATRule function as below:

TinyGrab Screen Shot 24-07-2014 23.01.48

Hopefully you will find this useful, feedback is of course welcome below in the comments section.

The Functions

Installing the vCloud Hybrid Service Web Client Plugin

Recently Duncan Epping over at Yellow-Bricks wrote a great article showing how to get started with the vCHS Web Interface, building on top of his post, one of the things I like about the vCHS setup is the fact that you can view and manage your VMs in the same way you would manage your existing environment – through the web interface.  This post takes you through the install of the web interface and some initial looks at the web client once installed.

After initial install of your vSphere 5.5 environment and configuration of the vSphere Web Client you will find a plugin is available which will allow access to vCHS VMs from the Web Client, this is available for installation from the Web Client Home Page.

Requirements

To install the vCHS plugin you will need to access the vSphere Web-Client with a supported web browser, the latest version of Firefox or Chrome should work, at the time of writing this blog post the following versions were confirmed as working:

  • Chrome 35.0.1916.153 m
  • Firefox 30.0

Install Process

1. Log into the vSphere Web Client and click the Home button to arrive on the home page

1

2. Click the vCloud Hybrid Service Installer icon.

1

3. You will now arrive on the vCHS client plugin page.

2

4. Under the Basic Tasks section click Install the vCloud Hybrid Service plug-in

2

5. A dialog box will appear asking for your credentials to myvmware.com

Warning: You will need to ensure your MyVMware profile is complete by logging into the site and trying to download the plugin manually first, missing information in your profile can cause an issue with the download failing.

3

6. Once completed and installed you will be asked to logout and log back in for the plugin to be initialized.

4

7. Once you have logged out and back in you will now have access to the vCloud Hybrid Service plugin by clicking the below icon from the home page

5

vCHS Web Client plugin configuration

Once installed the following steps should be followed to configure the vCloud Hybrid Service plugin

1. Launch the vCloud Hybrid Service plugin from the home page in the vSphere web client

5

2. Select the Summary tab and then click Register vCloud Hybrid Service Account

6

3. Provide the URL for the vCHS Service and your credentials used to access your account and click the OK button

7

4. Once completed all registered vCloud Hybrid services will be displayed

8

5. You can now double click on a cloud instance to view the available resources

9

6. To manage Virtual machines select the Related Objects tab

10

 

Join me at the Calgary VMUG

CanadaVMUGThis week I will be lucky enough to present at the Calgary VMUG in Canada where they will be holding an automation focused event, this will be my first time to Canada and I have to say its been one of my lifetime goals ever since I saw the photographs from my fathers trip when he was stationed there in the Army.  I hope its as beautiful as it was in the pictures!

Its not too late to register, if you are interested in automation or just keen to learn what parts of your job you can script away to enable you to move on to the more interesting things and you are in the Calgary area, make sure you sign up today!

When and where?

Date and Time:

Thursday, March 20, 2014

11:00 a.m. – 2:00 p.m.

Location:

PennWest Plaza East

PennWest Conference Room Suite 200, 207

9th Avenue SW

Calgary, Alberta T2P 1K3

Register today!

You can find out more details and register today by visiting the Calgary VMUG site here: http://www.vmug.com/e/in/eid=1265

Hope to see you there!

PowerCLI 5.5 R2 Released

imageJust in case you don’t read the vSphere PowerCLI Official Blog I thought I would let you know that the latest version of PowerCLI greatness is out and its pretty awesome!

In this release there are a lot of new features, not to mention the first support for Site Recovery Manager, cmdlets for creating Tags and Tag Categories, Cmdlets for working with EVC and much much more, see the full list below for the details:

  • Manage vCenter Site Recovery Manager
  • Create and remove tags and tag categories
  • Retrieve information and configure Enhanced vMotion Compatibility (EVC) mode on clusters.
  • Manage security policies for vSphere standard switches and port groups.
  • Support for Windows PowerShell 4.0.
  • Support for vSphere servers configured with IPv6.
  • Specify the priority of a VM migration
  • Provide a Hard Disk object to the RelatedObject of Get-Datastore
  • Get-Datastore cmdlet to allow filtering by cluster.
  • Get-Stat and Get-StatType now works with all types
  • Added support for e1000e network adapter type.
  • Specify all values for DiskStorageFormat when cloning a virtual machine
  • 64-Bit Support for New-OSCustomizationSpec and Set-OSCustomizationSpec
  • ToolsVersion property to VMGuest that shows the version as a string.
  • Provide a virtual portgroup to the RelatedObject of the Get-VirtualSwitch and Get-DVSwitch
  • Retrieve virtual machines by virtual switches.
  • Other bug fixes and general performance enhancements have been made to various PowerCLI cmdlets.

Download it and read more

Download and Install PowerCLI 5.5 Release 2 today from here.

For a more comprehensive list including all parameter and functional improvements, security enhancements, and deprecated features, see the vSphere PowerCLI Release Notes and the vSphere PowerCLI Change Log.

For more information on specific product features, see the VMware vSphere PowerCLI 5.5 Release 2 User’s Guide.

For more information on specific cmdlets, see the VMware vSphere PowerCLI 5.5 Release 2 Cmdlet Reference.

Check out the details

On the day of the release I presented on the vBrownBag Community Podcast, this was great for showing people exactly how to use the SRM Cmdlets and how to understand the sample scripts we have, I went a little long in the presentation but grab a coffee (or 3) and check it out here: