Category: Hyper-V

PowerShell Function to Determine the Hyper-V Host for a VM

This week, I thought I would share a PowerShell function that I wrote to determine what Hyper-V host server a VM (virtual machine) resides on. In this scenario, you have no idea which Hyper-V host a VM resides on. First off, let me say that this function is written a bit unorthodox. Typically you'll see functions written where each item in the ComputerName array is iterated through one at a time. Since this function uses the PowerShell remoting Invoke-Command Read more [...]

Convert, Resize, and Optimize VHD and VHDX files with PowerShell

I recently received an email from someone who attended one of my presentations asking if I had a blog article on using PowerShell to compact and optimize VHD files. Since I didn't have a blog article on that subject, I decided to create one. The process itself is fairly simple. The examples shown in this blog article are being run on a Windows 10 computer which has Hyper-V enabled on it. Only specific SKU's of Windows 10 are capable of running Hyper-V. The same process can be used on servers running Read more [...]

Use caution when updating to Windows 10 RTM with data deduplication enabled volumes

I recently decided to reload my computer, moving from Windows 8.1 Enterprise Edition to Windows 10 Enterprise Edition. I had previously enabled the data deduplication feature on my Windows 8.1 installation with an unsupported hack by using the source files from Server 2012 R2. Deduplication was enabled on my SSD drive for the VHDX files that I use for my test and demonstration environment that runs via Hyper-V VM's. In my opinion, Microsoft should support data deduplication on enterprise edition Read more [...]

Creating Hyper-V VM’s with Desired State Configuration

I'm looking to automate the build of my test environment that runs as Hyper-V virtual machines on my Windows 8.1 Laptop computer. To get started, I thought I would take a look at the xHyper-V DSC resource to create the actual VM's. There's also no reason this shouldn't work on a Windows Server that's running the Hyper-V role. The Hyper-V role has already been added to my Windows 8.1 computer. I also have a previously created virtual hard drive (vhdx) file that has been loaded with the Windows Read more [...]

PowerShell One-Liner: Create a new Hyper-V VM

My test environment resides on a workstation that runs Windows 8.1 Enterprise Edition with the Hyper-V role enabled. I need to create a new VM that will be used as a second domain controller in my test environment. I'll use a PowerShell one-liner to create this new VM which will use a differencing disk based on a Windows Server 2012 R2 vhdx that has been fully patched and syspreped: µ Read more [...]

PowerShell Function to Prevent Starting Hyper-V VM’s that are Connected to an External Network

Beginning with Windows 8 (Professional and Enterprise Edition), Hyper-V is available on workstations that have a processor that supports SLAT (Second Level Address Translation). For specifics about the requirements, see the Client Hyper-V blog article on Microsoft TechNet. That means you have a Hypervisor running right on your desktop or laptop computer for free. With the price of hardware these days, your regular everyday computer can be spec'd out with an i7 processor, 16 gigabytes of memory, and Read more [...]

Use PowerShell to Determine the Chain of VHD’s for a Virtual Machine on Hyper-V

You want to determine what VHD's exist for the virtual machines (VM's) that are virtualized on your Windows 8 or Windows Server 2012 Hyper-V virtualization host. This may sound simple, but what if you have a base image or template that has been configured and then multiple VM's have been created using differencing disks that reference that single base image? If that weren't difficult enough to keep track of, you may also have snapshots of those VM's which are also classified as differencing disks Read more [...]

Use PowerShell to Check for Processor (CPU) Second Level Address Translation (SLAT) Support

The hardware requirements for using Hyper-V to run virtual machines on a Windows 8 client states that a 64-bit system that has a processor (CPU) that supports Second Level Address Translation (SLAT) is required. A minimum of 4GB of RAM is also required. How do I know if my Processor (CPU) supports Second Level Address Translation? You could do like most blogs on the Internet state and use Coreinfo: You have two additional choices if you already have Windows 8 or Windows Server 2012 Installed. #1 Read more [...]

Hyper-V Live Merge Snapshot Feature in Windows Server 2012

One of the best new features I've noticed while testing Hyper-V on the release candidate of Windows Server 2012 is the ability to merge snapshots while a virtual machine is running without the need for a restart as was required by Hyper-V in Windows Server 2008 R2. The Windows 7 VM shown below is currently running and it has one snapshot: When a snapshot is created a .avhdx file is created and any changes from that point forward are written to it instead of the .vhdx file: Here are the files Read more [...]