Merge "Don't use token for glance & check for some unset vars"
This commit is contained in:
commit
ff43e84522
@ -475,6 +475,7 @@ function init_ironic {
|
|||||||
# Save private network as cleaning network
|
# Save private network as cleaning network
|
||||||
local cleaning_network_uuid
|
local cleaning_network_uuid
|
||||||
cleaning_network_uuid=$(neutron net-list | grep private | get_field 1)
|
cleaning_network_uuid=$(neutron net-list | grep private | get_field 1)
|
||||||
|
die_if_not_set $LINENO cleaning_network_uuid "Failed to get ironic cleaning network id"
|
||||||
iniset $IRONIC_CONF_FILE neutron cleaning_network_uuid ${cleaning_network_uuid}
|
iniset $IRONIC_CONF_FILE neutron cleaning_network_uuid ${cleaning_network_uuid}
|
||||||
|
|
||||||
# (Re)create ironic database
|
# (Re)create ironic database
|
||||||
@ -548,20 +549,24 @@ function stop_ironic {
|
|||||||
function create_ovs_taps {
|
function create_ovs_taps {
|
||||||
local ironic_net_id
|
local ironic_net_id
|
||||||
ironic_net_id=$(neutron net-list | grep private | get_field 1)
|
ironic_net_id=$(neutron net-list | grep private | get_field 1)
|
||||||
|
die_if_not_set $LINENO ironic_net_id "Failed to get ironic network id"
|
||||||
|
|
||||||
# Work around: No netns exists on host until a Neutron port is created. We
|
# Work around: No netns exists on host until a Neutron port is created. We
|
||||||
# need to create one in Neutron to know what netns to tap into prior to the
|
# need to create one in Neutron to know what netns to tap into prior to the
|
||||||
# first node booting.
|
# first node booting.
|
||||||
local port_id
|
local port_id
|
||||||
port_id=$(neutron port-create private | grep " id " | get_field 2)
|
port_id=$(neutron port-create private | grep " id " | get_field 2)
|
||||||
|
die_if_not_set $LINENO port_id "Failed to create neutron port"
|
||||||
|
|
||||||
# intentional sleep to make sure the tag has been set to port
|
# intentional sleep to make sure the tag has been set to port
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
local tapdev
|
local tapdev
|
||||||
tapdev=$(sudo ip netns exec qdhcp-${ironic_net_id} ip link list | grep " tap" | cut -d':' -f2 | cut -d'@' -f1 | cut -b2-)
|
tapdev=$(sudo ip netns exec qdhcp-${ironic_net_id} ip link list | grep " tap" | cut -d':' -f2 | cut -d'@' -f1 | cut -b2-)
|
||||||
|
die_if_not_set $LINENO tapdev "Failed to get tap device id"
|
||||||
local tag_id
|
local tag_id
|
||||||
tag_id=$(sudo ovs-vsctl show |grep ${tapdev} -A1 -m1 | grep tag | cut -d':' -f2 | cut -b2-)
|
tag_id=$(sudo ovs-vsctl show |grep ${tapdev} -A1 -m1 | grep tag | cut -d':' -f2 | cut -b2-)
|
||||||
|
die_if_not_set $LINENO tag_id "Failed to get tag id"
|
||||||
|
|
||||||
# make sure veth pair is not existing, otherwise delete its links
|
# make sure veth pair is not existing, otherwise delete its links
|
||||||
sudo ip link show ovs-tap1 && sudo ip link delete ovs-tap1
|
sudo ip link show ovs-tap1 && sudo ip link delete ovs-tap1
|
||||||
@ -926,27 +931,22 @@ function upload_baremetal_ironic_deploy {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local token
|
|
||||||
token=$(openstack token issue -c id -f value)
|
|
||||||
die_if_not_set $LINENO token "Keystone fail to get token"
|
|
||||||
|
|
||||||
# load them into glance
|
# load them into glance
|
||||||
IRONIC_DEPLOY_KERNEL_ID=$(openstack \
|
IRONIC_DEPLOY_KERNEL_ID=$(openstack \
|
||||||
--os-token $token \
|
|
||||||
--os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT \
|
|
||||||
image create \
|
image create \
|
||||||
$(basename $IRONIC_DEPLOY_KERNEL_PATH) \
|
$(basename $IRONIC_DEPLOY_KERNEL_PATH) \
|
||||||
--public --disk-format=aki \
|
--public --disk-format=aki \
|
||||||
--container-format=aki \
|
--container-format=aki \
|
||||||
< $IRONIC_DEPLOY_KERNEL_PATH | grep ' id ' | get_field 2)
|
< $IRONIC_DEPLOY_KERNEL_PATH | grep ' id ' | get_field 2)
|
||||||
|
die_if_not_set $LINENO IRONIC_DEPLOY_KERNEL_ID "Failed to load kernel image into glance"
|
||||||
|
|
||||||
IRONIC_DEPLOY_RAMDISK_ID=$(openstack \
|
IRONIC_DEPLOY_RAMDISK_ID=$(openstack \
|
||||||
--os-token $token \
|
|
||||||
--os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT \
|
|
||||||
image create \
|
image create \
|
||||||
$(basename $IRONIC_DEPLOY_RAMDISK_PATH) \
|
$(basename $IRONIC_DEPLOY_RAMDISK_PATH) \
|
||||||
--public --disk-format=ari \
|
--public --disk-format=ari \
|
||||||
--container-format=ari \
|
--container-format=ari \
|
||||||
< $IRONIC_DEPLOY_RAMDISK_PATH | grep ' id ' | get_field 2)
|
< $IRONIC_DEPLOY_RAMDISK_PATH | grep ' id ' | get_field 2)
|
||||||
|
die_if_not_set $LINENO IRONIC_DEPLOY_RAMDISK_ID "Failed to load ramdisk image into glance"
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepare_baremetal_basic_ops {
|
function prepare_baremetal_basic_ops {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user