본문 바로가기
Infra/프라이빗 클라우드 인프라

[ Glance with Swift backend ]

by shinebee* 2020. 7. 7.
1. cd /usr/share/diskimage-builder/elements/centos7/post-install.d
2. cat 01-enable-service
	#!/bin/bash
    	systemctl enable httpd
  • 설치 후에  systemctl enable httpd 명령어를 실행하기 위한 01-enable-service 파일

 

3. chmod 755 01-enable-service
   or 
   chmod +x 01-enable-service
  • 실행 파일이기 때문에 실행 권한을 부여한다.

 

4. export DIB_LOCAL_IMAGE=/root/centos7.qcow2
   env | grep DIB
  • 환경 변수 설정 및 확인

 

5. disk-image-create -a amd64 -t qcow2 -o ~/web.qcow2 -p httpd vm centos7
  • web.qcow2 disk-image 생성

 

6. ls -l web.qcow2
  • 확인

 

 

 

[ INI ]

  • [DEFAULT] → section
  • 같은 변수가 있더라도 섹션이 다르면 다른것.
#vi a.ini

[xyz] 
a = 100 

[abc] 
a = 100
  • crudini —get a.ini xyz a   →   xyz section의 a 값을 불러오겠다.
  • crudini —set a.ini xyz a 200   →   xyz section의 a의 값을 200으로 바꾸겠다.
  • crudini —del a.ini abc a   →   abc section의 a 값을 삭제하겠다.

 

 

 

[ glance_store ]

1. crudini --get glance-api.conf glance_store stores
   file,http,swift
2. crudini --get glance-api.conf glance_store default_store
   file 
  • 2번의 file   ->  swift로 바꾼다.

 

crudini --set glance-api.conf glance_store default_store swift
crudini --set glance-api.conf glance_store default_swift_reference ref2
crudini --set glance-api.conf glance_store swift_store_config_file /etc/glance/glance-swift.conf
crudini --set glance-api.conf glance_store swift_store_region RegionOne
crudini --set glance-api.conf glance_store swift_store_create_container_on_put True

 

crudini --set glance-swift.conf ref2 user services:swift
crudini --set glance-swift.conf ref2 key 51c28d51e9504aad
crudini --set glance-swift.conf ref2 user_domain_id default
crudini --set glance-swift.conf ref2 project_domain_id default
crudini --set glance-swift.conf ref2 auth_version 3
crudini --set glance-swift.conf ref2 auth_address http://192.168.122.10:5000/v3
  • /etc/glance/glance-swift.conf  파일을 편집기로 편집할때 앞에 띄어쓰기가 없도록 유의!
  • /etc/glance/glance-swift.conf 파일의 주석  ->  참고용
  • test_user  ->  glance  ->  swift
  • process가 process에 접근하는 것이므로 glance가 swift에게 인증을 받아야 한다.
  • 인증을 받기 위한 사용자가 필요
  • 사용자가 swift 게정을 사용하면 된다.

 

openstack-service restart glance
  • 재시작인
  • 먼저 admin 사용자로 들어가 instance에 image가 생성되었는지 확인
  • 그 후, swift 계정의 컨테이너에 이미지가 올라갔는지 확인

 

cat SWIFT answer.txt
  • key : 인증을 위한 token이나 password
  • KS_PW : swift 계정의 password

'Infra > 프라이빗 클라우드 인프라' 카테고리의 다른 글

Object Storage(swift) 서비스 관리  (0) 2020.07.08
Image 생성 - error  (0) 2020.07.07
Image 생성 (diskimage-builder)  (0) 2020.07.07
Image 생성 (Snapshot)  (0) 2020.07.07
Open Stack - Heat (wordpress)  (0) 2020.07.02

댓글