Removing ssh driver references
The ssh drivers are gone, long live the ssh drivers~ Removing from the optional drivers list entry for pxe drivers, removed from tests, examples, role documentation and the helper script that is not used for testing, since it is completely outdated at this point since we've been using the role for quite a long time. Change-Id: Ibafc4db4b326aafef80660be35ecd1dbad57cb51
This commit is contained in:
parent
bc0a12dfff
commit
631717d92a
@ -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
|
||||
|
@ -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', '')
|
||||
|
@ -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": {
|
||||
|
@ -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:
|
||||
|
@ -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.
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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="
|
||||
<domain type='qemu'>
|
||||
<name>${NAME}</name>
|
||||
<memory unit='KiB'>${MEM}</memory>
|
||||
<vcpu>${CPU}</vcpu>
|
||||
<os>
|
||||
<type arch='${ARCH}' machine='pc-1.0'>hvm</type>
|
||||
<boot dev='network'/>
|
||||
<bootmenu enable='no'/>
|
||||
<bios useserial='yes'/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<devices>
|
||||
<emulator>${EMULATOR}</emulator>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='qemu' type='qcow2' cache='writeback'/>
|
||||
<source file='${volume_path}'/>
|
||||
<target dev='vda' bus='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
||||
</disk>
|
||||
<controller type='ide' index='0'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||
</controller>
|
||||
<interface type='network'>
|
||||
<source network='${BRIDGE}'/>
|
||||
</interface>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='9216' heads='1'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
</video>
|
||||
<serial type='file'>
|
||||
<source path='${VM_LOGGING}'/>
|
||||
<target port='0'/>
|
||||
<alias name='serial0'/>
|
||||
</serial>
|
||||
<serial type='pty'>
|
||||
<source path='/dev/pts/49'/>
|
||||
<target port='1'/>
|
||||
<alias name='serial1'/>
|
||||
</serial>
|
||||
<console type='file'>
|
||||
<source path='${VM_LOGGING}'/>
|
||||
<target type='serial' port='0'/>
|
||||
<alias name='serial0'/>
|
||||
</console>
|
||||
<memballoon model='virtio'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||
</memballoon>
|
||||
</devices>
|
||||
</domain>
|
||||
"
|
||||
|
||||
echo ${vm_xml} > /tmp/vm.xml
|
||||
virsh create /tmp/vm.xml 2>&1 >/dev/null
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
echo "failed to create VM $NAME"
|
||||
rm -f /tmp/vm.xml
|
||||
exit 1
|
||||
fi
|
||||
rm -f /tmp/vm.xml
|
||||
|
||||
fi
|
||||
|
||||
# echo mac
|
||||
local macaddr=`virsh dumpxml $NAME | grep "mac address" | head -1 | cut -d\' -f2`
|
||||
|
||||
echo $macaddr
|
||||
}
|
||||
|
||||
|
||||
####################
|
||||
# Main script code
|
||||
####################
|
||||
|
||||
NODEBASE=${NODEBASE:-testvm}
|
||||
NODECOUNT=${NODECOUNT:-1}
|
||||
|
||||
# must be root
|
||||
user=`whoami`
|
||||
if [ "$user" != "root" ]
|
||||
then
|
||||
echo "Must be run as root. You are $user."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CSV_LINES=()
|
||||
IFS=$'\n'
|
||||
for (( i=1; i<=${NODECOUNT}; i++ ))
|
||||
do
|
||||
name=${NODEBASE}${i}
|
||||
mac=$(create_node $name $VM_CPU $VM_RAM $VM_DISK amd64 $VM_NET_BRIDGE $VM_EMULATOR $VM_LOGDIR)
|
||||
|
||||
CSV_LINES+=("$mac,root,undefined,192.168.122.1,$VM_CPU,$VM_RAM,$VM_DISK,flavor,type,a8cb6624-0d9f-c882-affc-046ebb96ec0${i},$name,192.168.122.$((i+1)),,,,agent_ssh")
|
||||
done
|
||||
|
||||
echo ${CSV_OUTPUT}
|
||||
echo -e "${CSV_LINES[*]}"
|
||||
|
||||
if [ $OUTFILE ]; then
|
||||
echo -e "${CSV_LINES[*]}" > $OUTFILE
|
||||
fi
|
Loading…
Reference in New Issue
Block a user