Jump to content


Recommended Posts

Cross Post from https://www.ccrossan.com/sccm/sccm-1511-driver-migration-fails/

While migrating drivers from SCCM 2012 to SCCM 1511, the migration can fail with the following error message:

Couldn't find the specified instance SMS_CategoryInstance.CategoryInstance_UniqueID='DriverCategories:

This occurs given the following scenario:

  1. A driver is added to SCCM
  2. A category is assigned to the driver
  3. The category is deleted from the driver
  4. The migration job attempts to migrate the driver to a new SCCM environment

Consider the following error message:

Couldn't find the specified instance SMS_CategoryInstance.CategoryInstance_UniqueID='DriverCategories:78266da1-ebac-4c12-b2c8-89451383b03e

An In-depth analysis shows that the driver category does not appear in the WMI Class SMS_CategoryInstance:

Get-WmiObject -Namespace $Namespace -Class SMS_CategoryInstance -Filter "CategoryInstance_UniqueID = 'DriverCategories:78266da1-ebac-4c12-b2c8-89451383b03e'"

Returns Null, but a SQL query indicates that the Category Instance still exists:
SELECT * FROM CI_CategoryInstances

WHERE CategoryInstance_UniqueID
LIKE ‘%78266da1-ebac-4c12-b2c8-89451383b03e%’

Returns the following:

CategoryInstanceID CategoryInstance_UniqueID CategoryTypeName DateLastModified SourceSite ParentCategoryInstanceID IsDeleted rowversion
16777602 DriverCategories:78266da1-ebac-4c12-b2c8-89451383b03e DriverCategories 2015-07-27 11:52:33.000 CM1 NULL 1 0x000000000A36B34D

Take note of the “IsDeleted” column – set to True

So, at this point, WMI reports that this category no longer exists; however the category is still in the SQL Database, though this is not the root of the problem.

Now consider the WMI Class SMS_CategoryInstanceMembership:
This class contains a correlation of Objects to CategoryIDs. This is not limited to Driver <-> Driver Category correlation.

The true bug seems to be that when a driver category is removed, the entry for that driver category in the SMS_CategoryInstanceMembership class is not removed. In order to fix this, and have a successful migration, we need to manually remove the CategoryInstanceMembership object for any drivers that were assigned a now deleted category.

to Fix:

  1. Fire Up SQL Server Management Studio
  2. Create a New Query, and select your Site Database
  3. For each failing driver entry (as seen in “C:\Program Files\Microsoft Configuration Manager\Logs\migmctrl.log”),
    1. Run the following SQL Query:
      SELECT * FROM CI_CategoryInstances
      WHERE CategoryInstance_UniqueID
      LIKE '%c6e9d9e3-1371-46ba-b7f1-bb46c5b6bc06%'
    2. Note the CategoryInstanceID (should be like 16777601)
    3. On your SCCM Server, from an administrative PowerShell run the following code to remove the association, substituting the CategoryInstanceID you discovered in step 3-2:
      Get-WmiObject -Namespace $Namespace -Class SMS_CategoryInstanceMembership -Filter "CategoryInstanceID = '16777601'" | Foreach-Object {
      Remove-WmiObject -InputObject $_
      }
  4. Repeat the above section for each unique CategoryInstance_UniqueID listed in the “C:\Program Files\Microsoft Configuration Manager\Logs\migmctrl.log” file.
  5. When complete, retry the migration, and examine for any additional missing CategoryInstance_UniqueID errors.
  • Like 1

Share this post


Link to post
Share on other sites


interesting, have you raised a bug on connect about it so Microsoft can fix it ?

Share this post


Link to post
Share on other sites

Not yet.

 

I haven't actually tried to reproduce the issue in a clean environment - this was discovered "in the wild" while migrating a customer's environment :wacko:

 

I'll try to reproduce the bug in a sandbox to see if it's consistent.

Share this post


Link to post
Share on other sites

I can confirm that this issue exists and the workaround works perfect.

 

Currently migrating from CM12 to 1511 and we did some cleanup of categories before starting the migration...

Did a somewhat ugly hack to find all ID's from the logfile...

$instanceIDs = @()
$logFilePath = "C:\Program Files\Microsoft Configuration Manager\Logs\migmctrl.log"
Get-Content -Path $logFilePath | ForEach-Object {

    $s = $_
    if ($s -like "*Couldn't find the specified instance SMS_CategoryInstance.CategoryInstance_UniqueID='DriverCategories:*") {
        $s = $s.Trim() + "'~~"
        $s = $s.Substring($s.IndexOf("CategoryInstance_UniqueID='DriverCategories:") +  45)
        $s = $s.Substring(0, $s.IndexOf("'"))
        $instanceIDs += $s
    }

}

$instanceIDs | Sort-Object -Unique

  • Like 1

Share this post


Link to post
Share on other sites

Just want to thank both crossan007 and riro for this solution!

 

Even though my log stated that a lot of drivers had failed to migrate, it was all due to just three old deleted categories.

 

And for any powershell/wmi noobs like me. I needed to change $Namespace to  the namespace of my sccm site, i.e: "ROOT\SMS\siteP01"

 

 

Share this post


Link to post
Share on other sites

I ran into this at a customer environment as well.  We ended up removing all Categories from the drivers that failed to migrate.  On the next migration attempt they migrated successfully.  We then added the valid Categories back in the new site.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...