Support configuring LVM on the seed hypervisor
This allows operators to easily provide storage space for the seed VM. Change-Id: Ibcb1a5b0d34f2456459604e3a0f3303d93810afb Story: 2004756 Task: 28862
This commit is contained in:
parent
bf3d31aaa2
commit
e855882533
@ -20,6 +20,49 @@ seed_hypervisor_default_network_interfaces: "{{ seed_default_network_interfaces
|
|||||||
# List of extra networks to which seed hypervisor nodes are attached.
|
# List of extra networks to which seed hypervisor nodes are attached.
|
||||||
seed_hypervisor_extra_network_interfaces: "{{ seed_extra_network_interfaces }}"
|
seed_hypervisor_extra_network_interfaces: "{{ seed_extra_network_interfaces }}"
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor node LVM configuration.
|
||||||
|
|
||||||
|
# List of seed hypervisor volume groups. See mrlesmithjr.manage-lvm role for
|
||||||
|
# format. Set to "{{ seed_hypervisor_lvm_groups_with_data }}" to create a
|
||||||
|
# volume group for libvirt storage.
|
||||||
|
seed_hypervisor_lvm_groups: []
|
||||||
|
|
||||||
|
# Suggested list of seed hypervisor volume groups for libvirt. Not used by default.
|
||||||
|
seed_hypervisor_lvm_groups_with_data:
|
||||||
|
- "{{ seed_hypervisor_lvm_group_data }}"
|
||||||
|
|
||||||
|
# Seed LVM volume group for data. See mrlesmithjr.manage-lvm role for format.
|
||||||
|
seed_hypervisor_lvm_group_data:
|
||||||
|
vgname: data
|
||||||
|
disks: "{{ seed_hypervisor_lvm_group_data_disks }}"
|
||||||
|
create: True
|
||||||
|
lvnames: "{{ seed_hypervisor_lvm_group_data_lvs }}"
|
||||||
|
|
||||||
|
# List of disks for use by seed hypervisor LVM data volume group. Default to an
|
||||||
|
# invalid value to require configuration.
|
||||||
|
seed_hypervisor_lvm_group_data_disks:
|
||||||
|
- changeme
|
||||||
|
|
||||||
|
# List of LVM logical volumes for the data volume group.
|
||||||
|
seed_hypervisor_lvm_group_data_lvs:
|
||||||
|
- "{{ seed_hypervisor_lvm_group_data_lv_libvirt_storage }}"
|
||||||
|
|
||||||
|
# Libvirt storage LVM backing volume.
|
||||||
|
seed_hypervisor_lvm_group_data_lv_libvirt_storage:
|
||||||
|
lvname: libvirt-storage
|
||||||
|
size: "{{ seed_hypervisor_lvm_group_data_lv_libvirt_storage_size }}"
|
||||||
|
create: True
|
||||||
|
filesystem: "{{ seed_hypervisor_lvm_group_data_lv_libvirt_storage_fs }}"
|
||||||
|
mount: True
|
||||||
|
mntp: "{{ seed_hypervisor_libvirt_pool_path }}"
|
||||||
|
|
||||||
|
# Size of libvirt storage LVM backing volume.
|
||||||
|
seed_hypervisor_lvm_group_data_lv_libvirt_storage_size: 100%VG
|
||||||
|
|
||||||
|
# Filesystem for libvirt storage LVM backing volume. ext4 allows for shrinking.
|
||||||
|
seed_hypervisor_lvm_group_data_lv_libvirt_storage_fs: ext4
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Seed hypervisor libvirt storage pool configuration.
|
# Seed hypervisor libvirt storage pool configuration.
|
||||||
|
|
||||||
|
6
ansible/group_vars/seed-hypervisor/lvm
Normal file
6
ansible/group_vars/seed-hypervisor/lvm
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor node LVM configuration.
|
||||||
|
|
||||||
|
# List of LVM volume groups.
|
||||||
|
lvm_groups: "{{ seed_hypervisor_lvm_groups }}"
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure LVM configuration is applied
|
- name: Ensure LVM configuration is applied
|
||||||
hosts: seed:overcloud
|
hosts: seed-hypervisor:seed:overcloud
|
||||||
tags:
|
tags:
|
||||||
- lvm
|
- lvm
|
||||||
- upgrade-check
|
- upgrade-check
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# any LVM or file system state from them.
|
# any LVM or file system state from them.
|
||||||
|
|
||||||
- name: Ensure that all unmounted block devices are wiped
|
- name: Ensure that all unmounted block devices are wiped
|
||||||
hosts: seed:overcloud
|
hosts: seed-hypervisor:seed:overcloud
|
||||||
tags:
|
tags:
|
||||||
- wipe-disks
|
- wipe-disks
|
||||||
roles:
|
roles:
|
||||||
|
@ -18,6 +18,36 @@
|
|||||||
# List of extra networks to which seed hypervisor nodes are attached.
|
# List of extra networks to which seed hypervisor nodes are attached.
|
||||||
#seed_hypervisor_extra_network_interfaces:
|
#seed_hypervisor_extra_network_interfaces:
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor node LVM configuration.
|
||||||
|
|
||||||
|
# List of seed hypervisor volume groups. See mrlesmithjr.manage-lvm role for
|
||||||
|
# format. Set to "{{ seed_hypervisor_lvm_groups_with_data }}" to create a
|
||||||
|
# volume group for libvirt storage.
|
||||||
|
#seed_hypervisor_lvm_groups:
|
||||||
|
|
||||||
|
# Suggested list of seed hypervisor volume groups for libvirt. Not used by default.
|
||||||
|
#seed_hypervisor_lvm_groups_with_data:
|
||||||
|
|
||||||
|
# Seed LVM volume group for data. See mrlesmithjr.manage-lvm role for format.
|
||||||
|
#seed_hypervisor_lvm_group_data:
|
||||||
|
|
||||||
|
# List of disks for use by seed hypervisor LVM data volume group. Default to an
|
||||||
|
# invalid value to require configuration.
|
||||||
|
#seed_hypervisor_lvm_group_data_disks:
|
||||||
|
|
||||||
|
# List of LVM logical volumes for the data volume group.
|
||||||
|
#seed_hypervisor_lvm_group_data_lvs:
|
||||||
|
|
||||||
|
# Libvirt storage LVM backing volume.
|
||||||
|
#seed_hypervisor_lvm_group_data_lv_libvirt_storage:
|
||||||
|
|
||||||
|
# Size of libvirt storage LVM backing volume.
|
||||||
|
#seed_hypervisor_lvm_group_data_lv_libvirt_storage_size:
|
||||||
|
|
||||||
|
# Filesystem for libvirt storage LVM backing volume. ext4 allows for shrinking.
|
||||||
|
#seed_hypervisor_lvm_group_data_lv_libvirt_storage_fs:
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Seed hypervisor libvirt storage pool configuration.
|
# Seed hypervisor libvirt storage pool configuration.
|
||||||
|
|
||||||
|
@ -270,15 +270,26 @@ class SeedHypervisorHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin,
|
|||||||
* Add the host to SSH known hosts.
|
* Add the host to SSH known hosts.
|
||||||
* Configure a user account for use by kayobe for SSH access.
|
* Configure a user account for use by kayobe for SSH access.
|
||||||
* Optionally, create a virtualenv for remote target hosts.
|
* Optionally, create a virtualenv for remote target hosts.
|
||||||
|
* Optionally, wipe unmounted disk partitions (--wipe-disks).
|
||||||
* Configure user accounts, group associations, and authorised SSH keys.
|
* Configure user accounts, group associations, and authorised SSH keys.
|
||||||
* Configure a PyPI mirror.
|
* Configure a PyPI mirror.
|
||||||
* Configure Yum repos.
|
* Configure Yum repos.
|
||||||
* Configure the host's network interfaces.
|
* Configure the host's network interfaces.
|
||||||
* Set sysctl parameters.
|
* Set sysctl parameters.
|
||||||
* Configure NTP.
|
* Configure NTP.
|
||||||
|
* Configure LVM volumes.
|
||||||
* Configure the host as a libvirt hypervisor.
|
* Configure the host as a libvirt hypervisor.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def get_parser(self, prog_name):
|
||||||
|
parser = super(SeedHypervisorHostConfigure, self).get_parser(prog_name)
|
||||||
|
group = parser.add_argument_group("Host Configuration")
|
||||||
|
group.add_argument("--wipe-disks", action='store_true',
|
||||||
|
help="wipe partition and LVM data from all disks "
|
||||||
|
"that are not mounted. Warning: this can "
|
||||||
|
"result in the loss of data")
|
||||||
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
self.app.LOG.debug("Configuring seed hypervisor host OS")
|
self.app.LOG.debug("Configuring seed hypervisor host OS")
|
||||||
# Explicitly request the dump-config tag to ensure this play runs even
|
# Explicitly request the dump-config tag to ensure this play runs even
|
||||||
@ -292,8 +303,12 @@ class SeedHypervisorHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin,
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
playbooks = _build_playbook_list(
|
playbooks = _build_playbook_list(
|
||||||
"ip-allocation", "ssh-known-host", "kayobe-ansible-user",
|
"ip-allocation", "ssh-known-host", "kayobe-ansible-user",
|
||||||
"pip", "kayobe-target-venv", "users", "yum", "dev-tools",
|
"pip", "kayobe-target-venv")
|
||||||
"network", "sysctl", "ntp", "seed-hypervisor-libvirt-host")
|
if parsed_args.wipe_disks:
|
||||||
|
playbooks += _build_playbook_list("wipe-disks")
|
||||||
|
playbooks += _build_playbook_list(
|
||||||
|
"users", "yum", "dev-tools", "network", "sysctl", "ntp", "lvm",
|
||||||
|
"seed-hypervisor-libvirt-host")
|
||||||
self.run_kayobe_playbooks(parsed_args, playbooks,
|
self.run_kayobe_playbooks(parsed_args, playbooks,
|
||||||
limit="seed-hypervisor")
|
limit="seed-hypervisor")
|
||||||
|
|
||||||
|
@ -254,6 +254,7 @@ class TestCase(unittest.TestCase):
|
|||||||
"ansible/network.yml",
|
"ansible/network.yml",
|
||||||
"ansible/sysctl.yml",
|
"ansible/sysctl.yml",
|
||||||
"ansible/ntp.yml",
|
"ansible/ntp.yml",
|
||||||
|
"ansible/lvm.yml",
|
||||||
"ansible/seed-hypervisor-libvirt-host.yml",
|
"ansible/seed-hypervisor-libvirt-host.yml",
|
||||||
],
|
],
|
||||||
limit="seed-hypervisor",
|
limit="seed-hypervisor",
|
||||||
|
10
releasenotes/notes/seed-hypervisor-lvm-80864721ff42f6a5.yaml
Normal file
10
releasenotes/notes/seed-hypervisor-lvm-80864721ff42f6a5.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Adds support for configuring LVM volume groups on the seed hypervisor.
|
||||||
|
Setting the ``seed_hypervisor_lvm_groups`` variable in
|
||||||
|
``$KAYOBE_CONFIG_PATH/seed-hypervisor.yml`` to
|
||||||
|
``"{{ seed_hypervisor_lvm_groups_with_data }}"`` and providing a list of
|
||||||
|
storage devices via the ``seed_hypervisor_lvm_group_data_disks`` variable
|
||||||
|
will configure a logical volume mounted to ``/var/lib/libvirt/images``. No
|
||||||
|
LVM volume groups are configured by default.
|
Loading…
Reference in New Issue
Block a user