diff --git a/ansible/group_vars/all/compute b/ansible/group_vars/all/compute index f5f5073d3..b27548a71 100644 --- a/ansible/group_vars/all/compute +++ b/ansible/group_vars/all/compute @@ -76,13 +76,19 @@ compute_lvm_groups: "{{ compute_lvm_groups_default + compute_lvm_groups_extra }} # Default list of compute volume groups. See mrlesmithjr.manage-lvm role for # format. -compute_lvm_groups_default: - - "{{ compute_lvm_group_data }}" +compute_lvm_groups_default: "{{ [compute_lvm_group_data] if compute_lvm_group_data_enabled | bool else [] }}" # Additional list of compute volume groups. See mrlesmithjr.manage-lvm role # for format. compute_lvm_groups_extra: [] +# Whether a 'data' LVM volume group should exist on compute hosts. By default +# this contains a 'docker-volumes' logical volume for Docker volume storage. It +# will also be used for Docker container and image storage if +# 'docker_storage_driver' is set to 'devicemapper'. Default is true if +# 'docker_storage_driver' is set to 'devicemapper', or false otherwise. +compute_lvm_group_data_enabled: "{{ docker_storage_driver == 'devicemapper' }}" + # Compute LVM volume group for data. See mrlesmithjr.manage-lvm role for # format. compute_lvm_group_data: diff --git a/ansible/group_vars/all/controllers b/ansible/group_vars/all/controllers index 58ec88172..1dbb8c0e9 100644 --- a/ansible/group_vars/all/controllers +++ b/ansible/group_vars/all/controllers @@ -87,13 +87,19 @@ controller_lvm_groups: "{{ controller_lvm_groups_default + controller_lvm_groups # Default list of controller volume groups. See mrlesmithjr.manage-lvm role for # format. -controller_lvm_groups_default: - - "{{ controller_lvm_group_data }}" +controller_lvm_groups_default: "{{ [controller_lvm_group_data] if controller_lvm_group_data_enabled | bool else [] }}" # Additional list of controller volume groups. See mrlesmithjr.manage-lvm role # for format. controller_lvm_groups_extra: [] +# Whether a 'data' LVM volume group should exist on controller hosts. By +# default this contains a 'docker-volumes' logical volume for Docker volume +# storage. It will also be used for Docker container and image storage if +# 'docker_storage_driver' is set to 'devicemapper'. Default is true if +# 'docker_storage_driver' is set to 'devicemapper', or false otherwise. +controller_lvm_group_data_enabled: "{{ docker_storage_driver == 'devicemapper' }}" + # Controller LVM volume group for data. See mrlesmithjr.manage-lvm role for # format. controller_lvm_group_data: diff --git a/ansible/group_vars/all/seed b/ansible/group_vars/all/seed index 45faf19b0..c4cd6c274 100644 --- a/ansible/group_vars/all/seed +++ b/ansible/group_vars/all/seed @@ -43,13 +43,19 @@ seed_lvm_groups: "{{ seed_lvm_groups_default + seed_lvm_groups_extra }}" # Default list of seed volume groups. See mrlesmithjr.manage-lvm role for # format. -seed_lvm_groups_default: - - "{{ seed_lvm_group_data }}" +seed_lvm_groups_default: "{{ [seed_lvm_group_data] if seed_lvm_group_data_enabled | bool else [] }}" # Additional list of seed volume groups. See mrlesmithjr.manage-lvm role for # format. seed_lvm_groups_extra: [] +# Whether a 'data' LVM volume group should exist on the seed. By default this +# contains a 'docker-volumes' logical volume for Docker volume storage. It will +# also be used for Docker container and image storage if +# 'docker_storage_driver' is set to 'devicemapper'. Default is true if +# 'docker_storage_driver' is set to 'devicemapper', or false otherwise. +seed_lvm_group_data_enabled: "{{ docker_storage_driver == 'devicemapper' }}" + # Seed LVM volume group for data. See mrlesmithjr.manage-lvm role for format. seed_lvm_group_data: vgname: data diff --git a/ansible/group_vars/all/storage b/ansible/group_vars/all/storage index 23197be3d..655a8e321 100644 --- a/ansible/group_vars/all/storage +++ b/ansible/group_vars/all/storage @@ -88,13 +88,19 @@ storage_lvm_groups: "{{ storage_lvm_groups_default + storage_lvm_groups_extra }} # Default list of storage volume groups. See mrlesmithjr.manage-lvm role for # format. -storage_lvm_groups_default: - - "{{ storage_lvm_group_data }}" +storage_lvm_groups_default: "{{ [storage_lvm_group_data] if storage_lvm_group_data_enabled | bool else [] }}" # Additional list of storage volume groups. See mrlesmithjr.manage-lvm role # for format. storage_lvm_groups_extra: [] +# Whether a 'data' LVM volume group should exist on storage hosts. By default +# this contains a 'docker-volumes' logical volume for Docker volume storage. It +# will also be used for Docker container and image storage if +# 'docker_storage_driver' is set to 'devicemapper'. Default is true if +# 'docker_storage_driver' is set to 'devicemapper', or false otherwise. +storage_lvm_group_data_enabled: "{{ docker_storage_driver == 'devicemapper' }}" + # Storage LVM volume group for data. See mrlesmithjr.manage-lvm role for # format. storage_lvm_group_data: diff --git a/doc/source/configuration/hosts.rst b/doc/source/configuration/hosts.rst index d6754f346..c7c819cd2 100644 --- a/doc/source/configuration/hosts.rst +++ b/doc/source/configuration/hosts.rst @@ -520,11 +520,28 @@ via the ``seed_hypervisor_lvm_group_data_disks`` variable. LVM for Docker -------------- -The default LVM configuration is optimised for the ``devicemapper`` Docker -storage driver, which requires a thin provisioned LVM volume. A second logical -volume is used for storing Docker volume data, mounted at -``/var/lib/docker/volumes``. Both logical volumes are created from a single -``data`` volume group. +.. note:: + + In Train and earlier releases of Kayobe, the ``data`` volume group was + always enabled by default. + +If the ``devicemapper`` Docker storage driver is in use, the default LVM +configuration is optimised for it. The ``devicemapper`` driver requires a thin +provisioned LVM volume. A second logical volume is used for storing Docker +volume data, mounted at ``/var/lib/docker/volumes``. Both logical volumes are +created from a single ``data`` volume group. + +This configuration is enabled by the following variables, which default to +``true`` if the ``devicemapper`` driver is in use or ``false`` otherwise: + +* ``compute_lvm_group_data_enabled`` +* ``controller_lvm_group_data_enabled`` +* ``seed_lvm_group_data_enabled`` +* ``storage_lvm_group_data_enabled`` + +These variables can be set to ``true`` to enable the data volume group if the +``devicemapper`` driver is not in use. This may be useful where the +``docker-volumes`` logical volume is required. To use this configuration, a list of disks must be configured via the following variables: diff --git a/releasenotes/notes/default-lvm-data-vg-f2848066975beeda.yaml b/releasenotes/notes/default-lvm-data-vg-f2848066975beeda.yaml new file mode 100644 index 000000000..506fbaeeb --- /dev/null +++ b/releasenotes/notes/default-lvm-data-vg-f2848066975beeda.yaml @@ -0,0 +1,15 @@ +--- +upgrade: + - | + The default LVM configuration is now empty for all hosts, unless they are + configured to use the ``devicemapper`` Docker storage driver (which is the + default, but is expected to change in a future release). + + Note that while the default LVM configuration existed primarily for the + ``devicemapper`` driver, it also included a ``docker-volumes`` logical + volume mounted at ``/var/lib/docker/volumes`` for Docker volumes. If the + ``docker-volumes`` volume is required on a host which is not configured to + use the Docker ``devicemapper`` storage driver, the following variables may + be used to enable it: ``compute_lvm_group_data_enabled``, + ``controller_lvm_group_data_enabled``, ``seed_lvm_group_data_enabled``, + ``storage_lvm_group_data_enabled``.