diff --git a/inventory/group_vars/copr_aws b/inventory/group_vars/copr_aws index 574dd4746a..c8e1a301ab 100644 --- a/inventory/group_vars/copr_aws +++ b/inventory/group_vars/copr_aws @@ -37,6 +37,12 @@ builders: ppc64le: [13, 4, 13] p09_hypervisor_01: ppc64le: [31, 5, 31] + p09_hypervisor_02: + ppc64le: [0, 1, 1] + p09_hypervisor_03: + ppc64le: [0, 1, 1] + p09_hypervisor_04: + ppc64le: [0, 1, 1] x86_hypervisor_01: x86_64: [20, 4, 20] x86_hypervisor_02: diff --git a/inventory/group_vars/copr_dev_aws b/inventory/group_vars/copr_dev_aws index 7fddc87e0e..db969eb437 100644 --- a/inventory/group_vars/copr_dev_aws +++ b/inventory/group_vars/copr_dev_aws @@ -39,6 +39,12 @@ builders: ppc64le: [2, 1, 1] p09_hypervisor_01: ppc64le: [2, 1, 1] + p09_hypervisor_02: + ppc64le: [0, 1, 1] + p09_hypervisor_03: + ppc64le: [0, 1, 1] + p09_hypervisor_04: + ppc64le: [0, 1, 1] x86_hypervisor_01: x86_64: [2, 1, 1] x86_hypervisor_02: diff --git a/inventory/host_vars/vmhost-p09-copr01.rdu-cc.fedoraproject.org b/inventory/host_vars/vmhost-p09-copr01.rdu-cc.fedoraproject.org index 9b0f0ecbee..fa145942a6 100644 --- a/inventory/host_vars/vmhost-p09-copr01.rdu-cc.fedoraproject.org +++ b/inventory/host_vars/vmhost-p09-copr01.rdu-cc.fedoraproject.org @@ -20,7 +20,7 @@ mac2: "b8:ce:f6:c6:00:c6" mac3: "b8:ce:f6:c6:00:c7" mac4: "b8:ce:f6:c6:00:d0" mac5: "b8:ce:f6:c6:00:d1" -libvirt_pool: copr_p09_01 +libvirt_pool: vmhost_p09_01 libvirt_pool_order_id: 6 libvirt_arch: ppc64le network_connections: diff --git a/roles/copr/backend/files/provision/libvirt-cleanup b/roles/copr/backend/files/provision/libvirt-cleanup deleted file mode 100755 index 37b0ed0e9c..0000000000 --- a/roles/copr/backend/files/provision/libvirt-cleanup +++ /dev/null @@ -1,57 +0,0 @@ -#! /bin/bash - -# This should be handled by https://github.com/praiskup/resalloc/issues/88 in -# the future. For now this is called manually. - -separator=' ' -pools_observed= - -current_machines() -{ - connection=$1 - pool=$2 - content=$(/var/lib/resallocserver/provision/libvirt-list --connection "$connection" --pool "$pool") - eval "$pool=' $(echo $content) '" - eval "${pool}_connection=\$connection" - pools_observed=$pools_observed$separator$pool -} - -case $(hostname) in - copr-be-dev.aws.fedoraproject.org) suffix=_dev ;; - copr-be.aws.fedoraproject.org) suffix=_prod ;; - *) echo bad hostname ; exit 1 ;; -esac - -for i in 1 2 3 4; do - current_machines qemu+ssh://copr@vmhost-x86-copr0$i.rdu-cc.fedoraproject.org/system copr_hv_x86_64_0$i$suffix -done - -for i in 1 2; do - current_machines qemu+ssh://copr@vmhost-p08-copr0$i.rdu-cc.fedoraproject.org/system copr_hv_ppc64le_0$i$suffix -done - -for i in 1; do - current_machines qemu+ssh://copr@vmhost-p09-copr0$i.rdu-cc.fedoraproject.org/system copr_p09_0$i$suffix -done - -running_machines=$(resalloc-maint resource-list |cut -d' ' -f3) -set -- $running_machines -running_machines=" $* " - -for pool in $pools_observed; do - eval "leftovers=\$$pool" - eval "connection=\$${pool}_connection" - for leftover in $leftovers; do - case $running_machines in - *" $leftover "*) continue ;; # this machine is still tracked - esac - - cmd=( - /var/lib/resallocserver/provision/libvirt-delete - --connection "$connection" - "$leftover" - ) - echo "running: ${cmd[*]}" - "${cmd[@]}" - done -done diff --git a/roles/copr/backend/templates/provision/libvirt-new b/roles/copr/backend/templates/provision/libvirt-new index 9ad6885e08..50e9b2fb6c 100755 --- a/roles/copr/backend/templates/provision/libvirt-new +++ b/roles/copr/backend/templates/provision/libvirt-new @@ -390,22 +390,34 @@ def get_fedora_ipv6_address(pool_id, id_in_pool, dev, log): """ Statically assign IPv6 + Gateway based on id_in_pool. """ + + hv_id, _, _ = get_hv_identification_from_pool_id(pool_id) + hv_id = int(hv_id) + gateway = "2620:52:3:1:ffff:ffff:ffff:fffe" base = "2620:52:3:1:dead:beef:cafe:c" + order_within_base = hv_id + + if hv_id in [7, 8, 9]: + # https://github.com/fedora-copr/copr/issues/3786#issuecomment-3412337856 + gateway = "2620:52:6:1661:ffff:ffff:ffff:fffe" + base = "2620:52:6:1161:dead:beef:cafe:c" + order_within_base = hv_id - 7 + # The initial 256 addresses (:c0XX) is reserved for hypervisor machines - # itself. + # itself (not really in rdu3, per copr issue/3786 at least, but it doesn't + # hurt to wait those in practice so we keep the pattern). start = 0x100 # each hypervisor has block of 64 IPs block = 64 - hv_id, _, _ = get_hv_identification_from_pool_id(pool_id) log.info("Hypervisor ID: %s", hv_id) # give 48 IPs to each hv (32 prod, some dev), currently 4*48=192 ips - offset = hv_id * block + offset = order_within_base * block if not dev: # give the first 8 addresses to Copr dev instance offset += 8 diff --git a/roles/copr/backend/templates/resalloc/pools.yaml.j2 b/roles/copr/backend/templates/resalloc/pools.yaml.j2 index f550a9d4ce..2cb8b73cec 100644 --- a/roles/copr/backend/templates/resalloc/pools.yaml.j2 +++ b/roles/copr/backend/templates/resalloc/pools.yaml.j2 @@ -274,10 +274,10 @@ copr_hv_ppc64le_{{ hv }}_{% if devel %}dev{% else %}prod{% endif %}: # Power9 hypervisors -{% for hv in ["01", "02", "03"] %} +{% for hv in ["01", "02", "03", "04"] %} {% if "p09_hypervisor_" + hv in builders %} -copr_p09_{{ hv }}_{% if devel %}dev{% else %}prod{% endif %}: +vmhost_p09_{{ hv }}_{% if devel %}dev{% else %}prod{% endif %}: max: {{ builders["p09_hypervisor_" + hv]["ppc64le"][0] }} max_starting: {{ builders["p09_hypervisor_" + hv]["ppc64le"][1] }} max_prealloc: {{ builders["p09_hypervisor_" + hv]["ppc64le"][2] }} diff --git a/roles/copr/backend/templates/resalloc/vm-delete.j2 b/roles/copr/backend/templates/resalloc/vm-delete.j2 index fd45192861..3ac7a8d5f1 100755 --- a/roles/copr/backend/templates/resalloc/vm-delete.j2 +++ b/roles/copr/backend/templates/resalloc/vm-delete.j2 @@ -43,9 +43,8 @@ copr_osuosl_*) ;; *copr_hv_ppc64le_*) ;; -copr_p09_01*) - ;; vmhost*) + # hypervisors ;; *) die "unknown RESALLOC_POOL_ID=$RESALLOC_POOL_ID" ;;