nanovms / ops

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

Onprem volumes: add support for virtual ID mounts #1545

Closed francescolavra closed 10 months ago

francescolavra commented 10 months ago

With this change, it is possible to specify a virtual ID in a mount directive for on-prem images, and then hot-plug a volume on a running instance by using the virtual ID in the ops volume attach command. Example configuration:

  "Mounts": {
    "%1": "/data1",
    "%2": "/data2"
  },
  "RunConfig": {
    "QMP": true
  }

After creating an image with ops image create and then an instance with ops instance create, a volume can be mounted in the "data1" directory with ops volume attach myInstance %1:myVolume, or in the "data2" directory with ops volume attach myInstance %2:myVolume.

It is still possible to not specify a virtual ID in the volume attach command, in which case the volume can only be mounted by using a mount directive that contains the volume identifier (UUID or label).