Enable using btrfs as a backend

Enable the usage of btrfs backend. Nothing is done except not using
lxd init as it only supports zfs and dir.

Change-Id: Ic6390e457b80a5d38957c182f270fc9f9d52a60f
This commit is contained in:
ArchiFleKs 2017-04-10 12:45:51 +02:00 committed by Kevin Lefevre
parent 863da4bce1
commit d76d4cdc8f
2 changed files with 18 additions and 1 deletions

View File

@ -534,12 +534,16 @@ nova_compute_powervm_pip_packages:
lxd_bind_address: 0.0.0.0
lxd_bind_port: 8443
# Supported backends are 'zfs', 'dir' and 'btrfs' for now.
# To use btrfs, a btrfs filesystem must be mounted in /var/lib/lxd
# during compute node configuration.
lxd_storage_backend: dir
# This needs to be set in the user_secrets.yml file.
#lxd_trust_password:
# This variable should be used with lxd when using a
# storage backend that utilizes storage pools
# storage backend that utilizes storage pools (zfs)
#lxd_storage_pool:
# PCI devices passthrough to nova

View File

@ -1,6 +1,8 @@
#!/bin/bash
# {{ ansible_managed }}
{% if (lxd_storage_backend == "zfs" or lxd_storage_backend == "dir") %}
# This is a script to configure lxd system settings.
# "/usr/bin/lxd init"
@ -13,3 +15,14 @@
--storage-pool={{ lxd_storage_pool }} \
{% endif %}
--trust-password={{ lxd_trust_password }}
{% elif (lxd_storage_backend == "btrfs") %}
# Check if filesystem if mounted as btrfs.
# If not nothing happens and storage will still be set to dir by default
if [ $(findmnt /var/lib/lxd -o FSTYPE -n) == "btrfs" ]; then
systemctl restart lxd
fi
{% endif %}