hyper-v Enable processor compatibility

Enabling this feature manually on each vm, via settings processor > expand > Compatibility > tick Migrate to a physical computer with a different processor version   View current status of all vm's on a host. PS C:\WINDOWS\system32> Get-VM | get-VMProcessor VMName Count CompatibilityForMigrationEnabled CompatibilityForOlderOperatingSystemsEnabled ------ ----- -------------------------------- -------------------------------------------- Activation-Test 1 False False AzureADConnect2 1 False False AzureBackup1 2 False False exchange 4 False False Proxy1 1 False False RDSHost (rdvh1) 1 False False SCCM (WSUS) 2 False False Steam-Cache 2 False False SYSDeploy 2 False False TesVMG1 1 False False TesVMG2 1 True False vd1-H0 1 False False vd1-H1 1 True False w10IotE 1 False False Windows10-vdi-m 1 False False Windows10-vdi-v1 1 False False Update all vm's on host (only updates vms that are powered off.) PS C:\WINDOWS\system32> Get-VM | set-VMProcessor -CompatibilityForMigrationEnabled $true   After (only updates VMs that are powered off) PS C:\WINDOWS\system32> Get-VM | get-VMProcessor VMName Count CompatibilityForMigrationEnabled CompatibilityForOlderOperatingSystemsEnabled ------ ----- -------------------------------- -------------------------------------------- Activation-Test 1 True False AzureADConnect2 1 False False AzureBackup1 2 False False exchange 4 True False Proxy1 1 True False RDSHost (rdvh1) 1 False False SCCM (WSUS) 2 False False Steam-Cache 2 True False SYSDeploy 2 True False TesVMG1 1 True False TesVMG2...
Read More

VM kept a recovery checkpoint

Not sure why this occurred however I was planning to add a new drive to a vm, however could not add the new drive. Thinking back to an issue with a VM at work, on my VM exchange I tried to edit an existing drive on the VM and it mentions checkpoints exist. In poweshell I did get-vmsnapshot Exchange it mentioned it was a recovery checkpoint The command I used to remove it was get-vmsnapshot exchange | remove-vmsnapshot Below is a screenshot of the CMD/Powershell window ...
Read More

Export list of Mac addresses used by Hyper-V VMs

Run Powershell as admin Get-vm | Get-VMNetworkAdapter | select-object VMname, Macaddress, Name | Export-Csv -Delimiter ";" -Path C:\vmmacs.csv VMName = name of the virtual machine Macaddress = Mac of the VM being used Name = The type of network adapter being used such as Network Adapter and Legacy Network Adapter Delimiter is ; which is how they are spaced out so that you can convert from text to collumn. Open the file in Excel, select the column, then click on Data tab then text to columns, select delimited and click on next and then ensure only semicolon is ticked, and then click finish   ...
Read More

Hide Hyper V Floppy Disk Drive via group policy

On Any Hyper-V virtual machine it adds the Floppy disk drive, and there is not an option to remove the drive from the settings window of the VM   The Way to remove this drive is by changing a value in the registry of the virtual machine that is running windows. However as I join my VMs to a domain I can utilise group policy to apply this change I created a new group policy called "Remove Hyper V Floppy disk drive" I went into Computer configuration > preferences > windows Settings > Registry From there I right clicked on registry and selected new > Registry item And set the following values: Action: Update Hive: HKey_Local_Machine Key Path: SYSTEM\CurrentControlSet\Services\flpydisk Value name: Start Value Type: REG_DWORD Value: 4 Base: Decimal Then I clicked Apply and OK   I applied it to the root of the domain so that it would apply to all devices on the domain...
Read More

Hyper-V Guest Operating Systems that support Dynamic Memory

Linux distributions For details on Linux distributions and versions that support dynamic memory, and the requirements for Linux Integration Services, see Linux and FreeBSD Virtual Machines on Hyper-V. Windows Server 2012 and Windows Server 2012 R2 Datacenter, Standard, and Essentials editions. Integration services are built-in and do not require a separate download and installation. Windows 8 and Windows 8.1 Windows 8, Windows 8 Pro, and Windows 8 Enterprise editions. Windows 8.1, Windows 8.1 Pro, and Windows 8.1 Enterprise editions. Integration services are built-in and do not require a separate download and installation. Windows Server 2008 R2 with Service Pack 1 (SP1) Datacenter, Enterprise, Standard, and Web editions. Windows Server 2008 R2 Datacenter and Enterprise editions. Windows 7 Enterprise and Ultimate editions (32-bit and 64-bit). ...
Read More

Enabling Nested Virtualization

A Hyper-V host running Windows Server 2016 or Windows 10 Anniversary Update. A Hyper-V VM running Windows Server 2016 or Windows 10 Anniversary Update. A Hyper-V VM with configuration version 8.0 or greater. An Intel processor with VT-x and EPT technology. Shutdown VM Open Powershell as admin and run this command on Hyper-V host "Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true When using Nested Virtualization you can not use dynamic memory. Set to VM to Static memory if it isn't already Start VM Install Hyper V role More info: https://docs.microsoft.com/en-gb/virtualization/hyper-v-on-windows/user-guide/nested-virtualization   Script that will prompt you to enter name of VM $Server = Read-Host -Prompt 'Input your server name' Set-VMProcessor -VMName $Server -ExposeVirtualizationExtensions $true...
Read More

Get Hyper-V VM IOPS statistics

First, you need to see if VM resource metering is enabled run PowerShell as admin on a hyper v host (or using remote powershell) Get-VM | Format-List Name,ResourceMeteringEnabled   To Enable Metering Enable-VMResourceMetering -VMName NameOfVM To Disable Metering Disable-VMResourceMetering -VMName NameOfVM If you want to enable this for all vm's on a host replace NameOfVM with *   Basic overview Use the below command (values only 0 if VM is off) Get-VM | Measure-VM This shows the columns: VMName, Avg CPU, Avg Ram, Max Ram, Min Ram, Total Disk, Network Inbound, Net Outbound Focus on IOPS Measure-VM -VMName NameOfVM | select VMName, @{Label='TotalIO';Expression = {$_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten}}, @{Label='%Read';Expression={"{0:P2}" -f ($_.AggregatedDiskDataRead/($_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten))}}, @{Label='%Write';Expression={"{0:P2}" -f ($_.AggregatedDiskDataWritten/($_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten))}}, @{Label='TotalIOPS';Expression = {"{0:N2}" -f (($_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten)/$_.MeteringDuration.Seconds)}} | ft    ...
Read More