diff --git a/bifrost/inventory.py b/bifrost/inventory.py index ffe098f14..e3ed87f26 100755 --- a/bifrost/inventory.py +++ b/bifrost/inventory.py @@ -295,22 +295,6 @@ def _process_baremetal_csv(data_source, groups, hostvars): power['ipmi_transit_address']): power['ipmi_bridging'] = 'dual' - if "ssh" in host['driver']: - # Under another model, a user would define - # and value translations to load these - # values. Since we're supporting the base - # model bifrost was developed with, then - # we need to make sure these are present as - # they are expected values. - power['ssh_virt_type'] = "virsh" - power['ssh_address'] = management_address - power['ssh_port'] = 22 - # NOTE: The CSV format is desynced from the enrollment - # playbook at present, so we're hard coding ironic here - # as that is what the test is known to work with. - power['ssh_username'] = "ironic" - power['ssh_key_filename'] = "/home/ironic/.ssh/id_rsa" - # Group variables together under host. # NOTE(TheJulia): Given the split that this demonstrates, where # deploy details could possible be imported from a future diff --git a/bifrost/tests/functional/test_inventory_functional.py b/bifrost/tests/functional/test_inventory_functional.py index eb2d44942..373a1babf 100644 --- a/bifrost/tests/functional/test_inventory_functional.py +++ b/bifrost/tests/functional/test_inventory_functional.py @@ -210,12 +210,10 @@ unused,,00000000-0000-0000-0000-000000000002,hostname1, [{"mac": "00:01:02:03:04:06"}], "properties": {"ram": "8192", "cpu_arch": "x86_64", "disk_size": "1024", "cpus": "2"}, "host_groups": ["baremetal", "nova"]}, "hostname0": - {"uuid": "00000000-0000-0000-0000-000000000001", "driver": "agent_ssh", + {"uuid": "00000000-0000-0000-0000-000000000001", "driver": "agent_ipmitool", "name": "hostname0", "ipv4_address": "192.168.1.2", "ansible_ssh_host": "192.168.1.2", "provisioning_ipv4_address": "192.168.1.2", - "driver_info": {"power": {"ssh_virt_type": "virsh", - "ssh_key_filename": "/home/ironic/.ssh/id_rsa", "ssh_username": - "ironic", "ssh_port": 22, "ssh_address": "192.0.2.2"}}, "nics": + "driver_info": {"power": {}}, "nics": [{"mac": "00:01:02:03:04:05"}], "properties": {"ram": "8192", "cpu_arch": "x86_64", "disk_size": "512", "cpus": "1"}, "host_groups": ["baremetal", "nova"]}}""".replace('\n', '') diff --git a/playbooks/inventory/baremetal.json.example b/playbooks/inventory/baremetal.json.example index cffd1a9c7..35f4f79cb 100644 --- a/playbooks/inventory/baremetal.json.example +++ b/playbooks/inventory/baremetal.json.example @@ -1,30 +1,4 @@ { - "sshexample0": { - "uuid": "00000000-0000-0000-0000-000000000001", - "driver_info": { - "power": { - "ssh_port": 22, - "ssh_username": "ironic", - "ssh_virt_type": "virsh", - "ssh_address": "192.168.122.1", - "ssh_key_filename": "/home/ironic/.ssh/id_rsa" - } - }, - "nics": [ - { - "mac": "00:00:00:f9:32:f6" - } - ], - "driver": "agent_ssh", - "ipv4_address": "192.168.122.2", - "properties": { - "cpu_arch": "x86_64", - "ram": "3072", - "disk_size": "10", - "cpus": "1" - }, - "name": "sshexample0" - }, "basicipmiexample0": { "uuid": "00000000-0000-0000-0000-000000000002", "driver_info": { diff --git a/playbooks/inventory/baremetal.yml.example b/playbooks/inventory/baremetal.yml.example index 0cece5a66..fb9f16047 100644 --- a/playbooks/inventory/baremetal.yml.example +++ b/playbooks/inventory/baremetal.yml.example @@ -1,24 +1,4 @@ --- - sshexample0: - uuid: "00000000-0000-0000-0000-000000000001" - driver_info: - power: - ssh_port: 22 - ssh_username: "ironic" - ssh_virt_type: "virsh" - ssh_address: "192.168.122.1" - ssh_key_filename: "/home/ironic/.ssh/id_rsa" - nics: - - - mac: "00:00:00:f9:32:f6" - driver: "agent_ssh" - ipv4_address: "192.168.122.2" - properties: - cpu_arch: "x86_64" - ram: "3072" - disk_size: "10" - cpus: "1" - name: "sshexample0" basicipmiexample0: uuid: "00000000-0000-0000-0000-000000000002" driver_info: diff --git a/playbooks/roles/bifrost-create-vm-nodes/README.md b/playbooks/roles/bifrost-create-vm-nodes/README.md index cf9eed65c..ed0acd45a 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/README.md +++ b/playbooks/roles/bifrost-create-vm-nodes/README.md @@ -34,11 +34,9 @@ baremetal_csv_file: Deprecated. CSV file format is deprecated, and Default is undefined. If defined, its value will be used for 'baremetal_json_file' variable (see below), although file created will still be in JSON format. - The driver assigned to nodes will be 'agent_ssh' baremetal_json_file: Defaults to '/tmp/baremetal.json' but will be overridden by 'baremetal_csv_file' if that is defined. - The driver assigned to nodes will be 'agent_ssh' test_vm_memory_size: Tunable setting to allow a user to define a specific amount of RAM in MB to allocate to guest/test VMs. diff --git a/playbooks/roles/bifrost-ironic-install/README.md b/playbooks/roles/bifrost-ironic-install/README.md index a1dd0011c..52256a356 100644 --- a/playbooks/roles/bifrost-ironic-install/README.md +++ b/playbooks/roles/bifrost-ironic-install/README.md @@ -19,7 +19,7 @@ Role Variables -------------- Testing mode is intended to help facilitate testing of the bifrost roles and -ironic by utilizing virtual machines on the localhost and the agent_ssh +ironic by utilizing virtual machines on the localhost and the agent_ipmitool driver. This variable should be set globally for playbooks utilizing the bifrost-ironic-install role. @@ -84,7 +84,7 @@ In case your HW needs a kernel option to boot, set the following variable: extra_kernel_options: Default undefined. -When testing, the default ironic conductor driver is "agent_ssh". When +When testing, the default ironic conductor driver is "agent_ipmitool". When testing mode has not been engaged, drivers can be set via the enabled_drivers variable which defaults to: "agent_ipmitool,agent_ilo,agent_ucs" diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 2d98786dd..77744a25e 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -172,7 +172,7 @@ download_ipxe: false enable_pxe_drivers: true # Comma-separated list of PXE drivers to enable when # enable_pxe_drivers is set to true -pxe_drivers: "pxe_ssh,pxe_ipmitool,pxe_ilo" +pxe_drivers: "pxe_ipmitool,pxe_ilo" # Settings related to installing bifrost in a virtual environment enable_venv: false diff --git a/releasenotes/notes/nossh-16577ec5c3b82594.yaml b/releasenotes/notes/nossh-16577ec5c3b82594.yaml index 3c2d793ea..4eb853659 100644 --- a/releasenotes/notes/nossh-16577ec5c3b82594.yaml +++ b/releasenotes/notes/nossh-16577ec5c3b82594.yaml @@ -1,11 +1,10 @@ --- features: - | - Bifrost starts to phase out support of SSH power and management drivers - in ironic as these drivers are unsupported and targeted for removal - from ironic in Pike release. + Bifrost has removed support for Ironic's SSH based power and management + drivers, as a result of Ironic removing the drivers altogether. - Bifrost testing is moved to ``ipmitools``-based ironic drivers and + Bifrost testing has moved to ``ipmitools``-based ironic drivers and virtual hardware exposed via 'virtualbmc' utility. Default ironic drivers set up by bifrost are changed to @@ -13,10 +12,10 @@ features: Default driver for CSV baremetal data files in bifrost's dynamic inventory is changed to ``agent_ipmitool``. - - ``bifrost-ironic-install`` role is decoupled from libvirt, and - all preparation for testing with 'virtual' hardware are now handled in - ``bifrost-create-vm-nodes`` role. + - | + Moves all preparation for testing with 'virtual' hardware to the + ``bifrost-create-vm-nodes`` role, and libvirt interactions have + been decoupled from the ``bifrost-ironic-install`` role. upgrade: - | Default ironic drivers set up by bifrost are changed to @@ -29,5 +28,5 @@ upgrade: driver in CSV baremetal data file. deprecations: - | - Handling of ``*_ssh`` drivers for CSV baremetal data format is - deprecated and will be removed in Queens release. + Handling of ``*_ssh`` drivers for CSV baremetal data format has + been removed as the drivers have been removed from ironic. diff --git a/tools/create_vm_nodes.sh b/tools/create_vm_nodes.sh deleted file mode 100755 index f903a7509..000000000 --- a/tools/create_vm_nodes.sh +++ /dev/null @@ -1,233 +0,0 @@ -#!/bin/bash -############################################################################# -# create_nodes.sh - Script to create VM nodes for use with Ironic. -# -# PURPOSE -# This script can be used to create VM instances without an operating -# system and that are ready for netbooting. They are connected to the -# bridge named 'brbm' (created if it does not exist). -# -# EXAMPLE USAGE -# # Use defaults - Create a single node with base name of 'testvm' -# sudo create_nodes.sh -# -# # Create 5 nodes -# sudo NODECOUNT=5 create_nodes.sh -# -# # Create 3 nodes with base name of 'junk' -# sudo NODEBASE=junk NODECOUNT=3 create_nodes.sh -# -# # Write out the csv file -# sudo OUTFILE=/path/to/file.csv create_nodes.sh -# -# THANKS -# Thanks to the author(s) of the Ironic supporting code within devstack, -# from which all of this is derived. -# -# AUTHOR -# David Shrewsbury (shrewsbury.dave@gmail.com) -############################################################################# - - -set -e # exit immediately on command error -set -u # treat unset variables as error when substituting - - -LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"} -export VIRSH_DEFAULT_CONNECT_URI="$LIBVIRT_CONNECT_URI" - -# VM specs -VM_EMULATOR=${VM_EMULATOR:-/usr/bin/qemu-system-x86_64} -VM_CPU=${VM_CPU:-1} -VM_RAM=${VM_RAM:-3072} -VM_DISK=${VM_DISK:-10} - -# VM network -VM_NET_BRIDGE=${VM_NET_BRIDGE:-default} - -# VM logging directory -VM_LOGDIR=/var/log/libvirt/baremetal_logs - -CSV_OUTPUT="CSV entries:" - -############################################################################# -# FUNCTION -# create_node -# -# PARAMETERS -# $1: Virtual machine name -# $2: Number of CPUs for the VM -# $3: Amount of RAM for the VM -# $4: Disk size (in GB) for the VM -# $5: CPU architecture (i386 or amd64) -# $6: Network bridge for the VMs -# $7: Path to VM emulator -# $8: Logging directory for the VMs -############################################################################# -function create_node { - NAME=$1 - CPU=$2 - MEM=$(( 1024 * $3 )) - # extra G to allow fuzz for partition table : flavor size and registered size - # need to be different to actual size. - DISK=$(( $4 + 1)) - - case $5 in - i386) ARCH='i686' ;; - amd64) ARCH='x86_64' ;; - *) echo "Unsupported arch $5!" ; exit 1 ;; - esac - - BRIDGE=$6 - EMULATOR=$7 - LOGDIR=$8 - - LIBVIRT_NIC_DRIVER=${LIBVIRT_NIC_DRIVER:-"e1000"} - LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"} - LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"} - - if ! virsh pool-list --all | grep -q $LIBVIRT_STORAGE_POOL; then - virsh pool-define-as --name $LIBVIRT_STORAGE_POOL dir --target /var/lib/libvirt/images >&2 - virsh pool-autostart $LIBVIRT_STORAGE_POOL >&2 - virsh pool-start $LIBVIRT_STORAGE_POOL >&2 - fi - - pool_state=$(virsh pool-info $LIBVIRT_STORAGE_POOL | grep State | awk '{ print $2 }') - if [ "$pool_state" != "running" ] ; then - [ ! -d /var/lib/libvirt/images ] && mkdir /var/lib/libvirt/images - virsh pool-start $LIBVIRT_STORAGE_POOL >&2 - fi - - if [ -n "$LOGDIR" ] ; then - mkdir -p "$LOGDIR" - fi - - PREALLOC= - if [ -f /etc/debian_version ]; then - PREALLOC="--prealloc-metadata" - fi - - VM_LOGGING="$LOGDIR/${NAME}_console.log" - VOL_NAME="${NAME}.qcow2" - - if ! virsh list --all | grep -q $NAME; then - virsh vol-list --pool $LIBVIRT_STORAGE_POOL | grep -q $VOL_NAME && - virsh vol-delete $VOL_NAME --pool $LIBVIRT_STORAGE_POOL >&2 - virsh vol-create-as $LIBVIRT_STORAGE_POOL ${VOL_NAME} ${DISK}G --format qcow2 $PREALLOC >&2 - volume_path=$(virsh vol-path --pool $LIBVIRT_STORAGE_POOL $VOL_NAME) - # Pre-touch the VM to set +C, as it can only be set on empty files. - touch "$volume_path" - chattr +C "$volume_path" || true - - vm_xml=" - - ${NAME} - ${MEM} - ${CPU} - - hvm - - - - - - - - - - - destroy - restart - restart - - ${EMULATOR} - - - - -
- - -
- - - - - - -