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:
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:
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...
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