Commit 1e1bb42a by Serge Hallyn

add vg and zfsroot options to lxc.functions and use in lxc-create

also make sure to drop spaces between = and variable in lxc.conf Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 31a95fec
...@@ -134,7 +134,8 @@ optarg_check() { ...@@ -134,7 +134,8 @@ optarg_check() {
backingstore=_unset backingstore=_unset
fstype=ext4 fstype=ext4
fssize=500M fssize=500M
vgname=lxc vgname=$lxc_vg
zfsroot=$lxc_zfsroot
custom_rootfs="" custom_rootfs=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
......
...@@ -34,4 +34,24 @@ get_default_lxcpath() { ...@@ -34,4 +34,24 @@ get_default_lxcpath() {
fi fi
} }
get_default_vg() {
LXC_VG=$(grep -v "^#" "$globalconf" 2>/dev/null | grep "[ \t]*lvm_vg[ \t]*=") || true
if [ -n "$LXC_VG" ]; then
echo $LXC_VG | awk -F= '{ print $2 }'
else
echo "lxc"
fi
}
get_default_zfsroot() {
LXC_ZFSROOT=$(grep -v "^#" "$globalconf" 2>/dev/null | grep "[ \t]*zfsroot[ \t]*=") || true
if [ -n "$LXC_ZFSROOT" ]; then
echo $LXC_ZFSROOT | awk -F= '{ print $2 }'
else
echo "tank/lxc"
fi
}
lxc_path=`get_default_lxcpath` lxc_path=`get_default_lxcpath`
lxc_vg=`get_default_vg`
lxc_zfsroot=`get_default_zfsroot`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment