Category: Virtualization

PowerShell: Find Duplicate Mac Addresses of Guest VMs in Virtual Machine Manager

Here's a quick snippet to check whether you have any duplicate mac addresses on existing…

PowerShell: Assign Guest Virtual Machine to a Cloud in VMM

# assignVmsToCloud.ps1 # version 0.02 # The following function assigns a guest VM into a…

The Process of Adding a New Hyper-V Server Into a Cluster and the Associated Virtual Machine Manager (VMM)

These are the steps: Install WindowsWindows 2019 Data Center Edition is the standard as of…

Hyper-V Guest VM CPU Compatibility Feature Down Side

Symptom: guest VM could not install applications that require'SSE4.2 and POPCNT instruction sets' Cause: The…

How To Install VMM Agent (SCVMM) Manually

The following snippet assumes that a New Hyper-V Server has been added to the cluster;…

PowerShell: Add Network Sites (VLAN) into a Virtual Machine Manager Logical Network

# addVmmNetworkSites.ps1 # version 0.01 # User Defined Variables $networkSites=@( @{ 'newNetworkSitename'="test 1" 'vlanId'=100 'vlanCidr'='192.168.1.0/24'…

Virtual Machine Networking Error 15011

Creating New Logical Network $logicalNetworkID="somehash-hash-hash" $newNetworkName='Test Network' $subnet="192.168.500.0/24" $logicalNetwork = Get-SCLogicalNetwork -ID $logicalNetworkID $vmNetwork =…

Virtual Machine Manager (VMM) Error ID: 1730

Symptom: $vmName='bad-guestvm' $vm = Get-SCVirtualMachine -Name $vmName Read-SCVirtualMachine -VM $vm Read-SCVirtualMachine : The selected action…

Kubernetes Broken Due To Unknown Reasons

Problem 1: Admin User Unable to Login to Cluster via Controller (Master Node) # SSL…

PowerShell: Move Virtual Machine Storage Using VMM

# moveVmStorageUsingVmm.ps1 # Version 0.01 $vmNames=@( 'TESTVM0001', 'TESTVM0002', 'TESTVM0003' ) $storageLocations=@( 'C:\ClusterStorage\BLOB001', 'C:\ClusterStorage\BLOB002', 'C:\ClusterStorage\BLOB003' )…

Get Hyper-V Cluster Automatic Balancing Configurations

# getHyperVLoadBalanceMode.ps1 $clustername=(Get-Cluster).Name function getHyperVLoadBalanceMode($clustername=(Get-Cluster).Name){ $AutoBalancerLevel=[hashtable]@{ '1'='Low | Move when host is more than 80%…

PowerShell: Quick Snippet to Remove Virtual Machine Snapshots in VMM

$vmNames=@( 'MACHINE1', 'MACHINE2' ) foreach($vmName in $vmNames){ $checkpoint = Get-SCVMCheckpoint -VM $vmName if($checkpoint){$checkpoint|%{Remove-SCVMCheckpoint -VMCheckpoint $_…

PowerShell: Create Hyper-V Guest VM From Virtual Disk (VHDX)

Part 1: Creating Hyper-V Guest VM From a Virtual Disk # createHyperVGuestVmFromDisk.ps1 # Version 0.02…

PowerShell: Find Guest VMs Associated with a Certain Storage Path

# findGuestMvsByStorage.ps1 $storagePath='\\SMBSERVER009' function getAllGuestVms($clusterName){ try{ Import-Module FailoverClusters $clusterName=if($clusterName){ $clustername }else{ (get-cluster).name } $allHyperVHosts={(Get-ClusterNode -Cluster…

PowerShell: Restart a Service on All Hyper-V Hosts of a Cluster

$serviceName='vmms' $clusterName='HyperV-cluster001' function restartServiceAllClusterNodes($service='vmms',$clusterName){ function restartService($serviceName){ $waitSeconds=40 $isValidProcess=try{[bool](get-service $serviceName -EA Stop)}catch{$false} if($isValidProcess){ try{ $process=Start-Process -FilePath…

PowerShell: Find Hyper-V Host by Guest VM Name

# findVmHostByGuestName.ps1 $vmName='TESTVM' function findVmHostByGuestName($vmName){ try{ Import-Module Hyper-V Import-Module FailoverClusters $allHyperVHosts={(Get-ClusterNode | Where { $_.State…

PowerShell: Get All Hyper-V Host Spectre Patch Versions

# getAllVmSpectrePatchVersions.ps1 function getHyperVHostsInForest{ function includeRSAT{ $ErrorActionPreference='stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #$rsatWindows7x32='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x86-RefreshPkg.msu' $rsatWindows7x64='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x64-RefreshPkg.msu' $rsatWindows81='https://download.microsoft.com/download/1/8/E/18EA4843-C596-4542-9236-DE46F780806E/Windows8.1-KB2693643-x64.msu' $rsat1709 =…

PowerShell: Fix All VMs CPU Compatibility Setting

# fixAllVmCpuCompatibility.ps1 # version 0.01 function getHyperVHostsInForest{ function includeRSAT{ $ErrorActionPreference='stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #$rsatWindows7x32='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x86-RefreshPkg.msu' $rsatWindows7x64='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x64-RefreshPkg.msu'…

PowerShell: Search for Hyper-V Guest VM That Has Not Been Registered In Cluster

# findVmHost.ps1 $vmName='TESTVM01' function findVmHost($vmName){ try{ Import-Module Hyper-V Import-Module FailoverClusters $allHyperVHosts={(Get-ClusterNode | Where { $_.State…

Resolving Guest Virtual Machine Critical Status in Hyper-V Manager

Part A: Validating problem as VM in Critical Status # Check VM Status in Hyper-V…