Following are the steps to create NPIV port on an adapter (only tested with Brocade HBAs) on a host with VMware vSphere ESX/ESXi hypervisor:
- Generate NPIV port(s) WWNs for VM
- Use the generated NPIV port WWN, the physical port WWN and the storage port WWN in one Zone (don’t put any other WWNs in the zone). There could be other zones in the final active zone config but the zone which is to let the vSphere create NPIV port should only have those 3 WWNs (physical port, NPIV port and storage port)
- Note: It is important to note that for RDM access through NPIV port to work we also need to have the base port in the zone. We cannot remove the base port from the zone after the NPIV port is created. Doing so results in making the RDM disk inaccessible.
- Confirm that the SAN storage is visible in the Host > Configuration > Storage under Devices.
- Power off the VM.
- Add a hard disk to the VM (VM > Edit Settings > Add > Hard Disk). Choose the option “Raw Device Mappings” to create an RDM disk and select the SAN LUN. See this for step by step instructions on setting up an RDM disk for a VM.
- Now power ON the VM. When the VM is powered on at that time the hypervisor will know that there is an NPIV port generated for the VM and it could be used to see the same disk which is presented to the VM though a physical port currently. So it will create an NPIV port under the physical port and thus the RDM SAN disk will continue to be accessible from the NPIV port.
- To confirm if the NPIV port is really created, check through the SAN fabric manager if the fabric shows the new NPIV port WWN as logged in to the same fabric port as the physical port.
- Also you can run some traffic in the VM on the RDM disk and check the stats on the NPIV port if they show the usage of the NPIV port. The stats on the NPIV port can be checked from CLI or management client for the adapter.