hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
828 stars 129 forks source link

suppor nfs volume #417

Closed bergwolf closed 7 years ago

bergwolf commented 7 years ago

VolumeDescription.Source is <server>:/<export>, and VolumeDescription.Format is nas and VolumeDescription.Fstype should be nfs. The volume is passed to hyperstart for further handling.

Works with hyperstart change (https://github.com/hyperhq/hyperstart/pull/252).

nfs volume podfile example:

{
  "resource": {
    "vcpu": 1,
    "memory": 1024
  },
  "containers": [{
      "image": "bergwolf/ubuntu-fio",
      "volumes": [{
        "volume": "sharevolume",
        "path": "/export",
        "readOnly": false
      }]
  }],
  "volumes": [{
    "name": "sharevolume",
    "source": "192.168.80.72:/home/bergwolf",
    "format": "nas",
    "fstype": "nfs"
  }]
}

Test results:

[hypervsock@~]$sudo hyperctl run -d -p ubuntu.pod
POD id is pod-VVnZwkkoZp
Time to run a POD is 7733 ms
[hypervsock@~]$sudo hyperctl exec -t pod-VVnZwkkoZp bash
root@pod-VVnZwkkoZp:/# df
Filesystem                   1K-blocks      Used Available Use% Mounted on
/dev/sda                     104805376    298180 104507196   1% /
devtmpfs                         23808         0     23808   0% /dev
tmpfs                            26940         0     26940   0% /dev/shm
rootfs                           23808     16044      7764  68% /lib/modules/4.4.28-hyper
192.168.80.72:/home/bergwolf 410056704 108126208 301930496  27% /export
gao-feng commented 7 years ago

LGTM