domu_off_nfs
I followed the following guide:
https://help.ubuntu.com/community/SettingUpNFSHowTo
Make sure to add the exports to your fstab to make things easier.
Here are my exports parameters:
lbathen@NomadNFS:~$ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/export 10.0.0.0/24(rw,fsid=0,insecure,no_subtree_check,async)
/export/share 10.0.0.0/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
Note the no_root_squash option, this allows us to run xen and xen can read/write to the share.
I then created an empty disk in the share:
# dd if=/dev/zero of=domu_1.img bs=1M seek=10000 count=1
Create the filesystem. Here we're specifying that the filesystem be created with indexing and journaling turned on.
# mke2fs -j -O dir_index domu_1.img
Here is my suse_1 install configuration:
----------------------------------------------------
# Xen configuration for installing an openSuSE domU
#
# Kernel + memory size
kernel = '/var/lib/xen/images/vmlinuz-xen'
ramdisk = '/var/lib/xen/images/initrd-xen'
memory = 1024
name = 'suse_d1'
vcpus = 1
# VNC virtual display
vfb = [ 'type=vnc' ]
# Disk device(s).
root = '/dev/xvda1'
disk = [
# lvm: 'phy:/dev/cybernaut-vg/domu_2,xvda,w',
'file:/var/lib/libvirt/images/domu_1.img,xvda,w',
'file:/var/lib/xen/images/openSUSE-13.1-NET-x86_64.iso,xvdb,r'
]
# Networking
vif = [ 'bridge=xenbr0, mac=A6:62:9A:E1:2C' ]
# Behaviour
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
----------------------------------------------------
Here is my post-install configuration
lbathen@cybernaut-2:~/domu$ cat suse_1.cfg
--------------------------------------------------
# Xen configuration for installing an openSuSE domU
#
# Kernel + memory size
kernel = '/var/lib/libvirt/images/vmlinuz-3.11.6-4-xen'
ramdisk = '/var/lib/libvirt/images/initrd-3.11.6-4-xen'
memory = 1024
name = 'suse_d1'
vcpus = 1
# VNC virtual display
vfb = [ 'type=vnc' ]
# Disk device(s).
root = '/dev/xvda2'
disk = [
# lvm: 'phy:/dev/cybernaut-vg/domu_2,xvda,w',
'file:/var/lib/libvirt/images/domu_1.img,xvda,w'
# 'file:/var/lib/xen/images/openSUSE-13.1-NET-x86_64.iso,xvdb,r'
]
# Networking
vif = [ 'bridge=xenbr0, mac=A6:62:9A:E1:2C' ]
# Behaviour
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
--------------------------------------------------
Note the 'file:/var/lib/libvirt/images/domu_1.img,xvda,w', this is important as we are booting off the network share.
Make sure fstab files have been udpated on the host and client:
lbathen@NomadNFS:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=081dd013-4622-44f9-a0fb-e868083b0ff6 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=e3c6dc53-07bc-4ae8-b32a-71c06f6684fb none swap sw 0 0
/home/lbathen/share /export/share none bind 0 0
lbathen@cybernaut-2:~/domu$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/mapper/cybernaut--2--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=2145510f-d022-4ac7-a966-eb80a2e9963a /boot ext2 defaults 0 2
/dev/mapper/cybernaut--2--vg-swap_1 none swap sw 0 0
10.0.0.113:/export/share /var/lib/libvirt/images nfs rw,hard,intr 0 0