PowerShell Remoting lets you manage your Hyper-V environment using a great command-line interface that provides you better options than a GUI ever can. Here’s how.
I’ve been prepping for a lot of different speaking engagements coming up in the next few months and a very hot topic these days is the use of PowerShell and automation, when it comes to Hyper-V. With this in mind, I’ve prepped the below script for some of these upcoming discussions, and wanted to share it with the community so that it’ll be of help to some people.
Update WSUS Installation Media and Hyper-V Templates using this FREE PowerShell Script. The script will automatically update both VHDX and WIM files.
File screening helps mitigate damage from a ransomware attack, allowing file server configuration for real-time auditing on files that become modified.
Modify the BIOS GUID of a Hyper-V virtual machine easily with this automated PowerShell script, which particularly modifies the system’s UUID (universally unique identifier).
Today we would like to welcome Mathieu Isbel, a Microsoft MVP who will be participating regularly in the blog. He starts by presenting a method for copying your production data in your development environment in a quick and space efficient manner using Hyper-V parent and differencing disks. Check it out in today’s post.
We’ve had quite a few posts about Hyper-V checkpoints lately (formerly snapshots). We also spend a fair bit of time warning people not to tinker with them manually. There are still those people that are going to tinker despite any warnings, and there will always be those people who don’t even find the warnings until they’re too late to be of any value. The least I can do is provide a tool that can be of use to anyone that’s stuck working on a complicated tree of differencing disks.
One of the things I commonly lament over is the poor state of the management tools available for Hyper-V (from Microsoft; I’m pointedly not talking about third party solutions). One issue I see a lot of is that there isn’t a quick way, when looking at the Hyper-V-specific tools, to know how much free memory a host has. People then have to resort to other tools like Task Manager to determine this. These methods are usually effective, but imperfect. Sometimes, you are unable to match up what those tools display against what happens in Hyper-V.
When administering a Hyper-V cluster with shared storage, it’s important to be aware of the resources provisioned to each VM and the resources available on all the hosts. For example, in a two node cluster, in order for it to be N+1 (the ability for the cluster to be able to withstand a failure of one physical host) each host would need to be able to handle running the normal VM workload all by itself. Most of the time, unless you have a very compute-intensive environment, memory is usually going to be the bottleneck for maintaining an N + 1 cluster. So in this post, we will focus calculating capacity for N + 1 by measuring memory utilization. Thankfully we can easily determine this by using PowerShell.
The Get-VHD cmdlet grabs all VHD information associated with the specified VHD. It can be very useful if you want to either quickly gather information about all the VHDs on a host or just a single VHD. The information generated from Get-VHD can also be used in an automated weekly script to display information of selected VHDs.
Configuring auto start on VMs is very important, especially for smaller companies that don’t have the budget for a power-outage-proof solution. I’ve seen it a few times when a power outage occurred over the weekend and the IT admin was scrambling to get all the VMs powered back on. Configuring auto start on each VM can easily be overlooked, but with a little PowerShell know how, managing and configuring this setting is a breeze.
Checkpoints, or snapshots in previous versions of Hyper-V, can be a lifesaver when used properly in certain situations. For example, if applying a patch to the company payroll software goes south, being able to quickly roll a server back to its previous state is a huge benefit. However, checkpoints are also one of the Hyper-V features that admins have to be careful with. Improper use can cause more harm than good, which is why it is a valuable skill to be able to easily check for any and all existing checkpoints.