summaryrefslogtreecommitdiffstats
path: root/prototypes/bifrost
diff options
context:
space:
mode:
Diffstat (limited to 'prototypes/bifrost')
-rw-r--r--prototypes/bifrost/README.md53
-rw-r--r--prototypes/bifrost/playbooks/opnfv-virtual.yaml97
-rwxr-xr-xprototypes/bifrost/scripts/bifrost-provision.sh133
-rwxr-xr-xprototypes/bifrost/scripts/destroy-env.sh60
4 files changed, 0 insertions, 343 deletions
diff --git a/prototypes/bifrost/README.md b/prototypes/bifrost/README.md
deleted file mode 100644
index dc1417a86..000000000
--- a/prototypes/bifrost/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-=====================
-How to deploy bifrost
-=====================
-The scripts and playbooks defined on this repo, need to be combined with proper `Bifrost <http://git.openstack.org/cgit/openstack/bifrost>`_ code.
-
-Please follow that steps:
-
-1. Clone bifrost::
-
- sudo git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
-
-2. Clone releng::
-
- sudo git clone https://gerrit.opnfv.org/gerrit/releng /opt/releng
-
-3. Clone infracloud::
-
- sudo git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud
-
-4. Combine releng scripts and playbooks with bifrost::
-
- sudo cp -R /opt/releng/prototypes/bifrost/* /opt/bifrost/
-
-5. Copy /opt/puppet-infracloud/templates/bifrost/create_bridge.py.erb to /opt/puppet-infracloud/files/elements/infra-cloud-bridge/static/opt/create_bridge.py,
- and replace tag <%= @bridge_name -%> with br_opnfv
-
-6. If you are on a RHEL/CentOS box, ensure that selinux is disabled
-
-7. Run destroy script if you need to cleanup previous environment::
-
- cd /opt/bifrost
- sudo ./scripts/destroy-env.sh
-
-8. Run deployment script to spin up 3 vms with bifrost: xcimaster, controller and compute::
-
- cd /opt/bifrost
- sudo ./scripts/test-bifrost-deployment.sh
-
-It is likely that the script will show some errors due to timeout. Please ignore the errors, and wait until the vms are completely bootstrapped. To verify it you can check with ironic::
-
- cd /opt/bifrost
- source env-vars
- ironic node-list
-
-And wait until all the vms are in **active** Provisioning State.
-
-9. Check the IPs assigned to each of the VMS. You can check it by looking at inventory:
-
- cat /tmp/baremetal.csv
-
-10. You can enter into the vms with devuser login/pass:
-
- ssh devuser@192.168.122.2
diff --git a/prototypes/bifrost/playbooks/opnfv-virtual.yaml b/prototypes/bifrost/playbooks/opnfv-virtual.yaml
deleted file mode 100644
index 3cba98b6b..000000000
--- a/prototypes/bifrost/playbooks/opnfv-virtual.yaml
+++ /dev/null
@@ -1,97 +0,0 @@
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2016 RedHat and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-- hosts: localhost
- connection: local
- name: "Setting pre-test conditions"
- become: yes
- ignore_errors: yes
- tasks:
- - name: Remove pre-existing leases file
- file: path=/var/lib/misc/dnsmasq.leases state=absent
-- hosts: localhost
- connection: local
- name: "Executes install, enrollment, and testing in one playbook"
- become: no
- gather_facts: yes
- pre_tasks:
- - name: "Override the ipv4_gateway setting"
- set_fact:
- ipv4_gateway: "192.168.122.1"
- roles:
- - { role: bifrost-prep-for-install, when: skip_install is not defined }
- environment:
- http_proxy: "{{ lookup('env','http_proxy') }}"
- https_proxy: "{{ lookup('env','https_proxy') }}"
-- hosts: localhost
- connection: local
- name: "Executes install, enrollment, and testing in one playbook"
- become: yes
- gather_facts: yes
- roles:
- - role: bifrost-keystone-install
- - role: bifrost-ironic-install
- cleaning: false
- testing: true
- # NOTE(TheJulia): While the next step creates a ramdisk, some elements
- # do not support ramdisk-image-create as they invoke steps to cleanup
- # the ramdisk which causes ramdisk-image-create to believe it failed.
- - 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_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}"
- dib_notmpfs: true
- when: create_ipa_image | bool == true
- - role: bifrost-create-dib-image
- dib_imagetype: "qcow2"
- dib_imagename: "{{deploy_image}}"
- dib_os_element: "{{ lookup('env','DIB_OS_ELEMENT') }}"
- dib_os_release: "{{ lookup('env', 'DIB_OS_RELEASE') }}"
- extra_dib_elements: "{{ lookup('env', 'EXTRA_DIB_ELEMENTS') | default('') }}"
- dib_elements: "vm enable-serial-console simple-init devuser growroot {{ extra_dib_elements }}"
- dib_packages: "{{ lookup('env', 'DIB_OS_PACKAGES') }}"
- dib_notmpfs: true
- when: create_image_via_dib | bool == true and transform_boot_image | bool == false
- - role: bifrost-keystone-client-config
- user: "{{ ansible_env.SUDO_USER }}"
- clouds:
- bifrost:
- config_username: "{{ ironic.keystone.default_username }}"
- config_password: "{{ ironic.keystone.default_password }}"
- config_project_name: "baremetal"
- config_region_name: "{{ keystone.bootstrap.region_name }}"
- config_auth_url: "{{ keystone.bootstrap.public_url }}"
- environment:
- http_proxy: "{{ lookup('env','http_proxy') }}"
- https_proxy: "{{ lookup('env','https_proxy') }}"
-- hosts: baremetal
- name: "Enroll node with Ironic"
- become: no
- connection: local
- roles:
- - role: ironic-enroll-dynamic
- - { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool == true }
-- hosts: baremetal
- name: "Create configuration drive files and deploy machines"
- vars:
- multinode_testing: "{{ inventory_dhcp | bool == true }}"
- become: no
- connection: local
- roles:
- - role: bifrost-configdrives-dynamic
- - role: bifrost-deploy-nodes-dynamic
-- hosts: baremetal
- name: "Deploy machines."
- become: no
- connection: local
- serial: 1
- roles:
- - role: bifrost-prepare-for-test-dynamic
diff --git a/prototypes/bifrost/scripts/bifrost-provision.sh b/prototypes/bifrost/scripts/bifrost-provision.sh
deleted file mode 100755
index 2b9021528..000000000
--- a/prototypes/bifrost/scripts/bifrost-provision.sh
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/bin/bash
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2016 Ericsson AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-set -eux
-set -o pipefail
-
-export PYTHONUNBUFFERED=1
-SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)"
-BIFROST_HOME=$SCRIPT_HOME/..
-ANSIBLE_INSTALL_ROOT=${ANSIBLE_INSTALL_ROOT:-/opt/stack}
-ANSIBLE_VERBOSITY=${ANSIBLE_VERBOSITY-"-vvvv"}
-ENABLE_VENV="false"
-USE_DHCP="false"
-USE_VENV="false"
-BUILD_IMAGE=true
-PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600}
-
-# Ensure the right inventory files is used based on branch
-CURRENT_BIFROST_BRANCH=$(git rev-parse --abbrev-ref HEAD)
-if [ $CURRENT_BIFROST_BRANCH = "master" ]; then
- BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'}
- INVENTORY_FILE_FORMAT="baremetal_json_file"
-else
- BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.csv'}
- INVENTORY_FILE_FORMAT="baremetal_csv_file"
-fi
-export BIFROST_INVENTORY_SOURCE=$BAREMETAL_DATA_FILE
-
-# Default settings for VMs
-export TEST_VM_NUM_NODES=${TEST_VM_NUM_NODES:-3}
-export TEST_VM_NODE_NAMES=${TEST_VM_NODE_NAMES:-"opnfv controller00 compute00"}
-export VM_DOMAIN_TYPE=${VM_DOMAIN_TYPE:-kvm}
-export VM_CPU=${VM_CPU:-4}
-export VM_DISK=${VM_DISK:-100}
-export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-8192}
-export VM_DISK_CACHE=${VM_DISK_CACHE:-unsafe}
-
-# Settings for bifrost
-TEST_PLAYBOOK="opnfv-virtual.yaml"
-USE_INSPECTOR=true
-USE_CIRROS=false
-TESTING_USER=root
-DOWNLOAD_IPA=true
-CREATE_IPA_IMAGE=false
-INSPECT_NODES=true
-INVENTORY_DHCP=false
-INVENTORY_DHCP_STATIC_IP=false
-WRITE_INTERFACES_FILE=true
-
-# Settings for console access
-export DIB_DEV_USER_PWDLESS_SUDO=yes
-export DIB_DEV_USER_PASSWORD=devuser
-
-# Settings for distro: xenial/ubuntu-minimal, 7/centos7, 42.2/suse
-export DIB_OS_RELEASE=${DIB_OS_RELEASE:-xenial}
-export DIB_OS_ELEMENT=${DIB_OS_ELEMENT:-ubuntu-minimal}
-
-# DIB OS packages
-export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl"}
-
-# Additional dib elements
-export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"}
-
-# Source Ansible
-set +x +o nounset
-$SCRIPT_HOME/env-setup.sh
-ANSIBLE=$(which ansible-playbook)
-set -x -o nounset
-
-logs_on_exit() {
- $SCRIPT_HOME/collect-test-info.sh
-}
-trap logs_on_exit EXIT
-
-# Change working directory
-cd $BIFROST_HOME/playbooks
-
-# Syntax check of dynamic inventory test path
-for task in syntax-check list-tasks; do
- ${ANSIBLE} ${ANSIBLE_VERBOSITY} \
- -i inventory/localhost \
- test-bifrost-create-vm.yaml \
- --${task}
- ${ANSIBLE} ${ANSIBLE_VERBOSITY} \
- -i inventory/localhost \
- ${TEST_PLAYBOOK} \
- --${task} \
- -e testing_user=${TESTING_USER}
-done
-
-# Create the VMS
-${ANSIBLE} ${ANSIBLE_VERBOSITY} \
- -i inventory/localhost \
- test-bifrost-create-vm.yaml \
- -e test_vm_num_nodes=${TEST_VM_NUM_NODES} \
- -e test_vm_memory_size=${VM_MEMORY_SIZE} \
- -e enable_venv=${ENABLE_VENV} \
- -e test_vm_domain_type=${VM_DOMAIN_TYPE} \
- -e ${INVENTORY_FILE_FORMAT}=${BAREMETAL_DATA_FILE}
-
-# Execute the installation and VM startup test
-${ANSIBLE} ${ANSIBLE_VERBOSITY} \
- -i inventory/bifrost_inventory.py \
- ${TEST_PLAYBOOK} \
- -e use_cirros=${USE_CIRROS} \
- -e testing_user=${TESTING_USER} \
- -e test_vm_num_nodes=${TEST_VM_NUM_NODES} \
- -e inventory_dhcp=${INVENTORY_DHCP} \
- -e inventory_dhcp_static_ip=${INVENTORY_DHCP_STATIC_IP} \
- -e enable_venv=${ENABLE_VENV} \
- -e enable_inspector=${USE_INSPECTOR} \
- -e inspect_nodes=${INSPECT_NODES} \
- -e download_ipa=${DOWNLOAD_IPA} \
- -e create_ipa_image=${CREATE_IPA_IMAGE} \
- -e write_interfaces_file=${WRITE_INTERFACES_FILE} \
- -e ipv4_gateway=192.168.122.1 \
- -e wait_timeout=${PROVISION_WAIT_TIMEOUT} \
- -e enable_keystone=false
-EXITCODE=$?
-
-if [ $EXITCODE != 0 ]; then
- echo "************************************"
- echo "Provisioning failed. See logs folder"
- echo "************************************"
-fi
-
-exit $EXITCODE
diff --git a/prototypes/bifrost/scripts/destroy-env.sh b/prototypes/bifrost/scripts/destroy-env.sh
deleted file mode 100755
index c75e814b7..000000000
--- a/prototypes/bifrost/scripts/destroy-env.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2016 RedHat and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-# We need to execute everything as root
-if [[ $(whoami) != "root" ]]; then
- echo "Error: This script must be run as root!"
- exit 1
-fi
-
-# Start fresh
-rm -rf /opt/stack
-# HOME is normally set by sudo -H
-rm -rf ${HOME}/.config/openstack
-
-# Delete all libvirt VMs and hosts from vbmc (look for a port number)
-for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
- virsh destroy $vm || true
- virsh undefine $vm || true
- vbmc delete $vm
-done
-
-service ironic-conductor stop || true
-
-echo "removing inventory files created by previous builds"
-rm -rf /tmp/baremetal.*
-
-echo "removing ironic database"
-if $(which mysql &> /dev/null); then
- mysql -u root ironic --execute "drop database ironic;"
-fi
-echo "removing leases"
-[[ -e /var/lib/misc/dnsmasq/dnsmasq.leases ]] && > /var/lib/misc/dnsmasq/dnsmasq.leases
-echo "removing logs"
-rm -rf /var/log/libvirt/baremetal_logs/*
-
-# clean up dib images only if requested explicitly
-CLEAN_DIB_IMAGES=${CLEAN_DIB_IMAGES:-false}
-
-if [ $CLEAN_DIB_IMAGES = "true" ]; then
- rm -rf /httpboot /tftpboot
- mkdir /httpboot /tftpboot
- chmod -R 755 /httpboot /tftpboot
-fi
-
-# remove VM disk images
-rm -rf /var/lib/libvirt/images/*.qcow2
-
-echo "restarting services"
-service dnsmasq restart || true
-service libvirtd restart
-service ironic-api restart || true
-service ironic-conductor start || true
-service ironic-inspector restart || true