What parts of NFS are not virtualized for today?
There are 2 possible ways of using NFS within VPS: 1. mount in host and bindmount to VPS 2. it is possible to be able to mount NFS from within VPS, but this requires 2-3 small patches. I had them somewhere for 2.6.8. They enable kernel_threads in VPS and do such similar things.
Ok, I have the desired NFS mounts mounted on the physical host and I want to "bind mount" them inside of a VPS. Er... how do I go about doing this? I read the OpenVZ User's Guide and I saw bind mount mentioned a few times but it wasn't really clear. HELP!
Suggested by Babyface on IRC: <Babyface> mount --bind /path /to/path <Babyface> for example <dowdle> That command is within the VPS? <Babyface> mount --bind /nfsroot /vz/root/<vpsid>/mnt <Babyface> no on hostnode <dowdle> Ok, cool. Thanks I'll try that now. <Babyface> and vps must be started before <Babyface> or mounted <Babyface> so better to create some kind of /etc/sysconfig/vz-scripts/<vpsid>.mount and .umount files <Babyface> then on vps startup it is automatically mounted <dowdle> Wow... that worked like instantly! Thanks very much. <dowdle> Ok, sure... about the mount and unmount scripts... as I want that to be automatic. So, if I create scripts with those names, they will be automati cally parsed upon VPS startup? <Babyface> yes <dowdle> Right on. <dowdle> Thanks Babyface! <-- ckoehn has quit ("7:42pm| (@DenisGe) ich schneid nie wieder samstags nachts 2 uhr haare alleine") <Babyface> mount file should look like <Babyface> #!/bin/bash <Babyface> # if one of these files does not exist then something is really broken <Babyface> [ -f "${VE_CONFFILE}" ] || exit 1 <Babyface> # mount nfsroot. <Babyface> mount --bind /nfsroot /vz/root/<vpsid>/mnt <Babyface> exit ${?} <Babyface> and must be executable <Babyface> umount like <Babyface> #!/bin/bash <Babyface> # if one of these files does not exist then something is really broken <Babyface> [ -f "${VE_CONFFILE}" ] || exit 1 <Babyface> # umount nfsroot. <Babyface> umount /vz/root/<vpsid>/mnt <Babyface> exit ${?} <Babyface> also executable
What about NFS servers? My application needs to simulate a cluster of NFSv4 servers for testing purposes. The kernel has support for NFSv4 servers but you need to turn on experimental drivers to see it.