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

Image 생성 (diskimage-builder)

by shinebee* 2020. 7. 7.
1. openstack image list 
  •  dashboard에 centos7.qcow2 있는지 확인

 

2. source keystonerc_admin
  • 쉘 환경변수를 등록해 자격증명을 할 수 있도록 제공

 

3. openstack image save --file test_image.qcow2 centos7
  • centos7을 test_image.qcow2라는 이름으로 controller에 저장.

 

4. yum list diskimage-builder
   yum install diskimage-builder.noarch
  • package 설치

 

5. cd /usr/share/diskimage-builder/elements/
  • 이미지는 이 디렉토리안의 내용을 조합해서 만든다. 
  • 제일 필수적인 부분은 operating-system이다.
  • 디렉토리의 안에있는 스크립트 파일에 의해 작동이된다.

 

6. /usr/share/diskimage-builder/elements

  /elements안의 어떤 디렉 안에 들어있다. 다 있을수도 있고 몇개만 있을 수도 있다.
  
   - root.d  ->  root file system 제공
   - extra-data.d
   - pre-install.d  ->  설치 전에 진행
   - install.d  ->  설치 중에 진행
   - post-install.d  ->  설치 후에 진행
   - post-root.d
   - block-device.d
   - pre-finalise.d
   - finalise.d
   - cleanup.d
 

OpenStack Docs: Developing Elements

Developing Elements Conform to the following conventions: Use the environment for overridable defaults, prefixing environment variable names with DIB_. For example: DIB_MYDEFAULT=${DIB_MYDEFAULT:-default} If you do not use the DIB prefix you may find that

docs.openstack.org

 

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

 

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

 

9. openstack image create --file ~/centos_test.qcow2 --disk-format qcow2 --private webimage_sealed
  • 이미지 생성.
  • image name = webimage_sealed.qcow2

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

Image 생성 - error  (0) 2020.07.07
[ Glance with Swift backend ]  (0) 2020.07.07
Image 생성 (Snapshot)  (0) 2020.07.07
Open Stack - Heat (wordpress)  (0) 2020.07.02
Open Stack - Cloud-init (wordpress)  (0) 2020.07.02

댓글