The OpenStack image service, Glance, provides storage, discovery, registration, and delivery services for disk and server images. A registry server is an image service that provides image metadata information to clients. The image cache is used by the image service to obtain images on the local host rather than re-downloading them from the image server each time an image is requested.
The following command uploads the Unified Archive created in the previous section to the Glance repository. Use raw as the format type. Be sure to specify the architecture property.
global# glance image-create --container-format bare --disk-format raw \ --is-public true --name "Oracle Solaris 11.2 x86 NGZ" \ --property architecture=x86_64 \ --property hypervisor_type=solariszones \ --property vm_mode=solariszones < /var/tmp/myzone.uar
The glance image-create command can upload the image and set all property values at once. The following script shows how to make sure you upload the image with the architecture property set to the architecture of the current host:
#!/bin/ksh # Upload Unified Archive image to glance with proper Solaris decorations arch=$(archiveadm info -p $1|grep ^archive|cut -d '|' -f 4) if [[ "$arch" == "i386" ]]; then imgarch=x86_64 else imgarch=sparc64 fi name=$(basename $1 .uar) export OS_USERNAME=glance export OS_PASSWORD=glance export OS_TENANT_NAME=service export OS_AUTH_URL=http://controller-name:5000/v2.0 glance image-create --name $name --container-format bare --disk-format raw --owner service --file $1 --is-public True --property architecture=$imgarch --property hypervisor_type=solariszones --property vm_mode=solariszones --progress