From 2f591607a4b1e8f7e0f692695a71e2283a0e6eeb Mon Sep 17 00:00:00 2001 From: "Crank, Daniel (dc6350)" Date: Mon, 29 Mar 2021 16:17:15 -0500 Subject: [PATCH] Align with VINO CR bmhLabels This patchset makes minor changes to vino-builder to work with the addition of bmhLabels in [0]. [0] https://review.opendev.org/c/airship/vino/+/782875 Change-Id: I5eb41a863c556b38c819f6da862265e153922fe7 --- .../playbooks/roles/libvirt/library/core_allocation.py | 2 +- .../assets/playbooks/roles/libvirt/tasks/create-domain.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vino-builder/assets/playbooks/roles/libvirt/library/core_allocation.py b/vino-builder/assets/playbooks/roles/libvirt/library/core_allocation.py index 8a5d70a..eb25684 100644 --- a/vino-builder/assets/playbooks/roles/libvirt/library/core_allocation.py +++ b/vino-builder/assets/playbooks/roles/libvirt/library/core_allocation.py @@ -96,7 +96,7 @@ def allocate_cores(nodes, flavors, exclude_cpu): # address the case where previous != desired - delete previous, re-run for node in nodes: - flavor = node['labels']['vmFlavor'] + flavor = node['bmhLabels']['airshipit.org/k8s-role'] vcpus = flavors[flavor]['vcpus'] for num_node in range(0, node['count']): diff --git a/vino-builder/assets/playbooks/roles/libvirt/tasks/create-domain.yaml b/vino-builder/assets/playbooks/roles/libvirt/tasks/create-domain.yaml index 08a365c..a81f90e 100644 --- a/vino-builder/assets/playbooks/roles/libvirt/tasks/create-domain.yaml +++ b/vino-builder/assets/playbooks/roles/libvirt/tasks/create-domain.yaml @@ -5,7 +5,7 @@ - name: debug print virsh xml domain debug: - msg: "{{ flavorTemplates[node.labels.vmFlavor]['domainTemplate'] }}" + msg: "{{ flavorTemplates[node['bmhLabels']['airshipit.org/k8s-role']]['domainTemplate'] }}" loop: "{{ range(0,node.count)|list }}" - name: get state of existing volumes @@ -14,7 +14,7 @@ register: vol_list - name: write out domain volume request xml - copy: content="{{ flavorTemplates[node.labels.vmFlavor]['volumeTemplate'] }}" dest=/tmp/vol-{{item}}.xml + copy: content="{{ flavorTemplates[node['bmhLabels']['airshipit.org/k8s-role']]['volumeTemplate'] }}" dest=/tmp/vol-{{item}}.xml loop: "{{ range(0,node.count)|list }}" - name: create domain volume if it doesn't exist @@ -35,7 +35,7 @@ # to domains, so we must shell out here instead - name: write out domain volume request xml - copy: content="{{ flavorTemplates[node.labels.vmFlavor]['domainTemplate'] }}" dest=/tmp/domain-{{item}}.xml + copy: content="{{ flavorTemplates[node['bmhLabels']['airshipit.org/k8s-role']]['domainTemplate'] }}" dest=/tmp/domain-{{item}}.xml loop: "{{ range(0,node.count)|list }}" - name: virsh define domain