unset size parameter for lxc.create when backing=zfs

When using the lxc.create parameter backing=zfs the default 1G size parameter kicks in, which sadly makes the lxc-create call fail.

LXC backing store type zfs does not support setting the container storage size ATM.

This fixes this error message in the minion log:

2015-06-20 02:00:57,588 [salt.minion      ][ERROR   ][3694] A command in 'lxc.create' had a problem: Container could not be created with cmd 'lxc-create -n test-container -t download -B zfs --fssize 1G -- --release trusty --arch amd64 --dist ubuntu': filesystem type and size are only valid with block devices
This commit is contained in:
Borut Mrak 2015-06-20 02:19:14 +02:00 committed by rallytime
parent c32aae96aa
commit 1e4ec7a56b

View file

@ -1866,7 +1866,7 @@ def create(name,
lvname = select('lvname')
fstype = select('fstype')
size = select('size', '1G')
if backing in ('dir', 'overlayfs', 'btrfs'):
if backing in ('dir', 'overlayfs', 'btrfs', 'zfs'):
fstype = None
size = None
# some backends wont support some parameters