Hyper-V
-
Rename VMs in cluster to match SCVMM naming
Another one from the vaults: If youâve been using Hyper-V clusters with SCVMM, youâll probably notice the cluster resources named a specific way when the VM role is made highly available with SCVMM. example shown below: Now if youâre a bit of a nutter like me, and canât stand the cluster roles that donât have the âSCVMM Resourcesâ naming convention, then the below will update the names to match the SCVMM convention. -
Hyper-V and VMQâs â Mythbusting
Updated in Mar 2023: Ignore the May 2022 update, I was right all along. Microsoft actually change the default VMQ in Azure Stack HCI deployments, so that says all I need to know. **** ALWAYS change base processor to core 2 (or 1 if HT is not enabled) **** Updated in May 2022: For about a year or so now since MS made some tweaks and a growing confidence in the out of the box settings, the optimal position has changed on WS2019. -
SCVMM custom VM properties extended
One day I was working on our fabric and thought it would be nice to be able see which Logical Switch each VM was connected to. So I started to extend my good old datastores script and before I knew it, it had morphed out of control to include Logical Switch, Logical Networks, VM Networks and NIC count. In most enterprise environments this probably wouldnât really add much value, but in the world of multi-tenancy with many shared or customer dedicated clusters an networks, having this kind of information easily available has itâs advantages. -
S2D and CSV balancer - my take on things
The question: To enable or disable CSV balancer in S2D? Before we continue, I want to clarify the Cluster AutoBalancer and CSV Balancer are separate things. Cluster Autobalancer is relating to cluster roles, or in this case the VMâs. CSV balancer is about the CSV storage. Info on each can be found here: Cluster Autobalancer aka VM Load balancing:Â Clustering and High-Availability CSV Balancer, i.e. what we are talking about here:Â Automatic SMB Scale-Out Rebalancing (this is related to SOFS and 2012R2 but gets the info across) -
SCVMM Host Not Responding. Error 2912â WinRM & The request is not supported (0x80070032)
Quick and dirty answer â Windows Updates relating to CredSSP updates for CVE-2018-0886 The fun story time answer Iâve seen this one a few times now so thought it best to share with you all as many clients have gone around and around in circles with this one. The typical story is usually after some sort of maintenance, update cycle, VMM server rebuild or (as was todayâs case) an upgrade to SCVMM 1807⌠Upon restarting VMM many of the hosts go in to a Not Responding state. -
Installing Azure Site Recovery Agent (i.e. running an exe/script) on a Hyper-V host using SCVMM
From time to time I have the requirement to deploy/update a basic app or run a script on my Hyper-V hosts. This is relatively simple using remote PS session or if you have SCCM managing your fleet. But sometimes you need to just push something out fast and luckily SCVMM can assist. My use case is to run an update for the Microsoft Site Recovery Services Agent on my hosts. I would do this periodically. -
Another S2D build blog... with a SCVMM twist (public draft)
WORK IN PROGRESS Editors Note: this is still a working document as my priorities have to be on other work right now, but in the interest of sharing I have made this available now⌠If you find any issues or errors let me know - thanks for reading! There are many S2D build blogs out there and I donât want to just add to the list but given Iâm doing this build with SCVMM and SCOM integration I thought Iâd run through the additional steps. -
SCVMM console crashes when opening VM host properties
Error: âVMM cannot use [Logical Switch] to create a virtual switch a there are no uplink port profile sets present on this logical switchâ Environment: SCVMM 1801. Symptom, right click on a Hyper-V host and after a couple of seconds the below error. After clicking OK, VMM crashes. The fix that worked for me. First check the host group of the problematic hosts. In this deployment, they live in host group âTenant HCIâ -
S2D on HPE Gen10 LFF - The BOM
A few months ago we placed an order for some slick HPE Gen10 hardware to replace our existing storage service. Our trusty Server 2012 R2 Storage Spaces with DL360 Gen8âs and DataON enclosures has served us well, very well, but itâs time to move on to the latest and greatest⌠âThe SANKillerâ At the time of writing this (10 of April 2018), although theyâve very recently added 2 more SFF configs, HPE have not published a WSSD certified solution for Gen10 LFF chassis. -
Unable to delete duplicate cluster resource for Hyper-V VM
Quick tip: You find yourself with duplicate HA roles for a virtual machine and youâre unable delete the problematic resource⌠Symptoms: Duplicate cluster roles for a virtual machine. When attempting to delete, you get the error: Error code: 0x8007012f The file cannot be opened because it is in the process of being deleted. Firstly, why does this happen? This can happen if an admin uses Failover Cluster Manager (even after theyâve been specifically instructed many times not too) to enable HA for a VM, then goes to SCVMM and uses the Migrate Virtual Machine and enable HA. -
SMA Runbook to set VM custom property... (or run PS script)
A word⌠Having worked with many clients over the years, the commonality between many of them an under-utilization of automation. Even the biggest of Microsoft shops fall short when it comes to automation, regularly being confused about the options they have and often fear of introducing a new tool to their organisation. As a Hyper-V data center operator, I leverage automation as often as I can. This has been a concept we have tried to foster since the days of having scores of scripts triggered from scheduled tasks⌠-
Light up your Hyper-V Datacenter in minutes with OMS
In a recent project, the management were keen to see some dashboards and insights into their organizations shiny new infrastructure. Whilst SCOM gives some great data and statistics, itâs not overly helpful in demonstrating the high level view to management out of the box. This is where Microsoft Operations Management Suite (OMS)Â steps in.. Background: This engagement included a new Hyper-converged platform (Hyper-V and Storage Spaces Direct) managed and monitoring with System Center (SCVMM and SCOM), so we had a great foundation to light up OMS and some chosen solutions. -
Quick tip - Disabling ISO Media Sharing in SCVMM
Hello there! I often get asked if itâs possible to disable VMM users from âsharingâ ISOâs from the library when attaching to a VM. You can do this via applying a pre-configured Capability Profile and the Cloud and Virtual Machines. Note: Capability Profiles can only be assigned to Clouds, not to Host Groups Create a Capability Profile Name that means something to you Tip: In the capabilities we can scope the settings or range of many items within the profile. -
Managing a Hyper-V Datacenterâ Converged Networking and RDMA
Server 2016 brings great new feature called Switch Embedded Teaming (SET). A great overview of SET can be found in this TechNet article. But to summarize, SET basically allows a Virtual Network Adapter to access the features available by RDMA. I wonât go into too much detail on RDMA, there are essentially three types RoCE, iWarp and Infiniband. RoCE is the most common and requires that Datacenter Bridging (DCB) be enabled on your switches as well as the windows feature with the same name being installed. -
Managing a Hyper-V Datacenter - Extra thoughts & tuning
I will add to this post over time with anything I can recall that has helped in the tuning of the many environments Iâve worked on⌠Edited: 30/11 - Thoughts on Dynamic Optimization Before I continue, as usual Iâll try not to repeat what you can already find out there, so here are some tips that have been helpful over the years. Be sure to investigate whether each of the tips mentioned are valid for your version of hypervisor as a couple of these posts have aged: -
Managing a Hyper-V Datacenter - Host Networking - Teaming
There are many discussion topics around host networking that need to be considered. I will extend this post over time to include what I can, but many of these are dependent on your requirements. Some of the considerations include: Teaming options (this post) Converged design QoS policies SDN architecture Security & Edge Networking Switch high availability VMQâs and RSS Teaming options Typically when discussion teaming options we need to determine our teaming mode and the algorithm used. -
Managing a Hyper-V Datacenter - overview
I have been wanting to put a series together for a while now on the many aspects to consider when running a Hyper-V platform. So here we are.. As usual I want to avoid step-by-step installs as there are plenty on the internet, so I will link the useful ones and comment on any variances I recommend or points that need a little more consideration. This series will be organic and I will evolve over time. -
Mythbusting: The truth about blades
Hi all, this has been a long time coming but I wanted to share my thoughts and experiences on virtualization, Hyper-V and blades. Before we get started, I wanted to put this in context and give some reasoning as to the purpose of this post. Over the last 5 or 6 years, Iâve been closely working with many service providers and enterprises in designing, configuring and supporting Hyper-V and System Center environments, and an interesting and often polarising discussion topic that regularly surfaces is blades vs racks. -
SMA Runbook: SCVMM Logical Networks into HP OneView
This SMA Runbook will add any new or missing logical network definitions (i.e. VLANâs) in SCVMM and to HP OneView appliance. As well as having a âworking SMA deploymentâ, the prerequisites for this Runbook are 5 SMA Variables (Assets) which are: VMMServer HPOneViewAppliance HPOneViewUsername HPOneViewPassword HPOneViewLoginDomain We use Active Directory to authenticate to our OneView. If you use local credentials you can remove this from the Runbook or set the variable to âLocalâ. -
Expose the Azure Stack TP3 Portal through NAT
Another quick one! :D For those playing with the Azure Stack TP3 POC deployment that want to make the portal available without having to logon to the console VM. This extends on from the work Ruud Borst did for TP2.. I suggest you read the full article which can be found here: https://azurestack.blog/2016/12/expose-portal-azurestack-through-nat/ Same rules apply around the certificate etc. Let me know if I have missed any ports. Enjoy! Dan -
SCVMM and Datastores
Was cleaning out some old PS scripts recently and found this one in my toolkit. This one will appease some of those out there who came to Hyper-V from another virtualization technology and are familiar with the term datastore⌠We use SOFS storage so our VM paths are all SMB shares but Iâve included the CSV path split for those still running CSVâs to the nodes. What this gives you is a quick view into which storage device each VM lives on: -
Applying updates (cab & msu) by batch file
Another one from my toolkit.. Basically run this batch file from a folder with the required update files and it will install them all. Once it is finished it will prompt for any input to restart the server. Enjoy! Dan @ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION FOR /R "%~dp0" %%A IN (-KB.msu) DO ( CALL :SUB %%~nA ECHO= Installing KB!KB_NUM! >NUL TIMEOUT /t 3 WUSA "%%A" /quiet /norestart) ECHO= == Press any key to restart == >NUL PAUSE SHUTDOWN. -
Hyper-V Cluster LBFO method for VM Guest switches â Hyper-V Port is best!
Just a quick note to share my experience in NIC teaming algorithm with 2012 R2 hosts and Hyper-V and hopefully dispel some myths.. Many documents/blogs recommend the load balancing algorithm to be Dynamic by default. In my experience this is not the optimal configuration. For NIC teams that are used for VM Guest networking, the Load Balancing Algorithm should be set to Hyper-V Port by default. Every Hyper-V environment I have built in the last few years has performed significantly better using Hyper-V Port as the preferred load balancing algorithm. -
Azure Connector for WAP(Pheonix) fails to create VM âError in CheckCheckVmCreation()â
Another quick one (becoming a habit..) In deploying and testing Azure Connector for Windows Azure Pack found here, deploying a virtual machine can sometimes fail with an obscure status message of: âError in CheckCheckVmCreation()â This is because the parameters of the resource creation are rejected. In the below example, I faced this because my lab password did not meet the required complexities. Running the the process using the same account in Azure, I am faced with a minimum password complexity error -
NVGRE Rebuild â Warning 26926
Had a quirky one recently where by a client was rebuilding a NVGRE gateway (as per this post) failed with the below warning. Warning (26926) Unable to set up Remote Access server to support multi-tenancy mode. (Remote Access server and the host are not configured for multi-tenancy. Fix the issue in Remote Access server and retry the operation.). Recommended Action Fix the issue in Remote Access server and retry the operation. -
SCVMM DataSize Property
Quick Tip!! So I was asked to create a custom property that gives a quick overview of the total size for the virtual disks on a VM So, leveraging of my DataStore script, I came up with the below.. Enjoy Note: This assumes you have created your custom property already $VMS = Get-scvirtualmachine Foreach ($VM in $VMS) { $DZ = $null $dzprop = Get-SCCustomProperty -Name Datasize $DataSize = Get-SCCustomPropertyValue -CustomProperty $dzprop -InputObject $VM IF ($DataSize. -
Hyper-V 2012 R2 NVGRE Gateways Rebuild
Fast publish⌠will revisit later Scenario: Existing NVGRE gateways manual deployed. Working fine for ages. NAT resources failed to come online HyperV Network Virtualization Gateway role failed FOCM below Cluster resource xxxxxxxxxxxxxxxxxx of type âNatâ in clustered role âHyperV Network Virtualization Gatewayâ failed The Windows NAT Driver service failed to start due to the following error: The property set specified does not exist on the object So, I decided I wanted to rebuild my gateways and reconnect them⌠but how? -
WAP - Deploying a VM Role, some VM's prompt for product key
Simple one that new WAP users often miss when deploying VHDâs for VM Roles. When deploying a VM role with multiple instances, some instances get stuck during deployment with the VM waiting for a product key to be entered. Although the solution is clearly discussed here on TechNet I find that new WAP admins typically overlook this setting when importing a new vhd/vhdx template and loose a bit of time troubleshooting. -
Quick migrate multiple VM's using PowerShell
As users of System Center Virtual Machine Manager would know, trying to quickly live migrate multiple VMâs can be a slow and tedious task. Whilst I always recommend to user of VMM to use the Migrate Virtual Machine function or the Start Maintenance Mode options, sometimes I need to react quickly and the normal VMM way isnât fast enough. This is where PowerShell comes in⌠$VMS = Get-SCVirtualMachine | ogv -passthru $VMHost = Get-SCVMHost | ogv -passthru ForEach ($VM in $VMS) { Move-SCVirtualMachine -VM $VM -VMHost $VMHost -HighlyAvailable $true -RunAsynchronously -UseDiffDiskOptimization } Hope this helps! -
Migrate Logical Networks from VMM to VMM with PowerShell - The Export
Fast publish! Had to migrate logical networks from an existing VMM 2012 instance into a new shiny VMM 2012 R2 deployment. This is the export from the existing VMM. The import script will follow shortly: Import-Module virtualmachinemanager # all Logical network definitions $LogicalNetsdef = Get-SCLogicalNetworkDefinition Foreach ($def in $LogicalNetsdef){ foreach ($SubnetVlan in $def.SubnetVLans){ $data=[ordered]@{ LogicalNetworkName = $def.LogicalNetwork.Name Name=$def.Name Subnet=$SubnetVlan.Subnet VlanID=$SubnetVlan.VLanID } $Obj=New-Object -TypeName PSObject -Property $data Write-Output $Obj } } Enjoy! -
Deleting Virtual Network fails due to assigned IP address - SCVMM
Had a request today where a tenant was trying to delete a virtual network but they received an error saying there were dependent IP addresses but they have no IP addresses listed in the network. Using my current favourite PowerShell feature, Out-GridView, we can quickly script the revocation of the naughty IP address.. Note: Change the VMM variable to suit your environment So I ran the below to find the IP. -
Physical, Logical & Virtual Networks in a Microsoft Cloud OS Environment
I had to give an overview of our Cloud OS network topology to our support and engineering guys to help them understand at high levels how it all fitted together. The below diagram hopefully demonstrates the 3 layers â physical, logical and virtual â and more importantly how the fit together. Some notes: We have a dedicated Hyper-V cluster for the fabric management domain. We also have a standalone Hyper-V host that has a VM for DC and DPM. -
Adding existing VMâs to WAP Subscription using PowerShell
Edit: added Cloud parameter to the script. Deploying WAP for clients, they start creating new clouds, plans and subscriptions which is great!! But how do they add existing VMâs to new users in WAP? EasyâŚ.. you guessed itâŚ. PowerShell! So I canât take the credit here, my sources are found here & here. Ok, thatâs out of the way.. here it is⌠Requirements: You must have an existing tenant account That tenant must have an existing VM (I usually just kick off a quick VM deployment in WAP and delete it once done) I like to use Out-GridView to keep the script portable. -
Change default PHP settings in Windows Azure Pack (IIS WebFarm)
Had a user try to upload a theme to a Wordpress site they had published using Windows Azure Pack but were getting a file exceeded size limit error as exampled below. âThe uploaded file exceeds the upload_max_filesize directive in php.iniâ Typically you would just go into the php.ini located on the local webserver but how do I do this in a WAP Websites WebFarm? PowerShell of course!!! Ok, I do this from the websites controller server: -
Migrate multiple VMâs from one Hyper-V cluster to another Hyper-V cluster with different Logical Switch using PowerShell.
Another fast publish! (I really should get back and clean these upâŚ) Recently upgraded one of our Hyper-V clusters and had to migrate workloads to a new Hyper-V cluster. The naming conventions of our logical switches etc were different so when migrating a VM using Hyper-V manager we were prompted to choose the new logical switch. Handling this via PowerShell in isolation is simple enough using this script but I wanted to do a whole stack of VMâs at once. -
VM Template network settings for WAP
Quick scribble: add images and detail 3 steps Template > NIC > Set Connected > Set static IP & Static MAC > OK Template > NIC > Set No Connected > Confirm static IP & Static MAC > OK Template > NIC > Set Connected > VM Network None > Confirm static IP & Static MAC > OK Do in each template AND hardware profile Deploying in WAP should work with or without a virtual network. -
SCVMM 2012 R2 - Refresh Host Cluster - Error (25122)
Fast publish (this is becoming a common phrase) so be kind⌠When refreshing host cluster in VMM, for some reason we started to see the below error in VMM: Error (25122) The specified address ((AllocatedIPAddressData#e449) { id = 6ea8ddba-b8a7-43f6-856e-0a4d35076681, LastUpdatedTimestamp = 3/24/2015 5:55:17 AM }) is already allocated by the pool (IPPool-LNet-Mgmt). This address should be assigned to only a single entity. Recommended Action Resolve to which entity this address is allocated. -
Live Migrating VMâs with Powershell from VMM to VMM with different Logical Switch
Another quick & dirty fast publish: When live migrating a VM from one Hyper-V to another Hyper-V when the virtual switch names are different, using the GUI you get a prompt to select the swtich on the target host. Using Powershell âMove-VMâ fails and there is no option to specify the target switch name. A way around this is using the Compare-VM cmdlet. Below is part of a quick and dirty script that achieved my goal. -
Setting the URLâs for WAP Admin & Tenant sites with PowerShell using variables
Edit: have updated the script This is a PowerShell script I use as a template when building WAP instances. Essentially, either edit variables in the script or use the read-host option. I prefer the set variables but the read-host is handy⌠well, it was onceâŚ
Collect URLS & Ports $URL = read-host "Domain Name?" Write-Host -ForegroundColor Yellow "Specify hostnames for each service" $TenantSite = read-host "Tenant host? (i.e. wap)" $TenantAuth = read-host "TenantAuth host?
-
Windows Azure Pack - URLs & Ports
This is for editing the Windows Azure Pack URLâs and Ports. Works as of WAP for Server 2012 R2 UR5. Modify your variables accordingly. I have each WAP site on an individual server for a scaled deployment so this sets all the sites to use the 443. #Set Variables $WAPDB = "WAPDB" $AdminSite = "wapadmin.domain.com" $AdminAuth = "wapauth.domain.com" $Tenant = "wap.domain.com" $TenantAuth = "waplogon.domain.com" #Run on Tenant Site Import-Module -Name MgmtSvcConfig Set-MgmtSvcFqdn -Namespace "TenantSite" -FullyQualifiedDomainName $Tenant -Port 443 -Server $WAPDB #Run on Tenant Auth Site Set-MgmtSvcFqdn -Namespace "AuthSite" âFullyQualifiedDomainName $TenantAuth -Port 443 -Server $WAPDB $ConnectionString = "Data Source=$WAPDB;Initial Catalog=Microsoft. -
Hyper-V - Create VM powershell script
Hi, Powershell script to create a VM after prompting the user for various settings. The script then attaches an ISO which is a boot media for an MDT server that is built tp push a particular task sequence resulting in a failry automated VM deployment. I normally do this type of stuff with VMM etc but the client only has Hyper-V and wanted it automated as much as possible. $VMName = Read-Host "Enter VM Name (Press [Enter] to choose Server01)" if ($VMName -eq "") { $VMName = "Server01" } ; if ($VMName -eq $NULL) { $VMName = "Server01" } $StartupMem = Read-Host "Enter VM Startup Memory in GB's (Press [Enter] to choose 1GB)" if ($StartupMem -eq "") { $StartupMem = 1024MB } ; if ($StartupMem -eq $NULL) { $StartupMem = 1024MB } if ($StartupMem -ne 1024MB) { $StartupMem = [int]$StartupMem * 1073741824 } $MinimumMem = Read-Host "Enter VM Minimum Memory in GB's (Press [Enter] to choose 512MB)" if ($MinimumMem -eq "") { $MinimumMem = 512MB } ; if ($MinimumMem -eq $NULL) { $MinimumMem = 512MB } if ($MinimumMem -ne "512MB") { $MinimumMem = [int]$MinimumMem * 1073741824 } $MaximumMem = Read-Host "Enter VM Maximum Memory in GB's (Press [Enter] to choose 4GB)" if ($MaximumMem -eq "") { $MaximumMem = 4096MB } ; if ($MaximumMem -eq $NULL) { $MaximumMem = 4096MB } if ($MaximumMem -ne 4096MB) { $MaximumMem = [int]$MaximumMem * 1073741824 } do { $Storage = Read-Host "Which storage do you want, SATA 'D' or SSD 'H' (Press [Enter] to choose 'D')" if ($Storage -eq "") { $Storage = "D" } ; if ($Storage -eq $NULL) { $Storage = "D" } if (($Storage -ne "D") -and ($Storage -ne "H")) { Write-Host "Incorrect valude entered, please enter 'D' or 'H'" } } until ($Storage -eq "D" -or $storage -eq "H") $VDisk1 = Read-Host "Enter VM System (C:) Hard Drive in GB's (Press [Enter] to choose 60GB)" if ($VDisk1 -eq "") { $VDisk1 = 60GB } ; if ($VDisk1 -eq $NULL) { $VDisk1 = 60GB } if ($VDisk1 -ne 60GB) { $VDisk1 = [int]$VDisk1 * 1073741824 } $VDisk2 = Read-Host "Enter VM Data (D:) Hard Drive in GB's (Press [Enter] to choose 60GB)" if ($VDisk2 -eq "") { $VDisk2 = 60GB } ; if ($VDisk2 -eq $NULL) { $VDisk2 = 60GB } if ($VDisk2 -ne 60GB) { $VDisk2 = [int]$VDisk2 * 1073741824 } $VMSwitches = @(get-vmswitch) #clear variable for testing $VMSwitch = "" $VMNetwork = "" do { For ($i = 0; $i -le $VMSwitches. -
SCVMM 2012 R2 - Refresh Host Cluster - Error (2912)
- Fast publish post - be nice.. In my Cloud OS demonstration environment recently I had a host in the cluster reporting âNeeds Attentionâ status and refreshing the host cluster failed with âerror 2912â. The Hyper-V Host was in âNeeds Attentionâ status and performing any functions from VMM were failing. Job summary example below: _Error (2912) An internal error has occurred trying to contact the server.domain.net server: : . WinRM: URL: [http://server.
-
WAP Usage does not work. Last ID never changes. SQL Named instances.
This is a fast publish! We were working with WAP and had an issue on one of our deployments not getting usage information. Never had this issue in previous deployments but identified that our SCOM DW SQL is on a Named Instance on this deployment. The fix that worked for me with SQL Named instances to change the connection string to use âTrusted Connectionâ. My environment: SCOM MS Server = SCOM01.