pikesaku’s blog

個人的なプログラム勉強メモです。記載内容について一切の責任は持ちません。

OpenStack環境構築メモ(Glanceセットアップ)

参考

OpenStack Docs: Installation
 
Keystoneセットアップ実施後に、以下作業を1号機で実施する。

認証情報読み込み

$ source ./adminrc

  

①Serviceプロジェクト作成

$ openstack project create --domain default --description "Service Project" service
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Service Project                  |
| domain_id   | default                          |
| enabled     | True                             |
| id          | 696fc908b07c407eafdb74892f4a8ae5 |
| is_domain   | False                            |
| name        | service                          |
| parent_id   | default                          |
+-------------+----------------------------------+

 

②Glanceユーザー作成 & Serviceプロジェクトへの管理者ロール割り当て

$ openstack user create --domain default --password-prompt glance
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | ec86ed75c9f44708aa7bab73681c0138 |
| name                | glance                           |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

 

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

 

③Glanceサービス登録

$ openstack service create --name glance --description "OpenStack Image" image
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Image                  |
| enabled     | True                             |
| id          | 7ac6966d194c4abea13792d55868748f |
| name        | glance                           |
| type        | image                            |
+-------------+----------------------------------+

 

④エンドポイント登録

$ openstack endpoint create --region RegionPike image public http://cnt.pikesaku.net:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | c9e2593ff25947b6a0efb6750b84593a |
| interface    | public                           |
| region       | RegionPike                       |
| region_id    | RegionPike                       |
| service_id   | 7ac6966d194c4abea13792d55868748f |
| service_name | glance                           |
| service_type | image                            |
| url          | http://cnt.pikesaku.net:9292     |
+--------------+----------------------------------+
$ openstack endpoint create --region RegionPike image internal http://cnt.local:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 82cc66e6d3e546b285f4774883523a94 |
| interface    | internal                         |
| region       | RegionPike                       |
| region_id    | RegionPike                       |
| service_id   | 7ac6966d194c4abea13792d55868748f |
| service_name | glance                           |
| service_type | image                            |
| url          | http://cnt.local:9292            |
+--------------+----------------------------------+
$ openstack endpoint create --region RegionPike image admin http://cnt.local:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 3a3ef74285634f61900d1168a594d69f |
| interface    | admin                            |
| region       | RegionPike                       |
| region_id    | RegionPike                       |
| service_id   | 7ac6966d194c4abea13792d55868748f |
| service_name | glance                           |
| service_type | image                            |
| url          | http://cnt.local:9292            |
+--------------+----------------------------------+

 

⑤パッケージインストール

以下は3台のコントローラで実施する

$ sudo apt -y install glance

 

Glance用DB & ユーザー作成

$ mysql -uroot -p[DB_PASSWORD] -e 'CREATE DATABASE glance;'
$ mysql -uroot -p[DB_PASSWORD] -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '[GLANCE_DB_PASSWORD]';"
$ mysql -uroot -p[DB_PASSWORD] -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '[GLANCE_DB_PASSWORD]';"

 

ひとまず今日はここまで。。。

OpenStack Docs: Install and configure (Ubuntu)

"1. Install the packages:"まで完了

コンポーネントにKepstoneのVIPを指定
OpenStack Docs: Highly available Identity API
 
memcached・rabbitmqとの接続冗長化はkerstoneセットアップを参照
 
NFSサーバ上に配置する