nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.27k stars 132 forks source link

"ops volume create" allows reusing the same volume name which creates problems #1342

Open sanderssj opened 2 years ago

sanderssj commented 2 years ago

Running 'ops volume create' with the same name twice creates two volume files in ~/.ops/volumes with different UUIDs but the same volume name and follow-up commands on the volume name no longer work properly. For example 'ops volume delete' will not delete either volume but does not print an error and also returns 0 even though nothing was deleted, and trying to run a vm that uses the volume name fails with ambiguous volume uuid/label: volumename: multiple volumes found

Resolving the situation seems to require manually deleting one or both volumes from ~./ops/volumes. It might be useful to either prevent reuse of a volume name for the same provider to avoid the situation or else provide better feedback when commands fail on how to resolve the situation.