Support for MAC address when VM count > 1 in AIAP

Current AIAP implementation has support for multiple VMs for
target/worker with an attribute "count".
But this is not supported for corresponding new MAC addresses.
The current implementation has mac address fixed for one
target node/one worker node.
This PS provide change in ansible playlist to handle
MAC addresses as list.

Closes: #640
Relates-To: #640
Change-Id: I14b6e2e4d9e81a4f1cf114c26f94328a1461134f
changes/38/809938/8
Manoj Alva(ma257n) 1 year ago committed by Manoj
parent 75044b33b1
commit faa13c51ad
  1. 12
      tools/airship-in-a-pod/infra-builder/assets/opt/ansible/playbooks/roles/build-infra/defaults/main.yaml
  2. 4
      tools/airship-in-a-pod/infra-builder/assets/opt/ansible/playbooks/roles/build-infra/tasks/create-vm.yaml
  3. 5
      tools/airship-in-a-pod/infra-builder/assets/opt/ansible/playbooks/roles/build-infra/tasks/main.yaml

@ -20,8 +20,8 @@ ephemeral_node:
name: air-ephemeral
cpu: 4
ram: 6144
nat_mac_address: 52:54:00:9b:27:02
prov_mac_address: 52:54:00:b6:ed:02
nat_mac_address: [ "52:54:00:9b:27:02" ]
prov_mac_address: [ "52:54:00:b6:ed:02" ]
block:
- 30G
@ -30,8 +30,8 @@ target_nodes:
name: air-target
cpu: 2
ram: 7168
nat_mac_address: 52:54:00:9b:27:4c
prov_mac_address: 52:54:00:b6:ed:31
nat_mac_address: [ "52:54:00:9b:27:4c" ]
prov_mac_address: [ "52:54:00:b6:ed:31" ]
block:
- 30G
@ -40,8 +40,8 @@ worker_nodes:
name: air-worker
cpu: 2
ram: 7168
nat_mac_address: 52:54:00:9b:27:07
prov_mac_address: 52:54:00:b6:ed:23
nat_mac_address: [ "52:54:00:9b:27:07" ]
prov_mac_address: [ "52:54:00:b6:ed:23" ]
block:
- 30G

@ -37,8 +37,8 @@
--machine pc \
--name "{{ vm_name }}" \
--memory "{{ vm_instance.ram }}" \
--network network="air_nat",address.type='pci',address.domain=0,address.bus=0,address.slot=3,address.function=0,mac="{{ vm_instance.nat_mac_address }}" \
--network network="air_prov",address.type='pci',address.domain=0,address.bus=0,address.slot=4,address.function=0,mac="{{ vm_instance.prov_mac_address }}" \
--network network="air_nat",address.type='pci',address.domain=0,address.bus=0,address.slot=3,address.function=0,mac="{{ vm_instance.nat_mac_address[vm_index | int] }}" \
--network network="air_prov",address.type='pci',address.domain=0,address.bus=0,address.slot=4,address.function=0,mac="{{ vm_instance.prov_mac_address[vm_index | int] }}" \
--cpu host-passthrough \
--vcpus "{{ vm_instance.cpu | int }}" \
--import \

@ -71,15 +71,18 @@
vars:
vm_instance: "{{ ephemeral_node }}"
vm_name: "{{ ephemeral_node.name }}"
vm_index: 0
- name: "Create target nodes"
include_tasks: create-vm.yaml
vars:
vm_instance: "{{ target_nodes }}"
vm_name: "{{ target_nodes.name }}-{{ a_node }}"
vm_index: "{{ ansible_loop.index0 }}"
with_sequence:
start=1 end="{{ (vm_instance.count | int) }}"
loop_control:
extended: yes
loop_var: a_node
- name: "Create worker nodes"
@ -87,7 +90,9 @@
vars:
vm_instance: "{{ worker_nodes }}"
vm_name: "{{ worker_nodes.name }}-{{ a_node }}"
vm_index: "{{ ansible_loop.index0 }}"
with_sequence:
start=1 end="{{ (vm_instance.count | int) }}"
loop_control:
extended: yes
loop_var: a_node

Loading…
Cancel
Save