Device ID for SONiC VS

51 views
Skip to first unread message

Pantelis Malekas

unread,
Jun 11, 2024, 6:41:08 AMJun 11
to sonicproject
Hello everyone, I am new to SONiC and I would like some assistance regarding some config related operations. 

I have used the following repo: https://github.com/sonic-net/sonic-buildimage to create a custom SONiC Virtual Switch image. I have used the flag `INCLUDE_P4RT = y` so I may have a P4 runtime container.

I have deployed this VS using GNS3 and I am able to connect to the switch and the P4RT gRPC port with the P4 runtime shell with: `python3 -m p4runtime_sh --grpc-addr <Switch-IP>:9559`. 

However when I connect I am receiving the following error:
`CRITICAL:root:P4Runtime RPC error (FAILED_PRECONDITION): Switch does not have a Device ID. Has a config been pushed?`

I understand that the P4 runtime shell needs the Device ID to complete the connection, but it has not been set. Can someone assist me with this issue? How am I supposed to set the Device ID and push the config in question? Can this operation be performed by GNS3? I can't see any related option in the sonic-buildimage repo. 

Any assistance would be greatly appreciated.

Best regards,
Pantelis

Reply all
Reply to author
Forward
0 new messages