Quick start with bifrost-cli¶
If you want to try Bifrost on virtual machines instead of real hardware, you
need to prepare a testing environment. The easiest way is via
available since the Victoria release series:
Additionally, the following parameters can be useful:
Install services in develop mode, so that the changes to the repositories in
/optget immediately reflected in the virtual environment.
You still need to restart services to apply any changes, e.g.:
sudo systemctl restart ironic-conductor
Choose the default driver for the generated nodes inventory.
Makes the testing VMs boot with UEFI.
See the built-in documentation for more details:
./bifrost-cli testenv --help
The command generates two files with node inventory in the current directory:
baremetal-inventory.jsoncan be used with the provided playbooks, see How-To for details.
baremetal-nodes.jsoncan be used with the Ironic enrollment command:
export OS_CLOUD=bifrost baremetal create baremetal-nodes.json
Reproduce CI testing locally¶
scripts/test-bifrost.sh script can be utilized to install
pre-requisite software packages, Ansible, and then execute the
test-bifrost.yaml playbooks in order
to provide a single step testing mechanism.
playbooks/test-bifrost-create-vm.yaml creates one or more VMs for
testing and saves out a baremetal.json file which is used by
playbooks/test-bifrost.yaml to execute the remaining roles. Two
additional roles are invoked by this playbook which enables Ansible to
connect to the new nodes by adding them to the inventory, and then
logging into the remote machine via the user’s ssh host key. Once
that has successfully occurred, additional roles will unprovision the
host(s) and delete them from ironic.
In order to cap requirements for installation, an
upper_constraints_filesetting is defined. This is consuming the
TOX_CONSTRAINTS_FILEenv var by default, to properly integrate with CI systems, and will default to
/opt/stack/requirements/upper-constraints.txtfile if not present.
Manually test with Virtual Machines¶
Bifrost supports using virtual machines to emulate the hardware.
testingto true in the
You may need to adjust the value for
ansible-playbook -vvvv -i inventory/target test-bifrost-create-vm.yamlcommand to create a test virtual machine.
Run the install step, as documented in Bifrost Installation, however adding
-e testing=trueto the Ansible command line.
Set the environment variable of
BIFROST_INVENTORY_SOURCEto the path to the JSON file, which by default has been written to
Run the enrollment step, using the JSON file you created in the previous step.
Run the deployment step, as documented in Deploy Hardware.