본문 바로가기
Openstack

openstack 수동설정 glance

by 판매자명단 2023. 9. 7.

[Openstack] - openstack 수동설정 사전 작업

 

openstack 수동설정 사전 작업

* ubuntu 20.04 2대 사용 controller ip 192.168.1.10 / dhcp ip 192.168.2.5 compute ip 192.168.1.11 / dhcp ip 192.168.2.6 chrony #controller apt install -y chrony systemctl enable --now chrony #compute apt install -y chrony nano /etc/chrony/chrony.conf 서

y7712.tistory.com

* 사전 작업을 먼저 할 것

 

mysql
create database glance;
grant all privileges on glance.* to 'glance'@'localhost' identified by 'openstack';
grant all privileges on glance.* to 'glance'@'%' identified by 'openstack';

우선 mysql에서 glance 계정을 만들어준다

. admin-openrc # keystone글 참조

# glance 계정 생성
openstack user create --domain default --project service --password-prompt glance

# glance admin 권한 부여 / admin role에 glance를 추가
openstack role add --project service --user glance admin

# glance 서비스 생성
openstack service create --name glance --description "Openstack Image" image

# endpoint 생성
openstack endpoint create --region RegionOne image public http://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292

openstack에서 사용할 glance 계정을 생성하고 권한을 부여한다

glance 서비스를 생성하고 endpoint를 만든다

* endpoint : 어디서 만날지 약속장소를 정하는 개념

apt install -y glance
nano /etc/glance/glance-api.conf

# glance-api.conf
[database]
connection = mysql+pymysql://glance:openstack@controller/glance

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = openstack

[paste_deploy]
flavor = keystone

[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

su -s /bin/bash glance -c "glance-manage db_sync"
systemctl restart glance

glane를 설치해 주고 conf 파일을 수정한다

설정을 마쳤으면 db를 초기화해주고 서비스를 재시작한다

wget http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
openstack image create "cirros" \
--disk-format qcow2 --container-format bare \
--file cirros-0.5.1-x86_64-disk.img --public

image를 받아서 openstack에 올려준다

* container와 hardware의 연결 역할

 

# 확인용 명령어
glance --version
openstack image list
glance image-show [ID]

 

참고

https://docs.openstack.org/glance/victoria/install/install-ubuntu.html

 

OpenStack Docs: Install and configure (Ubuntu)

Install and configure (Ubuntu) This section describes how to install and configure the Image service, code-named glance, on the controller node. For simplicity, this configuration stores images on the local file system. Prerequisites Before you install and

docs.openstack.org

https://docs.openstack.org/murano/pike/reference/appendix/articles/image_builders/upload.html

 

OpenStack Docs: Upload image into glance

Upload image into glance To deploy applications with murano, virtual machine images should be uploaded into glance in a special way - murano_image_info property should be set. Use the OpenStack client image create command to import your disk image to glanc

docs.openstack.org

 

'Openstack' 카테고리의 다른 글

openstack 수동 설정 placement  (0) 2023.09.07
openstack 수동설정 nova  (0) 2023.09.07
openstack 수동설정 keystone  (0) 2023.09.06
openstack 수동설정 사전 작업  (0) 2023.09.06
devstack으로 openstack 실습  (0) 2023.09.05