LUN creation appears to fail even when LUNs are created successfully in Windows Server 2012 R2

Vrijedi za: Windows Server 2012 R2 DatacenterWindows Server 2012 R2 StandardWindows Server 2012 R2 Essentials

Symptoms


Assume that you have a storage area network (SAN) and a computer that's running Windows Server 2012 R2 and that has Microsoft System Center Virtual Machine Manager (SCVMM) 2012 R2 installed.

If you run a New-VirtualDisk cmdlet as a background job in a Windows PowerShell script to create multiple logical unit numbers (LUNs) on the SAN, a job that's generated by the cmdlet may fail. This behavior occurs even when the LUNs are created successfully. Additionally, the LUNs that are created by the failed job may not be recognized by SCVMM.

For example, by running a Get-Job cmdlet after you run the PowerShell script, you notice that some jobs failed: 

PS C:\test> get-job
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
621 CimJob223 CimJob Failed True SR1 New-VirtualDisk -Frien...
623 CimJob224 CimJob Failed True SR1 New-VirtualDisk -Frien...
625 CimJob225 CimJob Failed True SR1 New-VirtualDisk -Frien...
627 CimJob226 CimJob Completed True SR1 New-VirtualDisk -Frien...
629 CimJob227 CimJob Completed True SR1 New-VirtualDisk -Frien...
Note You can also see jobs in the Jobs view of SCVMM 2012 R2.

But if you check the LUN status, you see that the LUNs were created successfully: 

PS C:\test> Get-VirtualDisk
FriendlyName ResiliencySettingNa OperationalStatus HealthStatus IsManualAttach Size
------------ ------------------- ----------------- ------------ -------------- ----
Lun5 OK Healthy 10 GB
Lun8 OK Healthy 10 GB
Lun4 OK Healthy 10 GB
Lun6 OK Healthy 10 GB
Lun2 OK Healthy 10 GB

Resolution


To resolve this issue, install the hotfix that's described in Description of the security update for Update Rollup 5 for System Center 2012 R2 Virtual Machine Manager.

Note Installing the hotfix does not completely resolve this issue. It just reduces the frequency of the occurrences.

Workaround


To work around this issue, query the LUN list of the devices by using a Get-VirtualDisk PowerShell cmdlet or a Virtual Machine Manager (VMM) console to let SCVMM 2012 R2 recognize the LUNs again. For more information about the VMM console, see How to provision Storage Logical Units in VMM.