We are setting up the virtual server smt
as a guest on teapot
.
It will store its SMT data (/srv/www/htdocs/
) in a directory in
teapot
which it will access via 9p
sharing.
We have set up teapot
using the Virtual Machine Host pattern, so we
already have br0
.
In /etc/qemu/bridge.conf
add the line
allow br0
Create image file:
qemu-img create /i/smt-vm/smt.img 16G
Install:
virt-install --name smt --disk /i/smt-vm/smt.img --memory 4096 \
--location /ext1/isos/suse/sles/12/sp1/SLE-12-SP1-Server-DVD-x86_64-GM-DVD1.iso \
--boot cdrom
Edit the virtual machine’s description with virsh edit smt
, and
inside <devices>..</devices>
:
<filesystem type='mount' accessmode='passthrough'>
<source dir='/ext1/smtdata'/>
<target dir='smtdata'/>
</filesystem>
Add to /etc/fstab
on smt
:
smtdata /srv/www/htdocs 9p rw,trans=virtio,version=9p2000.L,posixacl,access=client 0 0
Create user smt
on teapot
with the same uid as on smt
.
First rsync
/srv/www/htdocs/
to /ext1/smtdata/
on teapot
.
Then do a mount -a
on smt
.
On teapot
: bind mounts for the stuff we are exporting by NFS — add
to /etc/fstab
:
/ext1/smtdata/repo/ /nfs/repo none bind 0 0
Exporting over NFS:
Add to /etc/exports
on teapot
:
/nfs *(fsid=0,ro,all_squash,sync,no_subtree_check)
/nfs/repo/ *(ro,all_squash,no_subtree_check)
For automounting on gryphon
:
In /etc/auto.master
add the line:
/- /etc/auto.smt --timeout=60
Add the file /etc/auto.smt
with contents:
/smt -fstype=nfs,ro teapot:/repo