How do I access the WWNs via the transport field in a Fibre Channel path? #3317
Unanswered
ericwest-boston
asked this question in
Q&A
Replies: 1 comment 1 reply
-
for _, path := range lun.Path {
switch xport := path.Transport.(type) {
case *types.HostFibreChannelTargetTransport:
fmt.Printf("wwn=%d\n", xport.PortWorldWideName)
default:
fmt.Printf("type=%T\n", xport)
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
for _, lun := range hss.StorageDeviceInfo.MultipathInfo.Lun { for _, path := range lun.Path { fmt.Printf("FC Lun path xport: %v\n", path.Transport) }
Will print out:
FC Lun path xport: &{{{}} 2769714599750104683 2341872635149907563}
However, having tried more than a few approaches, I am unable to access the two WWN values
Interesting if using the VS Code debugger, in the debug window:
path.Transport github.com/vmware/govmomi/vim25/types.BaseHostTargetTransport(*github.com/vmware/govmomi/vim25/types.HostFibreChannelTargetTransport) *{HostTargetTransport: github.com/vmware/govmomi/vim25/types.HostTargetTransport {DynamicData: github.com/vmware/govmomi/v... data: *github.com/vmware/govmomi/vim25/types.HostFibreChannelTargetTransport {HostTargetTransport: github.com/vmware/govmomi/vim25/types.HostTargetTransport {DynamicData: github.com/vmware/govmomi/vim25/types.DynamicData {}}, PortWorldWideName: 27697145997501046... github.com/vmware/govmomi/vim25/types.HostFibreChannelTargetTransport {HostTargetTransport: github.com/vmware/govmomi/vim25/types.HostTargetTransport {DynamicData: github.com/vmware/govmomi/vim25/types.DynamicData {}}, PortWorldWideName: 276971459975010468... HostTargetTransport: github.com/vmware/govmomi/vim25/types.HostTargetTransport {DynamicData:github.com/vmware/govmomi/vim25/types.DynamicData {}} PortWorldWideName: 2769714599750104683 NodeWorldWideName: 2341872635149907563
...and I can access the WWNs directly in that console
path.Transport.NodeWorldWideName 2341872635149907563
So how do I do this programmatically? ex
fmt.Println(path.Transport.NodeWorldWideName)
Note too: VS Code claims NodeWorldWideName is not a field for Transport
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions