vSphereDSC – Principles of Operation

The “Principles of Operation” in the title is in fact just an expensive expression for “How do I use this stuff ?”. In this post I will try to show you how you can use the vSphereDSC module, as a user, and as a contributing developer. On the side, it also shows you how you can use these vSphereDSC resources.

The vSphereDSC module contains a set of DSC resources to can be used to configure a vSphere environment. These DSC resources can be used against any vSphere Server, beit a vCenter or an ESXi node. On the condition of course that the selected resource is supported on the vSphere Server.

principles

For “users” of the vSphereDSC resources, the post will show how to automate keeping the module up to date and how to manage the life cycle of the Configuration files that are build on the vSphereDSC resources.

For those of you that want to contribute to the development of the vSphereDSC module and it’s resources, this post will also show how you can automate the testing phase. In a first instance through a number of PowerShell scripts, in a later phase through the use of a build server.

Continue reading vSphereDSC – Principles of Operation

vSphereDSC – VmwFolder

In this post I’ll introduce the first DSC resource from the vSphereDSC module, the VmwFolder resource. Since this is the first post in the series, I will also expand a bit on how the vSphereDSC module is set up and which conventions I’m using.

VmwFolder

A vSphere Folder is a resource which can exist rather independently in an existing vSphere environment. You can easily create some test Folders to get the hang and feel of the vSphereDSC module and play with DSC Configurations based on this vSphereDSC resource.

Continue reading vSphereDSC – VmwFolder

vSphereDSC – Intro

My attempts to marry DSC and vSphere have been going on for nearly a year* now. I showed some of my attempts and intermediate results at VMworld 2015, in two sessions at the PowerShell + DevOps Global Summit and recently during a session at the 24th VMUGBE+. But now I’m finally going public with the vSphereDSC module.

Since WMF 5 has been made available in preview, and still is in RTM at the moment I’m writing this, there have been constant changes to the way I was writing the DSC resources for vSphere. Since the February 2016 WMF 5 release, I now have a (somewhat) stable, working class-based solution. At least, that is what my initial tests seem to indicate.

vSphereDSC-Logo

This intro for my vSphereDSC series, will lay out the playing field. I’ll explain the concept I’m using, show some of the issues I encountered and explain the layout of the vSphereDSC Resource module.

 

* “Wisely and slow; they stumble that run fast”, Romeo and Juliet, Act II, Scene III

Continue reading vSphereDSC – Intro

vSphere Object by Path

In an older post, named Folder by Path, I provided a function to retrieve a Folder object by it’s path.

With the recent publication of my Get-InventoryPlus function, I can now get the path to all vSphere objects. So the obvious next step was to create a function, that would be able to use that information and retrieve any vSphere object by it’s path.

IMG_20160602_084338

The function was first demonstrated during the 24th VMUGBe in Mechelen.

Continue reading vSphere Object by Path

Get-InventoryPlus – Inventory of all vSphere objects

Often I have to get a complete list of all the objects in a vSphere environment. From the PowerCLI cmdlets, the Get-Inventory cmdlets looks like the obvious candidate to tackle such a request. But the cmdlet seems to have some shortcomings. It definitely does not return all vSphere objects.

Hence I set out to write this Get-InventoryPlus function.

The function was demonstrated for the first time during the 24th VMUGBe in Mechelen.

Continue reading Get-InventoryPlus – Inventory of all vSphere objects

Universal PowerCLI Loader

PowerCLI is great tool, and the Team behind it surprises us on a regular basis with a new Release. With the v6.x generation we witnessed the introduction of Modules. And the Team keeps adding further integration with other VMware products.

With the PowerCLI installation comes a shortcut to a PowerShell sessions, loaded with all the PowerCLI goodness. And this is ideal to make your first steps in the wonderful world of PowerShell and PowerCLI.

But soon you’ll start using more advanced features of PowerShell. You’ll be scheduling jobs, running parallel workflows, start using PowerCLI in Desired State Configuration (DSC). At that moment, the simple PowerCLI session doesn’t cut it anymore, and even the Init scripts that are installed together with PowerCLI, will not give you the exact environment as you want it. Hence my Universal PowerCLI Loader!

universal

I have been using a “Universal PowerCLI loader” function since quite some time now. I thought it was time to prettify it a bit, and share it with the community.

Continue reading Universal PowerCLI Loader

Visual Studio Code and PowerCLI

In a blog post on November 16th 2015 Microsoft announced PowerShell support in Visual Studio Code. And as it befits the “new” Microsoft, this PowerShell extension for Visual Studio Code (VSC) was placed on GitHub.

VSC offers features that are currently not present in the PowerShell ISE, one of the more important ones for now being Git support. And another, not negligible feature, VSC is a free product. On the VMware{code} powercli Slack channel, which you should check out, the new editor was discussed briefly.

PCLI-and-VSC

With the 0.6.0 release of PowerShell for VS@Code, a couple of important new features were introduced. For the PowerCLI users, the addition of a VSC specific ‘profile‘, makes editing your PowerCLI scripts in VSC a lot easier. Want to try it out, read on!

vsc-060

Continue reading Visual Studio Code and PowerCLI

A closer look at Get-EsxCli V2

In IT we don’t like breaking changes in our software. But sometimes you do need to break an egg to make an omelet. Standing still is ultimately moving backwards.

esxcli-v2In the most recent PowerCLI Release (v6.3 R1) such a change was introduced for the Get-EsxCli cmdlet. With the ingenious introduction of the V2 switch this is not yet a breaking change, but you should be aware that the “old” way of using Get-EsxCli will ultimately go away.

In the VMware vSphere PowerCLI Reference: Automating vSphere Administration, 2nd Edition, we included a script (Chapter 15, Listing 15-2), that allowed you to create a handy Reference Chart of the available methods under the Get-EsxCli cmdlet. This post provides an update to that script for V2.
Continue reading A closer look at Get-EsxCli V2

Ravello PowerShell Module – Examples

This post introduces the first set of example PowerShell scripts that use the Ravello PowerShell module to automate your Ravello Systems environment.

rav-title-examples

The examples serve primarily to demonstrate the use of the Ravello module cmdlets. But also how easy it is to automate your Ravello environment with the help of the Ravello PowerShell module. Note that the examples directory is introduced in v1.1.2.4 of the Ravello PowerShell module.
Continue reading Ravello PowerShell Module – Examples

Fixing a (minor) PowerCLI 6 R1 issue

With PowerCLI 6 R1 a major change was introduced, PowerCLI now has modules !

Such a major change is bound to introduce some minor nuisances, as some PowerCLI users have already discovered. This post will try to tackle some of these nuisances.

pcli-v6-bandaidThe first issue is with the PSConsoleFile, called vim.psc1, which was often used in batch invocations of PowerCLI scripts. Unfortunately this is a breaking change, but it can easily be fixed as this post will show.

The second annoyance has to do with the PowerShell environment variable called $env:PSModulePath. The installation package for PowerCLI 6 R1, sets the module path in the user environment variable, which might cause an issue. Read on.

Continue reading Fixing a (minor) PowerCLI 6 R1 issue