vmware / vic

vSphere Integrated Containers Engine is a container runtime for vSphere.
http://vmware.github.io/vic
Other
640 stars 182 forks source link

Support concurrent creation of volumes (vmdks) #7929

Open hickeng opened 6 years ago

hickeng commented 6 years ago

Story As a user of VIC I expect to be able to concurrently create containers that use volumes

Details There are two primary issues that are causing undue serialization of volume creation currently: a. a lock in the volume cache b. disk attach/detach reconfigure operations

(a) causes strict serialization and should simply be removed in favour of a singleflight call or similar. (b) causes partial serialization, but the latency can be high enough that its effect is close to full serialization - this can be addressed with batching logic (see #7895)

The state seen by callers of the API should remain consistent, i.e. list should not show a volume that cannot be used or deleted, and only one create for a volume with a given name should succeed.

This impact concurrent container creation performance when anonymous volumes are part of the container specification.

Acceptance

zjs commented 5 years ago

Outstanding question: what should docker volume ls show during creation?

hickeng commented 5 years ago

what should docker volume ls show during creation?

Yeah, that's the difficult case. The other operations are easy - they block when addressing that specific volume that's in creating.

Any option I considered has to potential to confuse clients as there's no "state" recorded for volumes.

My WIP thoughts are to include it in the list, but block on any use (including delete/inspect) if it's not fully created.