컨트롤러 노드에서 진행
$ mysql
> CREATE DATABASE glance;
> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'a';
> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'a';
> quit
# glance 유저 생성 및 admin 권한 부여
$ openstack user create --domain default --password-prompt glance # 비밀번호 a 입력
$ openstack role add --project service --user glance admin
# 서비스 추가
$ openstack service create --name glance --description "OpenStack Image" image
# API 엔드포인트
$ openstack endpoint create --region RegionOne image public
$ openstack endpoint create --region RegionOne image internal
$ openstack endpoint create --region RegionOne image admin
# 확인
$ openstack user list | grep glance
$ openstack service list | grep glance
$ openstack endpoint list | grep glance
# 패키지 설치 및 설정
$ apt install glance
$ cp /etc/glance/glance-api.conf /etc/glance/glance-api.conf.org
$ grep -E '^[^#].' /etc/glance/glance-api.conf.org > /etc/glance/glance-api.conf
$ vi /etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:a@controller/glance
[keystone_authtoken]
www_authenticate_uri =
auth_url =
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = a
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
$ su -s /bin/sh -c "glance-manage db_sync" glance
$ service glance-api restart
$ service glance-api status
# 검증
$ mkdir -p /root/dev && cd /root/dev
$ wget <http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img>
$ glance image-create --name "cirros" \\
--file cirros-0.4.0-x86_64-disk.img \\
--disk-format qcow2 --container-format bare \\
--visibility=public
# 에러시 netstat -ntpa | grep LISTEN 명령어로 3306포트의 ip가 127.0.0.1이면 재부팅
# service mysql restart
$ glance image-list
테넌트당 등록 할당량 한도 설정 (선택사항)
$ openstack --os-cloud devstack-system-admin registered limit create \\
--service glance --default-limit 1000 --region RegionOne image_size_total
$ openstack --os-cloud devstack-system-admin registered limit create \\
--service glance --default-limit 1000 --region RegionOne image_stage_total
$ openstack --os-cloud devstack-system-admin registered limit create \\
--service glance --default-limit 100 --region RegionOne image_count_total
$ openstack --os-cloud devstack-system-admin registered limit create \\
--service glance --default-limit 100 --region RegionOne image_count_uploading
$ vi /etc/glance/glance-api.conf
[DEFAULT]
use_keystone_quotas = True
[oslo_limit]
auth_url = http://controller:5000
auth_type = password
user_domain_id = default
username = MY_SERVICE
system_scope = all
password = MY_PASSWORD
endpoint_id = ENDPOINT_ID
region_name = RegionOne
'Openstack' 카테고리의 다른 글
5. 오픈스택: neutron 설치 (0) | 2023.04.06 |
---|---|
4. 오픈스택: nova 설치 (0) | 2023.04.06 |
3. 오픈스택: placement 설치 (0) | 2023.04.06 |
1. 오픈스택: keystone 설치 (0) | 2023.04.06 |
오픈스택: controller 기본 패키지 설치 (0) | 2023.04.06 |
댓글