TRITON-406: want clearer error message when a provision fails during DAPI server allocation

Details

Issue Type:Wishlist
Priority:4 - Normal
Status:Resolved
Created at:2016-04-22T18:22:43.000Z
Updated at:2020-04-16T18:46:30.888Z

People

Created by:Trent Mick [X]
Reported by:Trent Mick [X]
Assigned to:Todd Whiteman

Resolution

Fixed: A fix for this issue is checked into the tree and tested.
(Resolution Date: 2020-04-09T16:20:26.069Z)

Fix Versions

2020-04-23 Quone (Release Date: 2020-04-23)

Related Issues

Related Links

Description

With affinity rules (see placement.md, DOCKER-630) one can hit a placement failure:

$ docker --tls run --name db1 -e 'affinity:container!=db0' alpine hostname
docker: Error response from daemon: (DockerNoComputeResourcesError) No compute resources available. (cb792af0-08b4-11e6-9922-231469062e7b).
See 'docker run --help'.

when there are actually compute resources -- just not matching that affinity.
Three possibilities with that error:

We need to distinguish these cases to the user. Currently the only way to tell
is deep in the allocation "snapshot" in the CNAPI logs.

Implementation:
The CNAPI "SelectServer" endpoint here needs to grow error codes to
differentiate, then that error code needs to make it into the provision
workflow, where VMAPI or cloudapi can get it for VMAPI GetVm or cloudapi
GetMachine (not sure which would be best yet).

See also PUBAPI-1288 for similar issues with clear VM creation errors via cloudapi.

Comments

Comment by Trent Mick [X]
Created at 2018-05-08T19:26:58.059Z

I'm not reasonably going to find time to do work on this anytime soon, so unassigning in case someone wants to pick this up.


Comment by Jira Bot
Created at 2020-04-09T15:55:08.931Z

sdc-cnapi commit b39d857ff32a6bc07c72b23220a91dd8e0f21f5a (branch master, by Todd Whiteman)

TRITON-406 want clearer error message when a provision fails during DAPI server allocation (#34)


Comment by Jira Bot
Created at 2020-04-09T15:55:32.542Z

sdc-docker commit 2afce87f50bc0b0abbbadfa2a0f1f8276a56b906 (branch master, by Todd Whiteman)

TRITON-406 want clearer error message when a provision fails during DAPI server allocation (#149)


Comment by Todd Whiteman
Created at 2020-04-09T16:20:26.086Z

Examples:

$ docker run -d -e 'affinity:container==missing' busybox sh -c 'sleep 86400'
docker: Error response from daemon: (NoAllocatableServersError) problem creating container: No compute resources available: no active containers found matching "missing" for affinity "container==missing" (55f05740-9fa6-4250-ba7a-9994b7bc4c18).

$ triton create base-64 sample-256M-traits-different
triton instance create: error: error creating instance: No compute resources available: no servers with correct traits

# sdc-vmapi /vms -X POST -d@no_cpu_cap.json
{
  "code": "NoAllocatableServersError",
  "message": "No compute resources available: no servers which have same existence of cpu_cap as package"
}

Comment by Jira Bot
Created at 2020-04-16T18:46:30.888Z

sdc-docker commit cfab8df0c9b3ad08dda634d5027c656a91b74ec5 (branch master, by Todd Whiteman)

TRITON-406 update docs and tests for affinity failures (#150)