From f4a4919b49b7a3dd197a4a031d6ba6370e0c5304 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 23 Apr 2021 12:09:45 +0200 Subject: [PATCH] copr-hv: volume storage --- roles/copr/hypervisor/README | 38 ++++++++++++++++++++++++++++ roles/copr/hypervisor/tasks/main.yml | 27 ++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 roles/copr/hypervisor/README diff --git a/roles/copr/hypervisor/README b/roles/copr/hypervisor/README new file mode 100644 index 0000000000..feefc6a2bd --- /dev/null +++ b/roles/copr/hypervisor/README @@ -0,0 +1,38 @@ +General VM requirements for builder VMs +--------------------------------------- + +- 2xvCPU +- 16GB RAM +- 16G for built results +- 4G for root partition +- SWAP+RAM + - 32GB for /var/lib/mock tmpfs + - 140GB tmpfs for mock root(s) + + +AMD hypervisors +=============== + +vmhost-x86-copr0[1-4].rdu-cc.fedoraproject.org + +- 256G RAM +- 64 threads (2x16 cores) +- 2.6T+ storage +- 300 G SWAP + +This brings us 32+ (few devel) overcommitted builders on each builder: + + - 32*16G = up to 512 GRAM (256 RAM + 300 G SWAP) + - 4G+16G = 20G*32 = up to 640G for root+results + - 172G*32 = up to 5.5T SWAP for tmpfs (huge overcommit, though only limitted + amount of build tasks require that much tmpfs) + +Manually created swap: + + 1. lvcreate -L 300G vg_guests -n swap + 2. mkswap -L swap /dev/mapper/vg_guests-swap + +Manually created space for volumes/images: + + 1. lvcreate -n images -l 100%FREE vg_guests + 2. mkfs.ext4 /dev/mapper/vg_guests-images -L vmvolumes diff --git a/roles/copr/hypervisor/tasks/main.yml b/roles/copr/hypervisor/tasks/main.yml index 97704346c1..34faccf55b 100644 --- a/roles/copr/hypervisor/tasks/main.yml +++ b/roles/copr/hypervisor/tasks/main.yml @@ -11,6 +11,33 @@ when: fstab_swap_entry.changed tags: swap +- set_fact: image_pool_dir=/libvirt-images + tags: libvirt + +- name: create libvirt image directory + file: path={{ image_pool_dir }} + owner=qemu group=qemu mode=0700 + state=directory + tags: libvirt + +- name: mount libvirt image partition + mount: name={{ image_pool_dir }} src='LABEL=vmvolumes' + fstype=ext4 state=mounted + tags: libvirt + +- name: correct selinux + sefcontext: + target: "{{ image_pool_dir }}(/.*)?" + setype: virt_image_t + state: present + register: semanage_run + tags: libvirt + +- name: restorecon + shell: restorecon -irv "{{ image_pool_dir }}" + when: semanage_run.changed + tags: libvirt + - name: create the copr user user: name=copr uid=11666