Small updates: create raw images, change tempest config
Related-PROD: PROD-37187
Change-Id: I3fb259b7a16753fcaad009b8138e909fd66e1774
diff --git a/k8s/workspace/update-openstack-resources.sh b/k8s/workspace/update-openstack-resources.sh
index 75d1216..e292bda 100644
--- a/k8s/workspace/update-openstack-resources.sh
+++ b/k8s/workspace/update-openstack-resources.sh
@@ -50,6 +50,17 @@
sed -i "s/volume_type_name/${TEMPEST_CUSTOM_VOLUME_TYPE}/g" $MY_PROJFOLDER/yamls/tempest_custom.yaml
echo " "
+echo "# Checking Neutron global physnet mtu value"
+global_physnet_mtu=""
+global_physnet_mtu=$(kubectl get osdpl -A -o wide -o yaml | grep global_physnet_mtu | tail -n1 | cut -d':' -f2 | tr -d ' ')
+if [ -n "$global_physnet_mtu" ]; then
+ echo "global_physnet_mtu is set to: $global_physnet_mtu"
+ cat <<EOF >> $MY_PROJFOLDER/yamls/tempest_custom.yaml
+neutron_plugin_options:
+ max_mtu: $global_physnet_mtu
+EOF
+fi
+
echo "# Updating SPT global_config.yaml"
cp -v /opt/res-files/k8s/yamls/spt_global_config.yaml.clean $MY_PROJFOLDER/yamls/global_config.yaml
echo "# image_ref_name -> ${ubuntu20_name}"
diff --git a/k8s/yamls/tempest_custom.yaml.clean b/k8s/yamls/tempest_custom.yaml.clean
index 5db71af..6a65e4f 100644
--- a/k8s/yamls/tempest_custom.yaml.clean
+++ b/k8s/yamls/tempest_custom.yaml.clean
@@ -7,7 +7,6 @@
disable_ssl_certificate_validation: true
compute:
volume_device_name: vdb
- compute_volume_common_az: nova
heat_plugin:
floating_network_name: public_net_name
network_for_ssh: public_net_name
@@ -18,5 +17,4 @@
network-feature-enabled:
floating_ips: true
volume:
- volume_type: volume_type_name
- volume_type_multiattach: volume_type_name
\ No newline at end of file
+ volume_type: volume_type_name
\ No newline at end of file
diff --git a/scripts/prepare.sh b/scripts/prepare.sh
index 0a04eec..fbf2abc 100644
--- a/scripts/prepare.sh
+++ b/scripts/prepare.sh
@@ -10,6 +10,7 @@
rcfile=${name_prefix}rc
huge_pages=false
set_gw_heat_router=false
+raw_disk_format=false
logfile=prepare.log
working_folder=$(pwd)
@@ -66,10 +67,11 @@
printf "\t-H\t\tAdds '--property hw:mem_page_size=large' to flavors, i.e. huge_pages for DPDK\n"
printf "\t-w <path>\tSets working folder (default: ${working_folder})\n"
printf "\t-g\t\tTo set external_gateway_info to heat-router with the external network (if not set yet)\n"
+ printf "\t-r\t\tTo create the images in RAW disk format instead of the QCOW2\n"
}
OPTIND=1 # Reset in case getopts has been used previously in the shell.
-while getopts ":gHw:h?" opt; do
+while getopts ":grHw:h?" opt; do
case "$opt" in
h|\?)
show_help
@@ -84,6 +86,9 @@
g) set_gw_heat_router=true
printf "# Setting external_gateway_info to heat-router with the external network (if not set yet)\n\n"
;;
+ r) raw_disk_format=true
+ printf "# Creating the images in RAW disk format instead of the QCOW2\n"
+ ;;
esac
done
@@ -384,8 +389,15 @@
fi
# check if output is not empty
if [ ${#r} -eq 0 ]; then
+ if [ "$raw_disk_format" = true ]; then
+ qemu-img convert -f qcow2 -O raw ${!name} ${!name}.raw
+ image_id=$(openstack image create --public --disk-format raw --container-format bare --file ${!name}.raw ${!name} -c id -f value)
+ echo "-> created ${!name} (${image_id})"
+ rm ${!name}.raw
+ else
image_id=$(openstack image create --public --disk-format qcow2 --container-format bare --file ${!name} ${!name} -c id -f value)
echo "-> created ${!name} (${image_id})"
+ fi
else
printf "\n-> Error detected, creation skipped\n"
fi