Peer Discovery through Metadata
(Updated based on ML feedback, and to include proposed API)
When running a clustered service on Nova, typically each node needs to find its peers. In the physical world, this is typically done using multicast. On the cloud, we either can't or don't want to use multicast. The proposed feature would add new functionality to the metadata service to allow bootstrapping cross-instance discovery: instances could POST data to the metadata service that should be shared, and they can GET this data for any other instances in the same project as the current instance. I expect this data will likely be an IP address and port. The clustered service would then use this information to try to connect to suitable peers and start a full gossip protocol.
This can likely be done as an extension to: https:/
=======
Example API
POST http://
…
request / response as per https:/
…
A “shared” query parameter can also be passed. If the value is ‘project’ (?), the specified metadata keys passed will be made available to all other instances in the same (keystone) project. Other values are not currently supported and will therefore return a 4xx (?) error.
Note that because entries cannot be changed once set, the sharing on the entries also cannot be changed once set.
Instances can retrieve shared keys by requesting the shared.json (?) endpoint. The shared entries visible to the current instances (including any shared by the instance itself) are returned. For symmetry with the unshared case, the from_server_ prefix is included e.g.
JSON Response
[
{
"meta": {
},
"uuid": "d8e02d56-
},
{
"meta": {
},
"uuid": “12345678-
}
]
If no shared values are visible, an empty response is returned:
[
]
=======
Alternatives:
* Expose a per-instance keystone token, and thus make it easy for the instance to query the normal nova api endpoint. That's a good idea (and I'd love to see it implemented), but is a lot more complicated. It would also put the burden on the API user. This blueprint would solves the use case a lot more directly & quickly
* Automatically expose IP addresses of other instances in the project / security group etc. I like this (it was my first inclination), but there are security concerns about exposing information about other instances, even within a project. This BP is only useful if deployed, so we can't go that route.
Blueprint information
- Status:
- Started
- Approver:
- John Garbutt
- Priority:
- Undefined
- Drafter:
- justinsb
- Direction:
- Needs approval
- Assignee:
- justinsb
- Definition:
- Review
- Series goal:
- None
- Implementation:
- Started
- Milestone target:
- None
- Started by
- John Garbutt
- Completed by
Whiteboard
Might be worth redrafting to take account of the ML discussion. Can we just have a quick API example included, just so the documentation team can use this blueprint to do what they need to do. Also, just to copy the other endpoints of /user_data, /vendor_data, why not go for /peer_data? --johnthetubaguy
Gerrit topic: https:/
Addressed by: https:/
Support peer discovery through the metadata service
I'd like to sign off on this one, as well, before approved. I posted some initial feedback on the dev ML. --russellb
deferred from icehouse-3 to "next": http://
Removed from next, as next is now reserved for near misses from the last milestone --johnthetubaguy