Archive by category "Virtual machine manager"

ID: 2912 | Details: Service unavailable (503) (0x801901F7) | NO_PARAM NO_PARAM

During the deployment of a new resource or adding a new resource  there is a possibility that you can face the following error:

An internal error has occurred trying to contact the ” server: NO_PARAM: NO_PARAM.
WinRM: URL: [http://:5985], Verb: [INVOKE], Method: [GetError], Resource: [http://schemas.microsoft.com/wbem/wsman/1/wmi/root/microsoft/bits/BitsClientJob?JobId={1FAA84D0-C551-4410-AB54-0DE094840D37}]

Service unavailable (503) (0x801901F7)

Recommended Action

Check that WS-Management service is installed and running on server ”. For more information use the command “winrm helpmsg hresult”. If ” is a host/library/update server or a PXE server role then ensure that VMM agent is installed and running. Refer to http://support.microsoft.com/kb/2742275 for more details.

After some investigation this can happen due two circumstances:

1.The VMM Certificate has expired. Check this one in your certificate store.

If the certificate is expired, create a new one:

Then, refresh all VMM Infrastructure servers (including VMHosts) so they get the new certificate.

2.The port is used by another program.

After installing the newest product from Microsoft “Admin Center” on our Library server we faced the same issue.

To solve this: Go to the library server -> Open regedit -> Search for “BITSTcpPort” -> Change the value to an unused Port like (8500).
Restart the SCVMM Agent and refresh your Library share in SCVMM.

Remove Hyper-v node from SCVMM Failed: Error(25333)

In some situations (hardware failures etc.) it’s not possible to remove the Hyper-v cluster node nicely out of SCVMM. When removing the Hyper-v node from VMM it will throw an Error (25333) in SCVMM. This is because the server is down and it’s not possible to remove the SCVMM Host agent.

To solve this you can use the following PowerShell command:

 

Monitor VMM Job using PowerShell

In SCVMM there is no option to send a mail when a job is completed.
This can be archived with PowerShell. Here is an simple example script to monitor the SCVMM Job status:

 

Compact Dynamic VHDx file

There are many ways to compact a VHDx file. It can be done using SCVMM, Hyper-V manager or even diskpart.
In my situation the compact option doesn’t reduce the size, it was even bigger than before the compact.

I’ve tried to defragment the disk, migrate it or even clean it up inside / without any result.
The only way to get this job done is writing zero’s on the empty space.

This can be done with the tool SDelete, created by Mark Russinovich. The tool zeroes the empty space within the VHDx file.
Before running the tool delete al the un-needed and temporary files.

Sam Boutros created a nice little PowerShell function to get this job done. The package with SDelete and the script can be downloaded HERE.
Example script function parameters:

After running the tool the compact action will reduce the space.
Since Windows 2012 Microsoft has the new TRIM/UNMAP command founded, this works only when the Underlying storage supports this.

 

Get duplicate MAC Address PowerShell VMM

Duplicate mac addresses can result in strange situations in your environment, losing connections etc.
This is a simple script to filter all the duplicate mac addresses.

Set VM Cloud and User Role with VMM PowerShell

When you install Azure Pack you need to add a cloud and userole on each VM.
Manually this is a boring click job..

PowerShell makes this a lot easier, first change the cloud and then the user role:

 

Error: VMM Host not responding

First of all check if your VMM SA Account is member of the local administrators group on each Hyper-v node.
Then open the VMM Console and right-click on the host that’s experiencing issues and chose properties -> status.

– Network: Some network issues, most cases VMM can’t reach the VMM agent. Check DNS, Ports and ping.

Ports used by VMM Agent:
Hyper-V Host (VMM agent) Ports: 80/135/139/445        WinRM/RPC/NetBIOS/SMB (TCP)
Hyper-V Host (File transfer) Port: 443 or 80                     HTTPS/HTTP Using Bits
Hyper-V Host (Control channel) Ports: 5985/5986          WS-Management

– WinRm: Check if WinRm is working on the Hyper-v node:

Configure the WinRm service to run in a separate Svchost.exe process. You can check this with Process explorer from Sysinternals witch can be download from here.

If WinRm is not running in a separate svchost process.
Open an elevated command prompt:

You get this output if the command was succesful:
[SC] ChangeServiceConfig SUCCESS

And increase the limits of WinRm:

Try a refresh in VMM..

– Host agent service: Restart the VMM Agent on the host with this PowerShell command:

– Host agent version: Update the VMM Agent version if it is older than the VMM Console.
– WMI Performance Counter: If you have some WMI related issues you can restart the SCOM Agent try to clear the SCOM Health cache..

 

If WMI Still corrupted you can try to performs a consistency check on the WMI repository, and if an inconsistency is detected, rebuilds the repository, with this command:

When this fails you can try a full reset of the WMI Repository with this command:

 

If the Winrm commands fails, look if the winRM working correctly with this command:

With a working config the output looks like this:

Listener [Source=”GPO”]
Address = *
Transport = HTTP
Port = 5985
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint
ListeningOn = THE IPADRESSES

With a bad config try a new quick config of WinRm:

 

Delete VM From VMM Database

Firtst, try to remove the VM with the VMM Powershell module:

If this was not succesvol you can try this:
This is a sweaty hand job, but in most cases succesful..

On your VMM Management server, stop VMM Management service and VMM Agent.
Login to your SQL Management Studio and start a Query against your VirtualManagerDB.
First search for the ID, the Spooky VM have:

After you get the ID, past this ID in the following 3 sections of code in the GUID section:

 

Hyper-v VM migration with VMM Powershell

Somethimes you need to bulk migrate some Hyper-v virtual machines.
This is not possible with the VMM gui.

In this situation PowerShell can help:
Filter on VMname

Replace the $VM line when you need to migrate all the machines placed on a specified host:

 

 

 

 

List all Hyper-v snapshots with the VMM PowerShell Module

There is no place where you can find an overview from all Hyper-v snapshots in the VMM Gui.
In this situation PowerShell is your friend. With a few lines of PowerShell code is this overview simple to make.

Run this commands in an elevated PowerShell  prompt where you installed the VMM Console: