...
|
...
|
@@ -71,7 +71,7 @@ function upload_image {
|
71
|
71
|
# OpenVZ-format images are provided as .tar.gz, but not decompressed prior to loading
|
72
|
72
|
if [[ "$image_url" =~ 'openvz' ]]; then
|
73
|
73
|
image_name="${image_fname%.tar.gz}"
|
74
|
|
- openstack --os-token $token --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image create "$image_name" --public --container-format ami --disk-format ami < "${image}"
|
|
74
|
+ openstack --os-cloud=devstack-admin image create "$image_name" --public --container-format ami --disk-format ami < "${image}"
|
75
|
75
|
return
|
76
|
76
|
fi
|
77
|
77
|
|
...
|
...
|
@@ -182,7 +182,7 @@ function upload_image {
|
182
|
182
|
vmdk_adapter_type="${props[1]:-$vmdk_adapter_type}"
|
183
|
183
|
vmdk_net_adapter="${props[2]:-$vmdk_net_adapter}"
|
184
|
184
|
|
185
|
|
- openstack --os-token $token --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image create "$image_name" --public --container-format bare --disk-format vmdk --property vmware_disktype="$vmdk_disktype" --property vmware_adaptertype="$vmdk_adapter_type" --property hw_vif_model="$vmdk_net_adapter" < "${image}"
|
|
185
|
+ openstack --os-cloud=devstack-admin image create "$image_name" --public --container-format bare --disk-format vmdk --property vmware_disktype="$vmdk_disktype" --property vmware_adaptertype="$vmdk_adapter_type" --property hw_vif_model="$vmdk_net_adapter" < "${image}"
|
186
|
186
|
return
|
187
|
187
|
fi
|
188
|
188
|
|
...
|
...
|
@@ -199,8 +199,7 @@ function upload_image {
|
199
|
199
|
force_vm_mode="--property vm_mode=xen"
|
200
|
200
|
fi
|
201
|
201
|
openstack \
|
202
|
|
- --os-token $token \
|
203
|
|
- --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT \
|
|
202
|
+ --os-cloud=devstack-admin \
|
204
|
203
|
image create \
|
205
|
204
|
"$image_name" --public \
|
206
|
205
|
--container-format=ovf --disk-format=vhd \
|
...
|
...
|
@@ -214,8 +213,7 @@ function upload_image {
|
214
|
214
|
if [[ "$image_url" =~ '.xen-raw.tgz' ]]; then
|
215
|
215
|
image_name="${image_fname%.xen-raw.tgz}"
|
216
|
216
|
openstack \
|
217
|
|
- --os-token $token \
|
218
|
|
- --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT \
|
|
217
|
+ --os-cloud=devstack-admin \
|
219
|
218
|
image create \
|
220
|
219
|
"$image_name" --public \
|
221
|
220
|
--container-format=tgz --disk-format=raw \
|
...
|
...
|
@@ -231,8 +229,7 @@ function upload_image {
|
231
|
231
|
fi
|
232
|
232
|
|
233
|
233
|
openstack \
|
234
|
|
- --os-token $token \
|
235
|
|
- --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT \
|
|
234
|
+ --os-cloud=devstack-admin \
|
236
|
235
|
image create \
|
237
|
236
|
"$image_name" --public \
|
238
|
237
|
--container-format=bare --disk-format=ploop \
|
...
|
...
|
@@ -314,9 +311,9 @@ function upload_image {
|
314
|
314
|
|
315
|
315
|
if [ "$container_format" = "bare" ]; then
|
316
|
316
|
if [ "$unpack" = "zcat" ]; then
|
317
|
|
- openstack --os-token $token --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image create "$image_name" $img_property --public --container-format=$container_format --disk-format $disk_format < <(zcat --force "${image}")
|
|
317
|
+ openstack --os-cloud=devstack-admin image create "$image_name" $img_property --public --container-format=$container_format --disk-format $disk_format < <(zcat --force "${image}")
|
318
|
318
|
else
|
319
|
|
- openstack --os-token $token --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image create "$image_name" $img_property --public --container-format=$container_format --disk-format $disk_format < "${image}"
|
|
319
|
+ openstack --os-cloud=devstack-admin image create "$image_name" $img_property --public --container-format=$container_format --disk-format $disk_format < "${image}"
|
320
|
320
|
fi
|
321
|
321
|
else
|
322
|
322
|
# Use glance client to add the kernel the root filesystem.
|
...
|
...
|
@@ -324,12 +321,12 @@ function upload_image {
|
324
|
324
|
# kernel for use when uploading the root filesystem.
|
325
|
325
|
local kernel_id="" ramdisk_id="";
|
326
|
326
|
if [ -n "$kernel" ]; then
|
327
|
|
- kernel_id=$(openstack --os-token $token --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image create "$image_name-kernel" $img_property --public --container-format aki --disk-format aki < "$kernel" | grep ' id ' | get_field 2)
|
|
327
|
+ kernel_id=$(openstack --os-cloud=devstack-admin image create "$image_name-kernel" $img_property --public --container-format aki --disk-format aki < "$kernel" | grep ' id ' | get_field 2)
|
328
|
328
|
fi
|
329
|
329
|
if [ -n "$ramdisk" ]; then
|
330
|
|
- ramdisk_id=$(openstack --os-token $token --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image create "$image_name-ramdisk" $img_property --public --container-format ari --disk-format ari < "$ramdisk" | grep ' id ' | get_field 2)
|
|
330
|
+ ramdisk_id=$(openstack --os-cloud=devstack-admin image create "$image_name-ramdisk" $img_property --public --container-format ari --disk-format ari < "$ramdisk" | grep ' id ' | get_field 2)
|
331
|
331
|
fi
|
332
|
|
- openstack --os-token $token --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT image create "${image_name%.img}" $img_property --public --container-format ami --disk-format ami ${kernel_id:+--property kernel_id=$kernel_id} ${ramdisk_id:+--property ramdisk_id=$ramdisk_id} < "${image}"
|
|
332
|
+ openstack --os-cloud=devstack-admin image create "${image_name%.img}" $img_property --public --container-format ami --disk-format ami ${kernel_id:+--property kernel_id=$kernel_id} ${ramdisk_id:+--property ramdisk_id=$ramdisk_id} < "${image}"
|
333
|
333
|
fi
|
334
|
334
|
}
|
335
|
335
|
|