'Failed to insert OSD binaries into the WIM file' error when you create a MDT Task Sequence or MDT Boot Image in ConfigMgr 2012

Issue:
When you trying to create a boot image using MDT (or select the 'create a new boot image package' option in 'Create MDT Task Sequence' wizard) you get the following error:

Started processing.
Creating boot image.
Copying WIM file.
Mounting WIM file.
WIM file mounted.
Setting Windows PE system root.
Set Windows PE system root.
Set Windows PE scratch space.
Adding standard components.
Adding component: winpe-mdac
Adding extra content from: C:\Users\A637C~1.ZHU\AppData\Local\Temp\wmquafaq.hbp
Unmounting WIM.
Copying WIM to the package source directory.
Creating boot image package.
Error while importing Microsoft Deployment Toolkit Task Sequence.

Failed to insert OSD binaries into the WIM file

Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryException: The SMS Provider reported an error. ---> System.Management.ManagementException: Generic failure
   at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObject.Put(PutOptions options)
   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Put(ReportProgress progressReport)
   --- End of inner exception stack trace ---
   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Put(ReportProgress progressReport)
   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Put()
   at Microsoft.BDD.Wizards.SCCM_ImportTaskSequenceTask.DoWork(SmsPageData smspageData, Dictionary`2 data)

Resolution:

  1. You need to add a Read permission for a SYSTEM account to the file://siteserver/SMS_%3CSite-Code%3E/OSD/bin/ (both, share and NTFS permissions).
  2. Check also if you are trying to insert only network drivers. Remove all other Drivers from the "insert list".
  3. Check if there is enough space on SQL HDDs or LUNs.