Hyper-V vHBA: Virtual Port Creation failed with a NPIV error
Posted in Windows Powershell, Windows Server | No Comment | 7,198 views | 02/03/2014 23:34
You have a Hyper-V Cluster and you use vHBA on your virtual machines?
TestVM: Virtual port (C003FF4CC9C5003D) creation failed with a NPIV error (Virtual machine ID 12BE2D01-D693-4488-AA5F-3715CBDA4F10)
Technet gives 2 reasons for that error as a possible cause:
Virtual Port creation failure because the WWPN is still in use because of:
· HBA failing to remove virtual port
· Host unresponsiveness
You can check documentation from here:
Only solution in that case is restarting your Hyper-V server or changing WWNN and WWPN addresses of virtual machine.
So I went a little bit deeper to see what may be the reason. Because I was not able to start my virtual machine.
Then I noticed something:
My Virtual Machine was off, but its virtual port was still active on server.
It worked like a charm! I was able to start my virtual machine again.
First, download Hyper-V vHBA PowerShell Module and put it into PowerShell Modules Directory.
You can query your inactive vHBA ports with following command:
If you want to query a remote Hyper-V server, use following command:
That will give you inactive ports as an output:
You can use following command to remove all inactive virtual ports:
Of course you can also remove inactive virtual ports on remote server:
After that you should be able to start your virtual machine.
You can also list your all virtual ports and their virtual machine information:
If you have a Hyper-V cluster, then you can use something like that:
That will remove all inactive virtual ports on cluster.
You should run this script on one of your Hyper-V host.
Tags: hyper-v vhba, npiv failed hyper-v, powershell remove virtual hba, remove inactive hba, virtual port failed
Leave a Reply