TritonDataCenter / sdc-napi

Triton Network API: manages networking-related data
Mozilla Public License 2.0
4 stars 14 forks source link

Cope with multiple networks on the same vlan_id + nic_tag #1

Closed arekinath closed 9 years ago

arekinath commented 9 years ago

When you have multiple networks that share the same vlan_id + nic_tag and you have a VM allocated on one of them that's found by a heartbeat request (ie, not created before the heartbeat comes in, for any of various reasons, including a VM that's been moved by vmadm send), currently you just get an error saying the NIC is invalid.

However, the code for this can happily check through the list of networks that match the vlan_id + nic_tag for one that contains the address on the NIC, and use that if one is found. This patch adds this functionality.

If we don't find one, then we return a new error that's a bit more specific than the previous one (no networks contained the ip/netmask).

arekinath commented 9 years ago

Merged as bf70f2608bc0ba222ec393be6ac04f9184eaf44c