mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 13:47:41 +00:00
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: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
31a95fecd2
commit
1e1bb42a8f
@ -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() {
|
|||||||
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`
|
||||||
|
Loading…
Reference in New Issue
Block a user