nfs v3 test (by quqi99)

Posted quqi99

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nfs v3 test (by quqi99)相关的知识,希望对你有一定的参考价值。

作者:张华 发表于:2021-08-28
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明
(http://blog.csdn.net/quqi99 )

刚工作需要做了一个nfs v3的测试,记录一下。

# set up nfs v3 server
sudo apt-get install nfs-kernel-server -y
cat <<EOF | sudo tee -a /etc/exports
/nfs *(rw,sync,no_subtree_check)
EOF
sudo mkdir -p /nfs && sudo chown -R $USER /nfs/
sudo systemctl restart nfs-server

# set up nfs client
showmount -e node1
sudo mkdir -p /mnt/nfs && sudo chown -R $USER /mnt/nfs/
sudo mount -t nfs -o vers=3,proto=tcp,nolock node1:/nfs /mnt/nfs

# prepare backing file
mkdir -p /nfs/images && sudo cp -v /images/kvm/bionic.qcow2 /nfs/images/
chmod 777 /nfs/image/bionic.qcow2

# create two snapshots on the same backing file hosted in NFSv3 server
qemu-img create -f qcow2 -o backing_file=/mnt/nfs/image2/bionic.qcow2 /mnt/nfs/image2/bionic-snap.qcow2
chmod 777 /mnt/nfs/image2/bionic-snap.qcow2
qemu-img create -f qcow2 -o backing_file=/mnt/nfs/image2/bionic.qcow2 /mnt/nfs/image2/bionic-snap2.qcow2
chmod 777 /mnt/nfs/image2/bionic-snap2.qcow2

# create two test VMs with two snapshots

# run dd command on one VM, then restart another VM, but my both VMs run well so I didn't reproduce the problem.


do test with sparse file test with: dd if=/dev/zero of=flat2.img bs=1024k count=0 seek=2048

do test with non-sparse file test with: dd if=/dev/zero of=flat1.img bs=1024k count=1000

[1] https://sq.sf.163.com/blog/article/218146701477384192

以上是关于nfs v3 test (by quqi99)的主要内容,如果未能解决你的问题,请参考以下文章

Testing ovn manually based on LXD (by quqi99)

set up ovn based sr-iov test env (by quqi99)

set up ovn based sr-iov test env (by quqi99)

charm zaza functional test (by quqi99)

charm zaza functional test (by quqi99)

Testing ovn manually based on LXD (by quqi99)