Chapter 1: An introduction to Lability
- Chapter 1: An introduction to Lability
Lability is, according to its repository, a “test lab deployment and configuration module”. It works with Powershell DSC and Hyper-V (and as such requires a Windows lab machine). With Lability, you can define labs using standard Powershell DSC configuration data and scripts, and Lability will handle downloading trial ISOs for Windows, building virtual machines, copying DSC configuration modules to the VM disk, and running the DSC scripts when the VMs boot.
This is very powerful.
It allows for very rapid lab creation for studying for certifications or evaluating functionality. It’s a great tool to have when trying to study for exams like the MCSE. It’s also very valuable if you wish to evaluate software that you aren’t familiar with; for instance, at the time of this writing, I am using it to prototype a network of SQL Server AlwaysOn Availability Groups for a client at work.
It allows labs to be saved and easily shared. You can commit your lab to a git repository and delete the VMs, and have high confidence that you can recreate that lab later if necessary. You can also easily share labs with coworkers.
You can install Lability from PowerShellGet.
If you have never installed modules from the PSGallery before, you will first have to configure PowerShellGet to trust PSGallery. (This only needs to be done once per host; if you’ve done it before, it’s not necessary to repeat.)
Once that has been done, you can install Lability:
After installing Lability, you must tell it to configure itself.
You can customize its configuration with
but for most typical users this will not be necessary.
For it to configure itself (whether you customized the configuration or not), you must run:
Unfortunately, the Lability readme is a bit terse. However, the module does ship with useful documentation accessible via Powershell.
First, import the Lability module so we can use it
See the list of available commands like this:
As with all Powershell commands, get the full help for a given command with a command like this:
Lability also ships with some built-in help files for concepts that aren’t captured in the command help. You can see a list of the files in the dev version on GitHub. At the time of this writing, they are:
about_Bootstrap about_ConfigurationData about_CustomResources about_Lability about_Media about_Networking
Finally, you can also browse the Lability examples on GitHub. These examples, along with this tutorial, can serve as a useful starting point for new test labs.
Explore the help topics for Lability commands run in this chapter, and at least the
Read more about the commands for configuring the lab host, and understand when you might want to change them
Configure the lab host as discussed above