Pardon if I'm rehashing an old thread. Got a customer who has adopted the position that WWPNs can never be randomly generated and must be deterministic.
I am automating several tasks for them in powershell and have come accross a problem trying to change the WWPN of a LIF. I get a warning message about the parameter being unavaliable for ONTAP 9.0 and newer.
Does any know of another automated method to change WWPN? I'd like to tell them it will have to be random, but can't unless it's basically impossible.
Yeah, I get the same error in my lab. Not sure why they decided to remove that particular functionality from the PSTK. In any case, you could use the Invoke-NcSsh cmdlet to run the native ONTAP CLI commands needed to change the WWPN. Something like this:
New-NcNetInterface -Vserver svm_test -Name lif_test -Role data -Dataprotocols fcp -Node labnode1 -Port 1a -AdministrativeStatus down
Invoke-NcSsh -Command "set -priv advanced;y;vserver fcp portname set -vserver svm_test -lif lif_test -wwpn 20:01:00:a0:98:00:af:01"
Set-NcNetInterface -Vserver svm_test -Name lif_test -AdministrativeStatus up
Of course, I'd probably want to flesh this out with some variables and and error-checking to make this easier to duplicate for different SVMs/ports/LIFs/etc. but the basics are there. 🙂
ZAPI also has the "net-interface-modify-iter" API call which includes the "WWPN" attribute, so you could likely make a native API call to handle this as well (using the Invoke-NcSystemApi command) if you'd rather not use SSH.