API should return immediately when calling server create
Currently if a user attempts to create a lot of instances with a single API call (using min_count) the request will hang for a long time while all RPC calls are completed. For a large number of instances this can take a very long time. The API should return immediately and asynchronously make RPC calls.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Vish Ishaya
Whiteboard
Nova actually does this now, so I think we can consider this obsolete. The job idea is great and something I want to put in a future nova api. --Vish
I completely agree here. For Horizon this is a real problem - not having a fully asynchronous option at the API level in Nova creates a bad user experience.
The simplest solution would be to have an option to return fast and not wait for the RPC to actually complete.
If Nova isn't able to support this, then we will end up having to solve this in Horizon in very complicated ways. Curious to hear others' thoughts on this and if there's a simpler solution we haven't yet considered?
-----
I think this is bigger than this one operation. We should consider adding something like a Job entity to the system. A URL to this entity can then be returned on ANY operation that can not complete quickly. The client can then poll this entity to find out when its done, its affected entities and any error messages (or warnings) associated with the operation.
Doing this for just one operation means that we run the risk of someone defining a different mechanism for other operations or other parts of OS - we should propose this as a common
feature/solution.
So, my preferred solution would be:
- Define a Job resource
- Allow for a 202+URI to Job as an http header to be returned on any operation