Issue Type: | Bug |
---|---|
Priority: | 4 - Normal |
Status: | Open |
Created at: | 2018-02-15T23:44:56.267Z |
Updated at: | 2022-03-11T20:53:44.079Z |
Created by: | Michael Zeller |
---|---|
Reported by: | Michael Zeller |
Should the state of these NICs be set to "running"?
It appears the state field for a NIC in napi is set via net-agent and is tied to the overall state of the VM its associated with.
Its currently unclear what vmapi should be setting the final 'state' to.
After some investigation it appears that sdc-net-agent is being invoked and updating the state field to the state of the overall VM.
This is likely happening due to net-agent via zoneevents. I was able to confirm shutting a zone down resulted in the NIC's state being set to 'stopped' and that starting the zone resulted in the NIC's state being set to 'running'
This caused some discussion in chat, with the key takeaways being:
I'm also curious why we need to have nic states that match the VM state. I haven't been able (yet) to find a good explanation of why we do this. There doesn't seem to be an explanation in the NAPI docs. @accountid:624ba422247a4b0069202447 do you know? It looks like AGENT-741 added a "nic.status" field, that just matched the state field of the VM if the VM was running or stopped, but it doesn't indicate what was going to use that. Then AGENT-769 changed it to "nic.state" but doesn't explain why. The recent node-mooremachine based rewrite seems to have kept this, but it doesn't add any detail as to why we're doing it as far as I was able to tell.