unfsdがCentOS7用のがない、srpmからビルドも成功しないということで絶望していたが、NFS server inside container - OpenVZ Linux Containers Wikiの手順で出来た。
ホスト側の作業
コンテナを一度停止しないと有効になりません。
ホスト側にて実行
vzctl set $CONTAINERID --feature nfsd:on --save
もしくは直接記述
/etc/pve/openvz/374.conf
+ FEATURES="nfsd:on"
コンテナ側の作業
yum install nfs-utils
-
NFS server inside container - OpenVZ Linux Containers Wikiには
/etc/sysconfig/nfs
に追記するようにあったが、何も変更せずに行けました。
/etc/exports
/var/log/ 192.168.100.0/24(ro,no_subtree_check)
反映と確認
exportfs -rav
他のサーバからNFSマウントできることを確認
mount -t nfs コンテナのIP:/var/log /mnt/
nfsオプションを有効にしていると稼働中のバックアップできないっぽい
INFO: suspend vm
INFO: Setting up checkpoint...
INFO: suspend...
INFO: Can not suspend container: Invalid argument
INFO: Error: unsupported fs type nfsd
INFO: Checkpointing failed
ERROR: Backup of VM 318 failed - command 'vzctl --skiplock chkpnt 318 --suspend' failed: exit code 16
INFO: Backup job finished with errors
TASK ERROR: job errors