|
...
|
...
|
@@ -1102,6 +1102,47 @@ if is_service_enabled glance; then
|
|
1102
|
1102
|
start_glance
|
|
1103
|
1103
|
fi
|
|
1104
|
1104
|
|
|
|
1105
|
+# Install Images
|
|
|
1106
|
+# ==============
|
|
|
1107
|
+
|
|
|
1108
|
+# Upload an image to glance.
|
|
|
1109
|
+#
|
|
|
1110
|
+# The default image is cirros, a small testing image which lets you login as **root**
|
|
|
1111
|
+# cirros has a ``cloud-init`` analog supporting login via keypair and sending
|
|
|
1112
|
+# scripts as userdata.
|
|
|
1113
|
+# See https://help.ubuntu.com/community/CloudInit for more on cloud-init
|
|
|
1114
|
+#
|
|
|
1115
|
+# Override ``IMAGE_URLS`` with a comma-separated list of UEC images.
|
|
|
1116
|
+# * **precise**: http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz
|
|
|
1117
|
+
|
|
|
1118
|
+if is_service_enabled g-reg; then
|
|
|
1119
|
+ TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
|
|
|
1120
|
+ die_if_not_set $LINENO TOKEN "Keystone fail to get token"
|
|
|
1121
|
+
|
|
|
1122
|
+ if is_baremetal; then
|
|
|
1123
|
+ echo_summary "Creating and uploading baremetal images"
|
|
|
1124
|
+
|
|
|
1125
|
+ # build and upload separate deploy kernel & ramdisk
|
|
|
1126
|
+ upload_baremetal_deploy $TOKEN
|
|
|
1127
|
+
|
|
|
1128
|
+ # upload images, separating out the kernel & ramdisk for PXE boot
|
|
|
1129
|
+ for image_url in ${IMAGE_URLS//,/ }; do
|
|
|
1130
|
+ upload_baremetal_image $image_url $TOKEN
|
|
|
1131
|
+ done
|
|
|
1132
|
+ else
|
|
|
1133
|
+ echo_summary "Uploading images"
|
|
|
1134
|
+
|
|
|
1135
|
+ # Option to upload legacy ami-tty, which works with xenserver
|
|
|
1136
|
+ if [[ -n "$UPLOAD_LEGACY_TTY" ]]; then
|
|
|
1137
|
+ IMAGE_URLS="${IMAGE_URLS:+${IMAGE_URLS},}https://github.com/downloads/citrix-openstack/warehouse/tty.tgz"
|
|
|
1138
|
+ fi
|
|
|
1139
|
+
|
|
|
1140
|
+ for image_url in ${IMAGE_URLS//,/ }; do
|
|
|
1141
|
+ upload_image $image_url $TOKEN
|
|
|
1142
|
+ done
|
|
|
1143
|
+ fi
|
|
|
1144
|
+fi
|
|
|
1145
|
+
|
|
1105
|
1146
|
# Create an access key and secret key for nova ec2 register image
|
|
1106
|
1147
|
if is_service_enabled key && is_service_enabled swift3 && is_service_enabled nova; then
|
|
1107
|
1148
|
NOVA_USER_ID=$(keystone user-list | grep ' nova ' | get_field 1)
|
|
...
|
...
|
@@ -1207,47 +1248,6 @@ if is_service_enabled nova && is_service_enabled key; then
|
|
1207
|
1207
|
fi
|
|
1208
|
1208
|
|
|
1209
|
1209
|
|
|
1210
|
|
-# Install Images
|
|
1211
|
|
-# ==============
|
|
1212
|
|
-
|
|
1213
|
|
-# Upload an image to glance.
|
|
1214
|
|
-#
|
|
1215
|
|
-# The default image is cirros, a small testing image which lets you login as **root**
|
|
1216
|
|
-# cirros has a ``cloud-init`` analog supporting login via keypair and sending
|
|
1217
|
|
-# scripts as userdata.
|
|
1218
|
|
-# See https://help.ubuntu.com/community/CloudInit for more on cloud-init
|
|
1219
|
|
-#
|
|
1220
|
|
-# Override ``IMAGE_URLS`` with a comma-separated list of UEC images.
|
|
1221
|
|
-# * **precise**: http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz
|
|
1222
|
|
-
|
|
1223
|
|
-if is_service_enabled g-reg; then
|
|
1224
|
|
- TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
|
|
1225
|
|
- die_if_not_set $LINENO TOKEN "Keystone fail to get token"
|
|
1226
|
|
-
|
|
1227
|
|
- if is_baremetal; then
|
|
1228
|
|
- echo_summary "Creating and uploading baremetal images"
|
|
1229
|
|
-
|
|
1230
|
|
- # build and upload separate deploy kernel & ramdisk
|
|
1231
|
|
- upload_baremetal_deploy $TOKEN
|
|
1232
|
|
-
|
|
1233
|
|
- # upload images, separating out the kernel & ramdisk for PXE boot
|
|
1234
|
|
- for image_url in ${IMAGE_URLS//,/ }; do
|
|
1235
|
|
- upload_baremetal_image $image_url $TOKEN
|
|
1236
|
|
- done
|
|
1237
|
|
- else
|
|
1238
|
|
- echo_summary "Uploading images"
|
|
1239
|
|
-
|
|
1240
|
|
- # Option to upload legacy ami-tty, which works with xenserver
|
|
1241
|
|
- if [[ -n "$UPLOAD_LEGACY_TTY" ]]; then
|
|
1242
|
|
- IMAGE_URLS="${IMAGE_URLS:+${IMAGE_URLS},}https://github.com/downloads/citrix-openstack/warehouse/tty.tgz"
|
|
1243
|
|
- fi
|
|
1244
|
|
-
|
|
1245
|
|
- for image_url in ${IMAGE_URLS//,/ }; do
|
|
1246
|
|
- upload_image $image_url $TOKEN
|
|
1247
|
|
- done
|
|
1248
|
|
- fi
|
|
1249
|
|
-fi
|
|
1250
|
|
-
|
|
1251
|
1210
|
# If we are running nova with baremetal driver, there are a few
|
|
1252
|
1211
|
# last-mile configuration bits to attend to, which must happen
|
|
1253
|
1212
|
# after n-api and n-sch have started.
|