nanovms / ops

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

vSphere instance create: check for existence of image #1452

Closed francescolavra closed 1 year ago

francescolavra commented 1 year ago

With the VMWare vSphere provider, if an ops instance create command is issued with an invalid image name, the CreateVM() function fails with an "Invalid configuration for device '1'" error message, from which it's difficult to infer the root cause of the problem. This change adds a call to Stat() on the datastore in order to check that the image file from which an the instance disk is being created exists, and report that the image name is invalid if the file is not found. return appropriate error when image not found