glance image-create 명령은 이미지를 업로드하고 모든 등록 정보 값을 한 번에 설정할 수 있습니다. 다음 스크립트는 architecture 등록 정보가 현재 호스트의 아키텍처로 설정된 이미지를 업로드하는 방법을 보여줍니다.
#!/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