Merge "Add vmedia boot support for deploy-ironic element"

This commit is contained in:
Jenkins 2014-09-15 16:07:09 +00:00 committed by Gerrit Code Review
commit 7ec2c7cdc4
2 changed files with 18 additions and 7 deletions

View File

@ -26,11 +26,19 @@ if [ $? -ne 0 ]; then
troubleshoot troubleshoot
fi fi
TOKEN_FILE=token-$DEPLOYMENT_ID if [ "$BOOT_METHOD" = "$VMEDIA_BOOT_TAG" ]; then
TOKEN_FILE="$VMEDIA_DIR/token"
if [ -f "$TOKEN_FILE" ]; then
TOKEN_HEADER="-H 'X-Auth-Token: $(cat $TOKEN_FILE)'"
else TOKEN_HEADER=""
fi
else
TOKEN_FILE=token-$DEPLOYMENT_ID
if tftp -r $TOKEN_FILE -g $BOOT_SERVER if tftp -r $TOKEN_FILE -g $BOOT_SERVER
then TOKEN_HEADER="-H 'X-Auth-Token: `cat $TOKEN_FILE`'" then TOKEN_HEADER="-H 'X-Auth-Token: $(cat $TOKEN_FILE)'"
else TOKEN_HEADER="" else TOKEN_HEADER=""
fi
fi fi
DATA="'{\"address\":\"$BOOT_IP_ADDRESS\",\"key\":\"$DEPLOYMENT_KEY\",\"iqn\":\"$ISCSI_TARGET_IQN\",\"error\":\"$FIRST_ERR_MSG\"}'" DATA="'{\"address\":\"$BOOT_IP_ADDRESS\",\"key\":\"$DEPLOYMENT_KEY\",\"iqn\":\"$ISCSI_TARGET_IQN\",\"error\":\"$FIRST_ERR_MSG\"}'"

View File

@ -105,10 +105,13 @@ readonly _BOOTIF_=$(get_kernel_parameter BOOTIF)
readonly _IP_=$(get_kernel_parameter ip) readonly _IP_=$(get_kernel_parameter ip)
readonly BOOT_MAC_ADDRESS=$(echo "$_BOOTIF_" | sed -e "s/-/:/g" | \ readonly BOOT_MAC_ADDRESS=$(echo "$_BOOTIF_" | sed -e "s/-/:/g" | \
sed -e "s/^01://g" | tr 'a-f' 'A-F') sed -e "s/^01://g" | tr 'a-f' 'A-F')
readonly BOOT_IP_ADDRESS=$(echo "$_IP_" | cut -d':' -f1)
readonly BOOT_SERVER=$(echo "$_IP_" | cut -d':' -f2) readonly BOOT_SERVER=$(echo "$_IP_" | cut -d':' -f2)
readonly BOOT_NETMASK=$(echo "$_IP_" | cut -d':' -f4)
readonly BOOT_GATEWAY=$(echo "$_IP_" | cut -d':' -f3) # IP address, netmask, gateway can be set a later point of time if
# IP address is assigned by dhcp (for non-pxe boots).
BOOT_IP_ADDRESS=$(echo "$_IP_" | cut -d':' -f1)
BOOT_NETMASK=$(echo "$_IP_" | cut -d':' -f4)
BOOT_GATEWAY=$(echo "$_IP_" | cut -d':' -f3)
readonly DISK=$(get_kernel_parameter disk) readonly DISK=$(get_kernel_parameter disk)