summaryrefslogtreecommitdiffstats
path: root/xci
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-08-09 16:29:24 +0200
committerManuel Buil <mbuil@suse.com>2018-10-15 15:57:24 +0000
commiteab5448287464ca3900a3e7495e27ac1a2cf1dc9 (patch)
tree64fce36a934d40c1aa6d12770f95ff6cd7a39e00 /xci
parent4597bb3c4ff273a68d73883a9d87520517d60876 (diff)
[Baremetal] Modify interaction with bifrost roles
Change some of the variables when calling opnfv-virtual.yml and baremetal=true: 1 - We want to configure DHCP mapping between ip and mac when doing baremetal. The create-nodes role will generate a file with that mapping for us (baremetalstaticips) 2 - Don't download the standard IPA image but build one with Fedora (only one that works in ericsson-pod2) when doing baremetal 3 - Wait for the blade to complete its booting. Its ssh port becomes available with the IPA provision but that is not the final state. We need to wait until the required distro gets installed. When not doing baremetal, this is fine as the VMs boot very fast with the chosen distro but for baremetal it takes a while (ericsson-pod2 servers take around 2 minutes to finish all BIOS booting). The playbook wait-for-baremetal.yml does this. Change-Id: I5536517209ff7f46ec034554d29566707778e397 Signed-off-by: Manuel Buil <mbuil@suse.com>
Diffstat (limited to 'xci')
-rw-r--r--xci/infra/bifrost/infra-provision.sh14
-rw-r--r--xci/infra/bifrost/playbooks/opnfv-virtual.yml4
-rw-r--r--xci/infra/bifrost/playbooks/wait-for-baremetal.yml17
-rwxr-xr-xxci/infra/bifrost/scripts/bifrost-env.sh10
4 files changed, 40 insertions, 5 deletions
diff --git a/xci/infra/bifrost/infra-provision.sh b/xci/infra/bifrost/infra-provision.sh
index 0b25f258..e60e9de0 100644
--- a/xci/infra/bifrost/infra-provision.sh
+++ b/xci/infra/bifrost/infra-provision.sh
@@ -54,12 +54,12 @@ ansible-playbook ${XCI_ANSIBLE_PARAMS} \
-e testing_user=root \
-e test_vm_num_nodes=${NUM_NODES} \
-e test_vm_cpu='host-model' \
- -e inventory_dhcp=false \
+ -e inventory_dhcp=${BIFROST_INVENTORY_DHCP} \
-e inventory_dhcp_static_ip=false \
-e enable_inspector=true \
-e inspect_nodes=true \
- -e download_ipa=true \
- -e create_ipa_image=false \
+ -e download_ipa=${BIFROST_DOWNLOAD_IPA} \
+ -e create_ipa_image=${BIFROST_CREATE_IPA} \
-e write_interfaces_file=true \
-e ipv4_gateway=192.168.122.1 \
-e wait_timeout=3600 \
@@ -76,6 +76,14 @@ ansible-playbook ${XCI_ANSIBLE_PARAMS} \
-e ironic_url="http://192.168.122.2:6385/" \
${BIFROST_ROOT_DIR}/playbooks/opnfv-virtual.yml
+
+if [ "${BAREMETAL}" = true ]; then
+ ansible-playbook ${XCI_ANSIBLE_PARAMS} \
+ --user=devuser -i ${XCI_PATH}/xci/playbooks/dynamic_inventory.py \
+ -i ${XCI_CACHE}/repos/bifrost/playbooks/inventory/bifrost_inventory.py \
+ ${BIFROST_ROOT_DIR}/playbooks/wait-for-baremetal.yml
+fi
+
echo "-----------------------------------------------------------------------"
echo "Info: VM nodes are provisioned!"
echo "-----------------------------------------------------------------------"
diff --git a/xci/infra/bifrost/playbooks/opnfv-virtual.yml b/xci/infra/bifrost/playbooks/opnfv-virtual.yml
index 8dfd9db7..313919ba 100644
--- a/xci/infra/bifrost/playbooks/opnfv-virtual.yml
+++ b/xci/infra/bifrost/playbooks/opnfv-virtual.yml
@@ -77,11 +77,11 @@
enabled_hardware_types: ipmi
network_interface: "{{ ansible_default_ipv4.interface }}"
# Create the IPA image for ironic to boot the nodes and write the final distro in the hard drive
+ # fedora is used because it is the only one working with ericsson-pod2 (it has support for newer hardware)
- role: bifrost-create-dib-image
dib_imagename: "{{ http_boot_folder }}/ipa"
build_ramdisk: false
- dib_os_element: "{{ ipa_dib_os_element|default('debian') }}"
- dib_os_release: "jessie"
+ dib_os_element: "{{ ipa_dib_os_element|default('fedora') }}"
dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}"
dib_notmpfs: true
when:
diff --git a/xci/infra/bifrost/playbooks/wait-for-baremetal.yml b/xci/infra/bifrost/playbooks/wait-for-baremetal.yml
new file mode 100644
index 00000000..cb42cc49
--- /dev/null
+++ b/xci/infra/bifrost/playbooks/wait-for-baremetal.yml
@@ -0,0 +1,17 @@
+# ironic needs to boot the server again to install the OS in the hard drive
+# we are currently modifying opnfv vm networking config while ironic is
+# doing that and it sometimes fail because of networking glitches. We should
+# wait until the OS is installed to do the opnfv config
+
+- hosts: baremetal
+ name: "Wait for baremetal blades to be ready"
+ become: no
+ gather_facts: False
+ tasks:
+ - name: "Wait for nodes to reboot."
+ wait_for: state=stopped port=22 host={{ ipv4_address }} timeout=240
+ delegate_to: opnfv
+ - name: "Wait for nodes to become available."
+ wait_for: state=started port=22 host={{ ipv4_address }} timeout=3600
+ delegate_to: opnfv
+
diff --git a/xci/infra/bifrost/scripts/bifrost-env.sh b/xci/infra/bifrost/scripts/bifrost-env.sh
index 72d1dafe..7d882125 100755
--- a/xci/infra/bifrost/scripts/bifrost-env.sh
+++ b/xci/infra/bifrost/scripts/bifrost-env.sh
@@ -30,4 +30,14 @@ esac
export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json
+if [ "${BAREMETAL}" = true ]; then
+ export BIFROST_INVENTORY_DHCP=true
+ export BIFROST_DOWNLOAD_IPA=false
+ export BIFROST_CREATE_IPA=true
+else
+ export BIFROST_INVENTORY_DHCP=false
+ export BIFROST_DOWNLOAD_IPA=true
+ export BIFROST_CREATE_IPA=false
+fi
+
pip install -q --upgrade -r "${XCI_CACHE}/repos/bifrost/requirements.txt"