Advertisement
Guest User

Untitled

a guest
Jul 10th, 2018
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $fcAdapters = get-pnpdevice -PresentOnly | ? {$_.FriendlyName -match "Fibre" }
  2. $fcAdapters | % { Disable-PnpDevice -InstanceId $_.InstanceId -Confirm:$false }
  3. # Disable-PnpDevice : Generic failure
  4.  
  5. PS C:\Users\Administrator> get-winevent -ListLog '*'| % { Get-WinEvent -FilterHashtable @{LogName=$_.LogName;StartTime=(get-date).AddMinutes(-5);Level=3} -ErrorAction
  6. SilentlyContinue}  | ft -AutoSize -Wrap
  7. #    ProviderName: Microsoft-Windows-Kernel-PnP
  8.  
  9. # TimeCreated            Id LevelDisplayName Message
  10. # -----------            -- ---------------- -------
  11. # 7/10/2018 10:28:58 AM 225 Warning          The application \Device\HarddiskVolume1\Program Files\QLogic Corporation\QLRemote\qlremote.exe with process id 3220
  12. #                                            stopped the removal or ejection for the device PCI\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301f0&0&0110.
  13. # 7/10/2018 10:28:52 AM 225 Warning          The application \Device\HarddiskVolume1\Program Files\QLogic Corporation\QLRemote\qlremote.exe with process id 3220
  14. #                                            stopped the removal or ejection for the device PCI\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301f0&0&0010.
  15.  
  16. stop-service QLManagementAgentJava
  17.  
  18. get-vm | Get-VMFibreChannelHba | Remove-VMFibreChannelHba
  19. get-vmsan | remove-vmsan
  20.  
  21.  
  22. $fcAdapters = get-pnpdevice -PresentOnly | ? {$_.FriendlyName -match "Fibre" }
  23. $fcAdapters
  24. # Status     Class           FriendlyName                                                                     InstanceId
  25. # ------     -----           ------------                                                                     ----------
  26. # OK         SCSIAdapter     QLogic Fibre Channel Adapter                                                     PCI\VEN_1077...
  27. # OK         SCSIAdapter     QLogic Fibre Channel Adapter                                                     PCI\VEN_1077...
  28.  
  29.  
  30. $fcAdapters | % { Disable-PnpDevice -InstanceId $_.InstanceId -Confirm:$false }
  31. $fcAdapters = get-pnpdevice -PresentOnly | ? {$_.FriendlyName -match "Fibre" }
  32. $fcAdapters
  33.  
  34. Status     Class           FriendlyName                                                                     InstanceId
  35. ------     -----           ------------                                                                     ----------
  36. Error      SCSIAdapter     QLogic Fibre Channel Adapter                                                     PCI\VEN_1077...
  37. Error      SCSIAdapter     QLogic Fibre Channel Adapter                                                     PCI\VEN_1077...
  38.  
  39.  
  40. Get-VMHostAssignableDevice
  41.  
  42. $locationPath = ($fcAdapters[1] | Get-PnpDeviceProperty DEVPKEY_DEVICE_LOCATIONPATHS).Data[0]
  43. Dismount-VMHostAssignableDevice -LocationPath $locationPath -Force
  44. # Dismount-VMHostAssignableDevice : The operation failed.
  45. # The device cannot be assigned to a virtual machine as the firmware (BIOS or UEFI) on this host computer system indicates that the device must remain in contact with
  46. # the firmware running in the host.  The device can only be used in the management operating system.  You should contact your OEM to determine if a firmware upgrade is
  47. # available, or if the PCI Express device can be reconfigured to be independent of the host firmware.
  48.  
  49. wget https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/hyperv-samples/benarm-powershell/DDA/survey-dda.ps1 -Us
  50. eBasicParsing -OutFile survey-dda.ps1
  51. #
  52. # QLogic Fibre Channel Adapter
  53. # BIOS requires that this device remain attached to BIOS-owned memory.  Not assignable.
  54.  
  55.  
  56. # QLogic Fibre Channel Adapter
  57. # BIOS requires that this device remain attached to BIOS-owned memory.  Not assignable.
  58.  
  59. InstanceID   : PCIP\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301F0&0&0010
  60. LocationPath : PCIROOT(0)#PCI(0200)#PCI(0000)
  61. CimSession   : CimSession: .
  62. ComputerName : R05-U10-UCC
  63. IsDeleted    : False
  64.  
  65. InstanceID   : PCIP\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301F0&0&0110
  66. LocationPath : PCIROOT(0)#PCI(0200)#PCI(0001)
  67. CimSession   : CimSession: .
  68. ComputerName : R05-U10-UCC
  69. IsDeleted    : False
  70.  
  71. Add-VMAssignableDevice -VMName "instance-0000065f" -LocationPath "PCIROOT(0)#PCI(0200)#PCI(0000)"
  72. # Add-VMAssignableDevice : 'instance-0000065f' failed to add resources to 'instance-0000065f'.
  73. # Cannot perform the operation.
  74. # 'instance-0000065f' failed to add resources. (Virtual machine ID E83EF271-2872-45D9-A1B8-14F25D919B83)
  75. # Cannot add the device to 'instance-0000065f' as that virtual machine is configured to go to saved state on host
  76. # shutdown. (Virtual machine ID E83EF271-2872-45D9-A1B8-14F25D919B83)
  77.  
  78. set-vm "instance-0000065f" -AutomaticStopAction TurnOff
  79. Add-VMAssignableDevice -VMName "instance-0000065f" -LocationPath "PCIROOT(0)#PCI(0200)#PCI(0000)"
  80.  
  81. get-winevent -ListLog '*'| % { Get-WinEvent -FilterHashtable @{LogName=$_.LogName;StartTime=(get-date).AddMinutes(-5);Level=2} -ErrorAction SilentlyContinue}  | ft -AutoSize -Wrap
  82.  
  83. #    ProviderName: Application Error
  84.  
  85. # TimeCreated            Id LevelDisplayName Message
  86. # -----------            -- ---------------- -------
  87. # 7/10/2018 1:06:56 PM 1000 Error            Faulting application name: python.exe, version: 0.0.0.0, time stamp:
  88. #                                            0x5488ac1c
  89. #                                            Faulting module name: hbaapi.dll, version: 10.0.14393.0, time stamp:
  90. #                                            0x57898eff
  91. #                                            Exception code: 0xc0000005
  92. #                                            Fault offset: 0x0000cf2f
  93. #                                            Faulting process id: 0x1aec
  94. #                                            Faulting application start time: 0x01d4184eb82203ed
  95. #                                            Faulting application path: c:\python27\python.exe
  96. #                                            Faulting module path: C:\windows\SYSTEM32\hbaapi.dll
  97. #                                            Report Id: 607bf28f-3e71-4124-a51f-b502b029650f
  98. #                                            Faulting package full name:
  99. #                                            Faulting package-relative application ID:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement