-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuploadimage.sh
More file actions
executable file
·20 lines (17 loc) · 887 Bytes
/
uploadimage.sh
File metadata and controls
executable file
·20 lines (17 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo '================================================================================='
echo 'Script usage: ./uploadimage.sh disk-format image-version file-location image-name'
echo '---------------------------------------------------------------------------------'
echo 'diskformats : raw, qcow2, vhd, iso'
echo 'image-version: The version for the new image'
echo 'file-location: The location of the image you want to upload'
echo 'image-name : The name you want it to have on OpenStack'
echo '================================================================================='
exit 1
fi
diskformat="$1"
imageversion="$2"
imagelocation="$3"
imagename="$4"
openstack image create --container-format bare --disk-format "$diskformat" --property os_version="$imageversion" --file "$imagelocation" "$imagename"