Sep 112016
 

Resolving DPM Install Error – Report Configuration Failed

During a recent attempt to do some testing in the lab with DPM I encountered the following error during the DPM install:

Report Configuration Failed.
Verify that SQL Server Reporting Services is installed properly and that it is running.
ID: 812
DPM Install Error - Report Configuration Failed ID: 812

DPM Install Error – Report Configuration Failed ID: 812

My SQL server had an instance created for DPM and I verified that Reporting Services was configured and accessible from the SQL server and the DPM server. It was a pretty puzzling problem.

The DPM install logs proved invaluable in tracking this issue down. You can located the install logs here: C:\Program Files\Microsoft System Center 2012 R2\DPM\DPMLogs

[8/29/2016 10:13:43 PM] * Exception :  => Report configuration failed.Verify that SQL Server Reporting Services is installed properly and that it is running.Microsoft.Internal.EnterpriseStorage.Dls.Setup.Exceptions.BackEndErrorException: exception ---> Microsoft.Internal.EnterpriseStorage.Dls.Setup.Exceptions.ReportDeploymentException: exception ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.0.100.6:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---

[8/29/2016 10:26:54 PM] * Exception :  => Report configuration failed.Verify that SQL Server Reporting Services is installed properly and that it is running.Microsoft.Internal.EnterpriseStorage.Dls.Setup.Exceptions.BackEndErrorException: exception ---> Microsoft.Internal.EnterpriseStorage.Dls.Setup.Exceptions.ReportDeploymentException: exception ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

The logs revealed that DPM was attempting to access the reporting services over 443. As this was a lab setup, I had not taken steps to configure encryption which was causing the failure.

On the SQL server I created a self signed certificated using New-SelfSignedCertificate.

I placed this certificate into the Trusted Root Certification Authorities Certificate store on both the SQL server and the DPM server.

Certificate MMC - Trusted Root Certification Authority Certificates

Certificate MMC – Trusted Root Certification Authority Certificates

I attempted the install again, and it still failed throwing the same DPM Install error – Failed ID: 812!

A quick review of the SQL Reporting Services configuration showed that I had forgotten to also set the Web Service URL to utilize SSL. A quick configuration adjustment to utilize the newly created self-signed certificate and I was ready to attempt the install again.

SQL Server 2012 Reporting Services Configuration Manager Web Service URL

SQL Server 2012 Reporting Services Configuration Manager Web Service URL

With the SQL Reporting Services configured for SSL the DPM Install error was resolved:

Successful DPM install

Successful DPM install

Jun 122016
 

2012 Server sysprep fails during MDT capture sequence

I recently experienced an issue while updating my 2012 server image on my MDT deployment share.  The newly updated 2012 Server sysprep fails during the sysprep capture process.  The MDT task sequence indicated the following sysprep error:

IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE actual image state is IMAGE_STATE_UNDEPLOYABLE

A review of the sysprep error log (C:\Windows\System32\sysprep\setuperr.log) revealed the following issue:

2016-06-12 11:18:21, Error      [0x0f00bf] SYSPRP CreateSysprepActionList: Invalid action node sysprepOrder found for component Microsoft-Windows-SoftwareInventoryLogging-ScheduledTasks
2016-06-12 11:18:21, Error                 SYSPRP SysprepSession::Execute: Error in executing actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x10dd
2016-06-12 11:18:21, Error                 SYSPRP RunPlatformActions:Failed while executing SysprepSession actions; dwRet = 0x10dd
2016-06-12 11:18:21, Error      [0x0f0070] SYSPRP RunExternalDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x10dd
2016-06-12 11:18:21, Error      [0x0f00a8] SYSPRP WinMain:Hit failure while processing sysprep generalize internal providers; hr = 0x800710dd


It took two days of research to track this one down and it ended up being related to the Windows Management Framework (WMF) 5.0 RTM which I was including in my image refresh.
Apparently there is a known Bug: WMF 5 Production Preview on Windows Server 2012 breaks Sysprep

In the following article: WMF 5.0 Known Issues and Limitations I discovered a workaround for this problem which I have included below.  It essentially involves modifying the Generalize.xml for sysprep to accommodate the upgrade to WMF 5.0.  I made the necessary changes and sysprep and the MDT capture sequence worked without issue.

For systems running Windows Server 2012

  1. After installing WMF 5.0 on the server to be Sysprep’d, login as administrator.
  2. Copy Generize.xml from directory \Windows\System32\Sysprep\ActionFiles\ to a location outside of the Windows directory, C:\ for example.
  3. Open your Generalize.xml copy with notepad.
  4. Find and remove the following text, one instance of each needs to be deleted (they will be near the end of the document).
    • <sysprepOrder order=”0x3200″></sysprepOrder>
    • <sysprepOrder order=”0x3300″></sysprepOrder>
  5. Save the edited copy of Generalize.xml and close the file.
  6. Open a command prompt as administrator
  7. Run the following command to take ownership of the Generalize.xml file in system32 folder: Takeown /f C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml
  8. Run the following command to set appropriate permission on the file: Cacls C:\Windows\System32\ Sysprep\ActionFiles\Generalize.xml /G `<Administrator>`:F
    • Answer Yes at the prompt for confirmation.
    • Note that <AdministratorUserName> should be replaced by the username who is administrator on the machine. For example, “Administrator”.
  9. Copy the file you edited and saved over to the Sysprep directory using the following command: xcopy C:\Generalize.xml C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml
    • Answer Yes to overwrite (note that if there is no prompt to overwrite, double check the path entered).
    • Assumes your edited copy of Generalize.xml was copied to C:\ .
  10. Generalize.xml is now updated with the workaround. Please run Sysprep with the generalize option enabled.

 

Jun 052016
 

2012R2 Hyper-V Hotfixes Info

The bulk of my work these days involves engineering and architecture around the 2012R2 Hyper-V platform.  We support hundreds of Hypervisors so I have seen my fair share of Hyper-V issues.  I’ve worked with Microsoft through many Hyper-V Sev-A / Sev-B cases, and even had Microsoft on site to troubleshoot several complex issues.  Through all that I have compiled a list of 26 2012R2 Hyper-V hotfixes that I am presently proactively applying to all new Hyps and retroactively applying to existing ones.  If you’re like me then throughout your Windows career you’ve only applied hotfixes when a problem presented itself that a hotfix specifically addressed.  For me, this is the exception.  I’ve seen this set of hotfixes solve a myriad of Hyper-V issues and prevent those issues from occurring on newly deployed Hyps.

Below you will find:

  • Links to Microsoft articles which outline all available 2012R2 Hyper-V hotfixes
  • My recommended list of mandatory 2012R2 Hyper-V hotfixes with links to each hotfix
  • I have pre-packaged my custom hotfix set into a .zip for your download convenience – you may alternatively visit the links below and download each hotfix individually
  • Powershell script to test for and automatically install the set of 2012R2 Hyper-V hotfixes

As with all things patching and hotfix related you are hereby cautioned to research each hotfix, it’s prerequisites, purpose, and potential impact on your environment.  Test this in your lab before rolling to production, then test some more.  It’s a good idea to be at the latest windows patch level on the Hyp prior to installing the hotfixes.  In my experience I have utilized the script below to apply the complete set to hundreds of Hyps with zero issues.  If a hotfix doesn’t apply (many won’t – for example – standalone [non-clustered] Hyps) the script simply carries on to the next hotfix.  Only those that are applicable to your Hyp will be applied.  Test!  I hope these improve your environment as much as they have mine.

2012R2 Hyper-V Hotfix Links

All relevant links for Hyper-V hotfixes are listed below in order of importance.  You can find title, purpose, and download links referenced in these articles.  If you support a Hyper-V environment I recommend you become very familiar with these articles and check back from time to time as they are updated.

My recommended 26 2012R2 Hyper-V Hotfixes

KB3093899= VMs that run on CSVs fail if DCM can't query volumes in Windows Server 2012 R2
KB3091057 = Cluster validation fails in the Validate Simultaneous Failover test in a Windows Server 2012 R2-based failover cluster
KB3076953 = Cluster services go offline when there's a connectivity issue in Windows Server 2012 R2 or Windows Server 2012
KB3068445 = Virtual machines that host on Windows Server 2012 R2 may crash or restart unexpectedly
KB3068444 = An unrecoverable failure occurred inside the filter manager error on a failover cluster node that hosts shared VHDx files
KB3090343 = Cluster service stops during the VSS backup in a Windows Server 2012 R2-based Hyper-V cluster
KB3060678 = Snapshots are not deleted after you perform a backup operation by using VSS in Windows Server
KB3063283 = Update to improve the backup of Hyper-V Integrated components in Hyper-V Server 2012 R2
KB3130944 = March 2016 update for Windows Server 2012 R2 clusters to fix several issues
KB3139896 = Hyper-V guest may freeze when it is running failover cluster service together with shared VHDX in Windows Server 2012 R2
KB3130939 = Nonpaged pool memory leak occurs in a Windows Server 2012 R2-based failover cluster
KB3141074 = 0x00000001 Stop error when a shared VHDX file is accessed in Windows Server 2012 R2-based Hyper-V guest
KB3072380 = Hyper-V cluster unnecessarily recovers the virtual machine resources in Windows Server 2012 R2
KB3031598 = Hyper-V host crashes and has errors when you perform a VM live migration in Windows 8.1 and Windows Server 2012 R2
KB3095308 = VMs may not get additional memory although they're set to use Dynamic Memory in Windows Server 2012 R2
KB3027108 = 0x0000003B or 0x0000007E Stop error on a Windows-based computer that has 4K sector disks
KB3037313 = Old files are not removed after a migration of virtual machine storage in Windows 8.1 or Windows Server 2012 R2
KB3025091 = Shared Hyper-V virtual disk is inaccessible when it's located in Storage Spaces on a Windows Server 2012 R2-based computer
KB3018489 = No host bus adapter is present error when querying SAS cable issues in Windows Server 2012 R2 or Windows Server 2012
KB3046826 = You cannot upgrade Hyper-V integration components or back up Windows virtual machines
KB3020717 = VMMS crashes when you perform live migration and request VM information at the same time in Windows Server 2012 R2
KB3044457 = STATUS_PURGE_FAILED error when you perform VM replications by using SCVMM in Windows Server 2012 R2
KB3036173 = 0x00000050 Stop error when Hyper-V host crashes in Windows Server 2012 R2
KB3049443 = Live migration of virtual machine to another host fails on a Windows Server 2012 R2-based Hyper-V host server
KB3102354 = Hyper-V generation 2 virtual machines can't start with some pass-through disks in Windows Server 2012 R2
KB3137691 = LBFO Dynamic Teaming mode may drop packets in Windows Server 2012 R2


2012R2 Hyper-V Hotfixes .zip download

The linked zip file below contains the 26 hotifxes identified above.  If you utilize this zip then the script below will be able to automatically apply all required hotfixes to your Hyper-V server.

2012R2 Hyper-V Hotfixes ZIP download

Powershell Test-Hotfixes / Install-Hotfixes

In the GitHub link below you will find hotfixes.ps1 which will test to see if the 26 hotfixes are applied on your Hyper-V server.  Keep in mind that not all hotfixes are applicable to all configurations, and that some of the hotfixes are available via Windows Updates.  Install-Hotfixes will attempt to install each hotfix on your Hyper-V server.  Any hotfix that is not applicable is ignored and the script will move on to the next hotfix.

It is unlikely that all 26 will be required on your server so if Test-Hotfixes still shows a few missing after you attempt install, this is perfectly fine.

https://github.com/techthoughts2/2012R2HyperVHotfixes

 

Feb 282016
 

What is the PowerShell Gallery?

Microsoft states:

The PowerShell Gallery is the central repository for PowerShell content. You can find new PowerShell commands or Desired State Configuration (DSC) resources in the Gallery.

Wait a second, doesn’t that sound a lot like the Microsoft Script Center?  Yes, it does.  The two both serve as a searchable repository for scripts and modules around the PowerShell scripting language.  The PowerShell Gallery offers up some distinctly different capabilities however.  For one, all scripts and modules are interacted with through, you guessed it, the PowerShell console.  While you can search the web-based gallery all other actions: downloading, installing, and publishing of PowerShell scripts and modules are handled from within PowerShell.  The Microsoft Script Center’s web-centric platform remains an excellent resource for System Administrator Scripters and other IT professionals.  The PowerShell gallery just has a much more devops(y) feel and, to date, has a repository base that more reflects that line of work.

There’s likely to be some cross-over between the two as the PowerShell Gallery matures and the Script Center will likely be with us for some time.  The PowerShell Gallery’s ability to rapidly search for, install, and easily update (something Script Center wasn’t great at) scripts and modules will likely make it the repository of choice moving forward though.

PowerShell Gallery Setup 101

All that’s required is the PowerShellGet module and NuGet provider (package manger)

Continue reading »

Feb 102016
 

What is a Hyper-V VM BIN file?

The .bin file is a Hyper-V VM associated file located inside the GUID folder of a VM.

If a VM’s AutomaticStopAction is set to: Save the virtual machine state then Hyper-V will reserve disk space equal to the amount of memory used by the virtual machine when it is running so that memory can be written to disk when the physical computer shuts down. If the VM is powered off, there will be no BIN file present, even if the VM is set to save.

Hyper-V Automatic Stop Action Settings

Hyper-V Automatic Stop Action Settings

How does the AutomaticStopAction setting affect available disk space?

The file acts as reserve point on the disk for the memory of a VM and can be located inside the GUID folder mentioned above.

The example below shows the VMs GUID location for a VM that was created with 8GB of RAM.  Because the VM’s AutomaticStopAction is set to save the virtual machine state approximately 8GB of hard drive space is reserved.

Hyper-V .bin file for a VM with 8GB of RAM

Hyper-V .bin file

Continue reading »

Dec 062015
 

Introducing Diag-V, a Powershell Hyper-V Diagnostic Utility

Diag-V is a PowerShell based script that contains a collection of various Hyper-V diagnostics. It presents the user a simple choice menu that allows the user to select and execute the desired diagnostic.

Where can I download Diag-V?

Download Diag-V from Technet via the link below:

https://gallery.technet.microsoft.com/scriptcenter/Diag-V-A-Hyper-V-0fe983e4

I want to contribute to Diag-V

Great! If you find a bug or think a diagnostic should be added you can see the code and contribute via Git at the link below:

https://github.com/techthoughts2/Diag-V

How do I use Diag-V?

Take a look at this short video demo or visit the technet/git links above for a detailed how-to breakdown.

Diag-V - A Hyper-V Diagnostic - Main Menu

Diag-V Main Menu

What diagnostics can Diag-V perform?

Continue reading »

Dec 042015
 

Using PowerShell to perform a Hyper-V resource allocation check

This Powershell script determines the current resource allocation health of a Hyper-V server or nodes in a Hyper-V Cluster.  The script will automatically scan the physical resources of each Hyper-V node and then compare that to the resources allocated to the Virtual Machines.  It will then pass/fail based on the following criteria:

1:1 Memory – anything higher fails

*This is for static memory only, see below for best practice suggestions regarding dynamic memory

4:1 CPU – anything higher fails

20% free storage space – anything lower fails

These ratios can be edited in the script to suit your desired cutoff points.

Here is a brief video that shows how to run and interpret the script:

The following is an example of the scripts output from a two-node Hyper-V Cluster.

Hyper-V Resource Allocation Check - Test-HyperVAllocation - Overprovisioning diagnostic for Hyper-V

Hyper-V Resource Allocation Check – Test-HyperVAllocation

Download / Review Hyper-V resource allocation check

Download the script from the TechNet Script Center here:

Hyper-V resource allocation check to determine if resources are overprovisioned

Continue reading »

Sep 192015
 

PowerShell Automation Script: Transfer all FSMO roles from one DC to another DC

If you prefer video over written format the corresponding video for this write-up can be viewed below:

I came across an excellent write-up the other day on vGeek:

Powershell – Domain Controller inventory and Transfering / moving FSMO roles between DC

This article highlighted two PowerShell commands that can be leveraged to Transfer all FSMO roles from one DC to another:

Get-ADDomainController

Move-ADDirectoryServerOperationMasterRole

Get-ADDomainController can be utilized to retrieve a list of present FSMO roles on a DC via the OperationMasterRoles Property:

Get-ADDomainController -Server dcName | `
    Select-Object -ExpandProperty OperationMasterRoles

Move-ADDirectoryServerOperationMasterRole can then be utilized to actually move the operations master roles to another Active Directory directory server (by name or by corresponding number):

 
Move-ADDirectoryServerOperationMasterRole -Identity ` 
    dcNameMovingTo –OperationMasterRole 0,1,2,3,4 ` 
    -Confirm:$false 

I wanted to take these two PowerShell commands further and automate the process of detecting present FSMO roles and automatically move them without having to manually specify each operations master role by name or number.

My goal for this PowerShell script was to detect existing FSMO roles on the DC you are running on, present a list of available DCs in the domain, and then let you move the FSMO roles to the DC you specify.

Continue reading »

Sep 152015
 

How To: Create New-VHD via PowerShell or GUI and attach to existing VM

If you prefer video over written format the corresponding video for this write-up can be viewed below:

Here is all the PowerShell code required for the creation of a new VHD.  The code below can be used to prompt for all needed settings to fully setup and configure a new .vhd/.vhdx and will attach it to the VM you specify.  This is a fully functional script that could be easily modified to automate a wide range of tasks involving the creation of additional .vhd(s)/.vhdx(s).  A full write-up with examples for the GUI can also be found below.

Continue reading »

Sep 132015
 

If you prefer video over written format the corresponding video for this write-up can be viewed below:

Here is all the PowerShell code required for the creation of a new Hyper-V VM.  The code below can be used to prompt for all needed settings to fully setup and configure a new Hyper-V VM.  This is a fully functional script that could be easily modified to spin up multiple VMs at once, or even import settings from a .csv or .txt file.  A full write-up with examples for the GUI can also be found below.

Continue reading »