root@controller:~# ls -l /var/lib/mysql/glance/
total 160
-rw-rw---- 1 mysql mysql 61 2월 24 11:39 db.opt
-rw-rw---- 1 mysql mysql 8862 2월 24 13:24 image_locations.frm
-rw-rw---- 1 mysql mysql 8864 2월 24 13:24 image_members.frm
-rw-rw---- 1 mysql mysql 8818 2월 24 13:24 image_properties.frm
-rw-rw---- 1 mysql mysql 8788 2월 24 13:24 image_tags.frm
-rw-rw---- 1 mysql mysql 9180 2월 24 13:24 images.frm
-rw-rw---- 1 mysql mysql 8804 2월 24 13:24 metadef_namespace_resource_types.frm
-rw-rw---- 1 mysql mysql 8884 2월 24 13:24 metadef_namespaces.frm
-rw-rw---- 1 mysql mysql 8842 2월 24 13:24 metadef_objects.frm
-rw-rw---- 1 mysql mysql 8760 2월 24 13:24 metadef_properties.frm
-rw-rw---- 1 mysql mysql 8710 2월 24 13:24 metadef_resource_types.frm
-rw-rw---- 1 mysql mysql 8666 2월 24 13:24 migrate_version.frm
-rw-rw---- 1 mysql mysql 8668 2월 24 13:24 task_info.frm
-rw-rw---- 1 mysql mysql 8856 2월 24 13:24 tasks.frm
root@controller:~# service glance-registry restart
glance-registry stop/waiting
glance-registry start/running, process 7426
root@controller:~# service glance-api restart
glance-api stop/waiting
glance-api start/running, process 7443
root@controller:~# rm -f /var/lib/glance/glance.sqlite
이미지등록
OpenStack 메뉴얼상에서는 가장이미지 싸이즈가 적은
CIrros 이미지로 등록되는 방법으로 명시되어있습니다.
Cirros 는 클라우드서비스내에서 실행을 전문적으로 적은 용량에 OS 입니다.
root@controller:~# mkdir /tmp/images
root@controller:~# cd /tmp/images
root@controller:/tmp/images# wget http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
root@controller:/tmp/images# source /root/admin-openrc.sh
root@controller:/tmp/images# glance image-create --name "cirros-0.3.2-x86_64" --file cirros-0.3.2-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 64d7c1cd2b6f60c92c14662941cb7913 |
| container_format | bare |
| created_at | 2015-02-24T05:12:00 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 14cb4b95-07c2-478a-88a6-fa1e7931f828 |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-0.3.2-x86_64 |
| owner | 1cf650d0c8ea4b8b93ee38b1bb3cea76 |
| protected | False |
| size | 13167616 |
| status | active |
| updated_at | 2015-02-24T05:12:01 |
| virtual_size | None |
+------------------+--------------------------------------+
생성된 이미지에 기본경로는 /var/lib/glance/images/ 입니다.
root@controller:/var/lib/glance/images# ls
14cb4b95-07c2-478a-88a6-fa1e7931f828
root@controller:/tmp/images# glance image-list
+--------------------------------------+---------------------+-------------+------------------+----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+---------------------+-------------+------------------+----------+--------+
| 14cb4b95-07c2-478a-88a6-fa1e7931f828 | cirros-0.3.2-x86_64 | qcow2 | bare | 13167616 | active |
+--------------------------------------+---------------------+-------------+------------------+----------+--------+
Ubuntu 기본 클라우드 이미지 등록 (http://cloud-images.ubuntu.com/)
root@controller:/tmp/images# wget http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
root@controller:/tmp/images# qemu-img info trusty-server-cloudimg-amd64-disk1.img
image: trusty-server-cloudimg-amd64-disk1.img
file format: qcow2
virtual size: 2.2G (2361393152 bytes)
disk size: 245M
cluster_size: 65536
Format specific information:
compat: 0.10
root@controller:/tmp/images# glance image-create --name "Ubuntu14.04_cloud-images" --file trusty-server-cloudimg-amd64-disk1.img --disk-format qcow2 --container-format bare --is-public True --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | cf0fc236ad04ee6066852ca759a7ade9 |
| container_format | bare |
| created_at | 2015-02-26T05:41:43 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | a86622c9-a876-4fbc-825f-6f80a2fb8354 |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | Ubuntu14.04_cloud-images |
| owner | 1cf650d0c8ea4b8b93ee38b1bb3cea76 |
| protected | False |
| size | 256705024 |
| status | active |
| updated_at | 2015-02-26T05:41:45 |
| virtual_size | None |
+------------------+--------------------------------------+
root@controller:/tmp/images# glance image-list
+--------------------------------------+--------------------------+-------------+------------------+-----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------------------------+-------------+------------------+-----------+--------+
| 14cb4b95-07c2-478a-88a6-fa1e7931f828 | cirros-0.3.2-x86_64 | qcow2 | bare | 13167616 | active |
| a86622c9-a876-4fbc-825f-6f80a2fb8354 | Ubuntu14.04_cloud-images | qcow2 | bare | 256705024 | active |
+--------------------------------------+--------------------------+-------------+------------------+-----------+--------+
root@controller:/tmp/images# ls -l /var/lib/glance/images/
total 263552
-rw-r----- 1 glance glance 13167616 2월 24 14:12 14cb4b95-07c2-478a-88a6-fa1e7931f828
-rw-r----- 1 glance glance 256705024 2월 26 14:41 a86622c9-a876-4fbc-825f-6f80a2fb8354
:: 대시보드를 이용해서 VM 인스턴스 생성
cloud-images.ubuntu.com에서 배포되는 이미지는 compute 노드에서만 접근가능
root@ubuntu:~# ssh -lroot 192.168.145.3
Please login as the user "ubuntu" rather than the user "root".
root@ubuntu:~# ssh -lubuntu 192.168.145.3
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-45-generic x86_64)
스마일서브 클라우드 배포용 이미지 등록
이미지는 FTP를 통해 /tmp/images 디렉토리로 다운로드
root@controller:/tmp/images# wget http://mirror.cloudv.kr/Openstack_images/Centos_6.6_64bit.qcow2
root@controller:/tmp/images# glance image-create --name "CentOS6.6 SMILESERV-IMG" --file Centos_6.6_64bit.qcow2 --disk-format qcow2 --container-format bare --is-public True --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 578f975bc18009a9fe12f5e211e38db0 |
| container_format | bare |
| created_at | 2015-02-26T06:58:23 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | a4373411-7dff-4083-aa9a-6e94b3f2944d |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | CentOS6.6 SMILESERV-IMG |
| owner | 1cf650d0c8ea4b8b93ee38b1bb3cea76 |
| protected | False |
| size | 2822307840 |
| status | active |
| updated_at | 2015-02-26T06:59:27 |
| virtual_size | None |
+------------------+--------------------------------------+
root@controller:/tmp/images# glance image-list
+--------------------------------------+------------------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+------------------------------+-------------+------------------+------------+--------+
| 14cb4b95-07c2-478a-88a6-fa1e7931f828 | cirros-0.3.2-x86_64 | qcow2 | bare | 13167616 | active |
| a86622c9-a876-4fbc-825f-6f80a2fb8354 | Ubuntu14.04_cloud-images | qcow2 | bare | 256705024 | active |
| a4373411-7dff-4083-aa9a-6e94b3f2944d | CentOS6.6 SMILESERV-IMG | qcow2 | bare | 2822307840 | active |
+--------------------------------------+------------------------------+-------------+------------------+------------+--------+
root@controller:/tmp/images# ls -l /var/lib/glance/images/
total 3019716
-rw-r----- 1 glance glance 13167616 2월 24 14:12 14cb4b95-07c2-478a-88a6-fa1e7931f828
-rw-r----- 1 glance glance 2822307840 2월 26 15:59 a4373411-7dff-4083-aa9a-6e94b3f2944d
-rw-r----- 1 glance glance 256705024 2월 26 14:41 a86622c9-a876-4fbc-825f-6f80a2fb8354
:: 대시보드를 이용해서 VM 인스턴스 생성