설치와 설정

설치와 설정

이 섹션에서는 컨트롤러 노드에 glance라는 코드 이름을 가진 이미지 서비스를 설치하고 구성하는 방법을 설명합니다. 간략화하여 해당 구성에서는 이미지를 로컬 파일 시스템에 저장합니다.

선행조건

이미지 서비스를 설치 및 구성하기 전에, 데이터베이스, 서비스 credential, 엔드포인트를 생성해야 합니다.

  1. 데이터베이스를 생성하기 위해 다음 과정을 완료합니다:

    • 데이터베이스 액세스 클라이언트를 사용하여 데이터베이스 서버에 root 사용자로 연결합니다:

      $ mysql -u root -p
      
    • glance 데이터베이스를 생성합니다:

      CREATE DATABASE glance;
      
    • glance 데이터베이스에 대해 적합한 액세스를 부여합니다:

      GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
        IDENTIFIED BY 'GLANCE_DBPASS';
      GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
        IDENTIFIED BY 'GLANCE_DBPASS';
      

      GLANCE_DBPASS 를 적절한 암호로 변경합니다.

    • 데이터베이스 접속 클라이언트를 종료합니다.

  2. admin credential에 대한 접근 권한을 얻기위해 관리자용 CLI 명령어 source 입력합니다:

    $ source admin-openrc.sh
    
  3. 서비스 credential을 생성하기 위해 다음 작업을 완료합니다:

    • glance 사용자를 생성합니다:

      $ openstack user create --domain default --password-prompt glance
      User Password:
      Repeat User Password:
      +-----------+----------------------------------+
      | Field     | Value                            |
      +-----------+----------------------------------+
      | domain_id | default                          |
      | enabled   | True                             |
      | id        | e38230eeff474607805b596c91fa15d9 |
      | name      | glance                           |
      +-----------+----------------------------------+
      
    • admin 역할을 glance 사용자와 service 프로젝트에 추가합니다:

      $ openstack role add --project service --user glance admin
      

      주석

      이 명령어는 출력값이 없습니다.

    • glance 서비스 엔티티를 생성합니다:

      $ openstack service create --name glance \
        --description "OpenStack Image service" image
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | OpenStack Image service          |
      | enabled     | True                             |
      | id          | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
      | name        | glance                           |
      | type        | image                            |
      +-------------+----------------------------------+
      
  4. 이미지 서비스 API 엔드포인트를 생성합니다:

    $ openstack endpoint create --region RegionOne \
      image public http://controller:9292
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 340be3625e9b4239a6415d034e98aace |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
    | service_name | glance                           |
    | service_type | image                            |
    | url          | http://controller:9292           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      image internal http://controller:9292
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | a6e4b153c2ae4c919eccfdbb7dceb5d2 |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
    | service_name | glance                           |
    | service_type | image                            |
    | url          | http://controller:9292           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      image admin http://controller:9292
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 0c37ed58103f4300a84ff125a539032d |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
    | service_name | glance                           |
    | service_type | image                            |
    | url          | http://controller:9292           |
    +--------------+----------------------------------+
    

구성요소 설치와 구성

주석

디폴트 구성 파일을 배포판에 따라 달라집니다. 기존 섹션 및 옵션을 변경하는 것 보다는 해당 섹션과 옵션을 추가해야 할 수도 있습니다. 또한 구성 내용 조각 중 생략 (...) 부분은 유지될 필요성이 있는 디폴트 구성 옵션을 가리킵니다.

  1. 패키지를 설치하십시오:

    # zypper install openstack-glance python-glanceclient
    
  1. /etc/glance/glance-api.conf 파일을 편집하여 다음 작업을 완료합니다:

    • [database] 섹션에서 데이터베이스 액세스를 구성합니다:

      [database]
      ...
      connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
      

      GLANCE_DBPASS 를 이미지 서비스 데이터베이스를 위해 선택한 암호로 변경합니다.

    • [keystone_authtoken][paste_deploy] 섹션에 Identity 서비스 액세스를 구성합니다:

      [keystone_authtoken]
      ...
      auth_uri = http://controller:5000
      auth_url = http://controller:35357
      auth_plugin = password
      project_domain_id = default
      user_domain_id = default
      project_name = service
      username = glance
      password = GLANCE_PASS
      
      [paste_deploy]
      ...
      flavor = keystone
      

      GLANCE_PASS 를 Identity 서비스에서 glance 사용자에 대해 선택한 암호로 변경합니다.

      주석

      [keystone_authtoken] 섹션 내 다른 옵션들은 주석 처리나 제거합니다.

    • [glance_store] 섹션에 로컬 파일 시스템 저장소와 이미지 파일 위치를 구성합니다:

      [glance_store]
      ...
      default_store = file
      filesystem_store_datadir = /var/lib/glance/images/
      
    • [DEFAULT] 섹션에 noop notification 드라이버를 구성하여 notification을 비활성화합니다. 선택적인 Telemetry 서비스인 때만 존재하기 때문입니다:

      [DEFAULT]
      ...
      notification_driver = noop
      

      Telemetry 챕터에서는 notification을 활성화하는 이미지 서비스 구성을 제공합니다.

    • (옵션) 트러블 슈팅을 지원하기 위해, [DEFAULT] 섹션에서 verbose 로깅을 활성화합니다:

      [DEFAULT]
      ...
      verbose = True
      
  2. /etc/glance/glance-registry.conf 파일을 편집하여 다음 작업을 완료합니다:

    • [database] 섹션에서 데이터베이스 액세스를 구성합니다:

      [database]
      ...
      connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
      

      GLANCE_DBPASS 를 이미지 서비스 데이터베이스를 위해 선택한 암호로 변경합니다.

    • [keystone_authtoken][paste_deploy] 섹션에 Identity 서비스 액세스를 구성합니다:

      [keystone_authtoken]
      ...
      auth_uri = http://controller:5000
      auth_url = http://controller:35357
      auth_plugin = password
      project_domain_id = default
      user_domain_id = default
      project_name = service
      username = glance
      password = GLANCE_PASS
      
      [paste_deploy]
      ...
      flavor = keystone
      

      GLANCE_PASS 를 Identity 서비스에서 glance 사용자에 대해 선택한 암호로 변경합니다.

      주석

      [keystone_authtoken] 섹션 내 다른 옵션들은 주석 처리나 제거합니다.

    • [DEFAULT] 섹션에 noop notification 드라이버를 구성하여 notification을 비활성화합니다. 선택적인 Telemetry 서비스인 때만 존재하기 때문입니다:

      [DEFAULT]
      ...
      notification_driver = noop
      

      Telemetry 챕터에서는 notification을 활성화하는 이미지 서비스 구성을 제공합니다.

    • (옵션) 트러블 슈팅을 지원하기 위해, [DEFAULT] 섹션에서 verbose 로깅을 활성화합니다:

      [DEFAULT]
      ...
      verbose = True
      

설치 마무리

  • 시스템 부팅시에 이미지 서비스를 시작하고 환경설정을 시작합니다.

    # systemctl enable openstack-glance-api.service \
      openstack-glance-registry.service
    # systemctl start openstack-glance-api.service \
      openstack-glance-registry.service
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.