0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Kolla Ansible利用のCinderでONTAP利用②【 OpenStack AntelopeでONTAP利用の設定メモ】

Last updated at Posted at 2025-12-09

はじめに

前回の記事では、Kolla Ansibleの初期構築について記載しましたが、
本記事では、ONTAPのNFS環境をCinderで利用する設定内容をメモとして共有します。
具体的には、Kolla Ansibleで構築したOpenStack AntelopeをBlock StorageでONTAPを利用する方法に焦点を当てています。

また、Kolla Ansible環境でONTAPのマルチバックエンドを使用する方法についても合わせて記載します。

qiita-square

何をしたい?できる?

  • Kolla Ansibleのglobals.ymlを編集し、ONTAPのNFS領域を使用できるようにする
  • Kolla AnsibleのCinderで、ONTAPのマルチバックエンドを使用できるようにする

記事における環境情報

本記事では、以下の環境で実施した内容となります。
分かり易くするために、Network構成は単純化しています。

  • Linux : Ubuntu 22.04.5 LTS
  • Openstack: Antelope
  • ONTAP:9.16.1
qiita-square

CinderでONTAP利用する為の手順

1. ONTAP側の事前設定

ONTAP側でNFSアクセス用のSVM作成やLIF設定を実施しておきます。
作成手順については、過去の記事を参照して下さい。

2. OpensStack側の設定

2-1. globals.ymlの編集

ONTAPを使用する形でglobals.ymlへ必要な内容を編集します。
enable_cinder_backend_ontap_nfs: "yes"の追記で利用する事ができるようになります。

# globals.ymlへ必要な項目を追記
> cat /etc/kolla/globals.yml |grep enable_cinder_backend_ontap_nfs
enable_cinder_backend_ontap_nfs: "yes"

2-2. /etc/kolla/configへcinder.confとnfs_sharesファイルの作成

既存値を確認し追記する形を取りたいので、コンテナ上のcinder.confを確認から/etc/kolla/configへcinder.confへ内容のコピーを実施します

> mkdir /etc/kolla/config
> docker exec -it cinder_volume cat /etc/cinder/cinder.conf > /etc/kolla/config/cinder.conf

2-3. cinder.confとnfs_sharesの作成

# cinder.confの更新
> cat cinder.conf
[DEFAULT]
(中略)
enabled_backends = lvm-1,ontap001
(中略)
[ontap001]
volume_backend_name=ontap001
volume_driver=cinder.volume.drivers.netapp.common.NetAppDriver
netapp_server_hostname=172.16.10.200
netapp_server_port=80
netapp_storage_protocol=nfs
netapp_storage_family=ontap_cluster
netapp_login=admin
netapp_password=PSlab$$testpass
netapp_vserver=test01
nfs_shares_config=/etc/cinder/nfs_shares


# nfs_sharesの作成
> cat nfs_shares
172.16.10.201:/vol100

本環境では、/etc/kolla/config/ に設定ファイルを置いています。

>  ls -l /etc/kolla/config/
total 12
-rw-r--r-- 1 root root 2833 Dec  5 17:41 cinder.conf
-rw-r--r-- 1 root root   23 Dec  5 17:43 nfs_shares

2-4. Cinderサービスを再構成

# cinder.confの更新
> kolla-ansible -i all-in-one reconfigure -t cinder
Reconfigure OpenStack service : ansible-playbook -e @/etc/kolla/globals.yml  -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  --tags cinder -e kolla_action=reconfigure -e kolla_serial=0 /path/to/venv/share/kolla-ansible/ansible/site.yml  --inventory all-in-one
(中略)
TASK [cinder : Copying over nfs_shares files for cinder_volume] **********************************************************************************
changed: [localhost] => (item=/etc/kolla/config/nfs_shares)
(中略)
PLAY RECAP ***************************************************************************************************************************************
localhost                  : ok=24   changed=9    unreachable=0    failed=0    skipped=7    rescued=0    ignored=0

2-5. cinderコンテナの中のcinder.confファイルが更新されている事の確認

Cinder VolumeとしてONTAPの設定内容が反映されてStateがupとなっている事を確認します。

> docker exec -it cinder_volume cat /etc/cinder/cinder.conf |grep ontap
enabled_backends = lvm-1,ontap001
[ontap001]
volume_backend_name = ontap001
netapp_storage_family = ontap_cluster


# ONTAPの設定がupになっている事を確認

> source /etc/kolla/admin-openrc.sh

> cinder service-list
WARNING:cinderclient.shell:API version 3.71 requested,
WARNING:cinderclient.shell:downgrading to 3.70 based on server support.
+------------------+--------------------+------+---------+-------+----------------------------+---------+-----------------+---------------+
| Binary           | Host               | Zone | Status  | State | Updated_at                 | Cluster | Disabled Reason | Backend State |
+------------------+--------------------+------+---------+-------+----------------------------+---------+-----------------+---------------+
| cinder-backup    | openstk10          | nova | enabled | down  | 2025-12-05T08:48:16.000000 | -       | -               |               |
| cinder-scheduler | openstk10          | nova | enabled | up    | 2025-12-05T08:52:42.000000 | -       | -               |               |
| cinder-volume    | openstk10@lvm-1    | nova | enabled | up    | 2025-12-05T08:52:34.000000 | -       | -               | up            |
| cinder-volume    | openstk10@ontap001 | nova | enabled | up    | 2025-12-05T08:52:34.000000 | -       | -               | up            |
+------------------+--------------------+------+---------+-------+----------------------------+---------+-----------------+---------------+

2-6. VolumeのType設定

確認できたONTAP領域へTypeの設定を実施します。

> openstack volume type create --property volume_backend_name=ontap001 ontap-vol
+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| description | None                                 |
| id          | 7ec4394a-8721-4c78-b4a6-abfd25a8243e |
| is_public   | True                                 |
| name        | ontap-vol                            |
| properties  | volume_backend_name='ontap001'       |
+-------------+--------------------------------------+

2-7. Cinder Volumeの作成

上記で作成したVolume Type(ONTAPのNFS領域)を指定して、cinder volume作成を実施します。

> openstack volume create --size 3 cinder_vol01 --type ontap-vol
+--------------------------------+--------------------------------------+
| Field                          | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | nova                                 |
| backup_id                      | None                                 |
| bootable                       | False                                |
| cluster_name                   | None                                 |
| consumes_quota                 | True                                 |
| created_at                     | 2025-12-05T09:22:25.756899           |
| description                    | None                                 |
| encrypted                      | False                                |
| group_id                       | None                                 |
| id                             | 1d1e6a1c-e795-4d60-91d8-ef34be0127db |
| multiattach                    | False                                |
| name                           | cinder_vol01                         |
| os-vol-host-attr:host          | None                                 |
| os-vol-mig-status-attr:migstat | None                                 |
| os-vol-mig-status-attr:name_id | None                                 |
| os-vol-tenant-attr:tenant_id   | None                                 |
| properties                     |                                      |
| provider_id                    | None                                 |
| replication_status             | None                                 |
| service_uuid                   | None                                 |
| shared_targets                 | True                                 |
| size                           | 3                                    |
| snapshot_id                    | None                                 |
| source_volid                   | None                                 |
| status                         | creating                             |
| type                           | ontap-vol                            |
| updated_at                     | None                                 |
| user_id                        | 02ff2f21b68043c9aef1fe63fad3143d     |
| volume_type_id                 | 7ec4394a-8721-4c78-b4a6-abfd25a8243e |
+--------------------------------+--------------------------------------+


# エラー無く作成できている事を確認
> cinder list
WARNING:cinderclient.shell:API version 3.71 requested,
WARNING:cinderclient.shell:downgrading to 3.70 based on server support.
+--------------------------------------+-----------+--------------+------+----------------+-------------+----------+-------------+
| ID                                   | Status    | Name         | Size | Consumes Quota | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+----------------+-------------+----------+-------------+
| 1d1e6a1c-e795-4d60-91d8-ef34be0127db | available | cinder_vol01 | 3    | True           | ontap-vol   | false    |             |
+--------------------------------------+-----------+--------------+------+----------------+-------------+----------+-------------+

3. マルチバックエンドの為の設定

単一のホストに複数のNetAppバックエンドを設定しようとする場合、Kolla Ansible利用のCinderでは基本的に対応していない形となってます。こちらはバグとして記載されおります。

本記事では、以下のような同一SVMでVolume毎に種別をわけるようなcinder.confにマルチバックエンド風の設定を定義してからCinderサービスを再構成し、nfs_sharesファイルはdocker cpコマンドでコピーして対応する形で試します。(nfs_sharesが複数の挙動を実現したい)

qiita-square

3-1. cinder.confの編集とnfs_shares2の作成

cinder.confにマルチバックエンドの設定を追記し、合わせてnfs_sharesの作成を実施します。

# cinder.confの編集

> cat cinder.conf
[DEFAULT]
(中略)
enabled_backends = lvm-1,ontap001,ontap002
(中略)
[ontap001]
volume_backend_name=ontap001
volume_driver=cinder.volume.drivers.netapp.common.NetAppDriver
netapp_server_hostname=172.16.10.200
netapp_server_port=80
netapp_storage_protocol=nfs
netapp_storage_family=ontap_cluster
netapp_login=admin
netapp_password=PSlab$$testpass
netapp_vserver=test01
nfs_shares_config=/etc/cinder/nfs_shares

[ontap002]
volume_backend_name=ontap002
volume_driver=cinder.volume.drivers.netapp.common.NetAppDriver
netapp_server_hostname=172.16.10.200
netapp_server_port=80
netapp_storage_protocol=nfs
netapp_storage_family=ontap_cluster
netapp_login=admin
netapp_password=PSlab$$testpass
netapp_vserver=test01
nfs_shares_config=/etc/cinder/nfs_shares2


# nfs_shares2の作成
> cat nfs_shares2
172.16.10.201:/vol200

本環境では、/etc/kolla/config/ に設定ファイルを置いています。

(venv) root@openstk10:~# ls -l /etc/kolla/config/
total 12
-rw-r--r-- 1 root root 2833 Dec  8 16:21 cinder.conf
-rw-r--r-- 1 root root   23 Dec  5 17:43 nfs_shares
-rw-r--r-- 1 root root   23 Dec  5 19:52 nfs_shares2

3-2. Cinderサービスを再構成

# cinder.confの更新
> kolla-ansible -i all-in-one reconfigure -t cinder
Reconfigure OpenStack service : ansible-playbook -e @/etc/kolla/globals.yml  -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  --tags cinder -e kolla_action=reconfigure -e kolla_serial=0 /path/to/venv/share/kolla-ansible/ansible/site.yml  --inventory all-in-one
(中略)
PLAY RECAP *********************************************************************************************************************************************************************
localhost                  : ok=24   changed=9    unreachable=0    failed=0    skipped=8    rescued=0    ignored=0

3-3. cinder-volumeコンテナへ、複数のNFS共有リストファイルをコピー

# docker psコマンドでコピーの実行
> CINDER_VOL=$(docker ps --format '{{.Names}}' | grep cinder_volume)

> docker cp /etc/kolla/config/nfs_shares2 "$CINDER_VOL":/etc/cinder/nfs_shares2

コピーされている事を確認します。

# docker psコマンドでコピーの実行
> docker exec -it "$CINDER_VOL" ls -l /etc/cinder |grep nfs_share*
-rw------- 1 cinder cinder   23 Dec  8 16:23 nfs_shares
-rw-r--r-- 1 root   root     23 Dec  5 19:52 nfs_shares2

ONTAPの設定がupになっている事を確認します。

> cinder service-list
WARNING:cinderclient.shell:API version 3.71 requested,
WARNING:cinderclient.shell:downgrading to 3.70 based on server support.
+------------------+--------------------+------+---------+-------+----------------------------+---------+-----------------+---------------+
| Binary           | Host               | Zone | Status  | State | Updated_at                 | Cluster | Disabled Reason | Backend State |
+------------------+--------------------+------+---------+-------+----------------------------+---------+-----------------+---------------+
| cinder-backup    | openstk10          | nova | enabled | down  | 2025-12-08T07:23:18.000000 | -       | -               |               |
| cinder-scheduler | openstk10          | nova | enabled | up    | 2025-12-08T09:55:07.000000 | -       | -               |               |
| cinder-volume    | openstk10@lvm-1    | nova | enabled | up    | 2025-12-08T09:55:07.000000 | -       | -               | up            |
| cinder-volume    | openstk10@ontap001 | nova | enabled | up    | 2025-12-08T09:55:12.000000 | -       | -               | up            |
| cinder-volume    | openstk10@ontap002 | nova | enabled | up    | 2025-12-08T09:55:14.000000 | -       | -               | up            |
+------------------+--------------------+------+---------+-------+----------------------------+---------+-----------------+---------------+

3-4. Volume Typeの作成

OpenStackのWeb管理画面からログインし、[管理]=>[ボリューム]=>[ボリューム種別]をクリックし、表示された画面で[ボリューム種別の作成]を選択し、Volume Typeの作成を実施します。

qiita-square

作成されたボリューム種別の右側から[追加スペックの表示]を選択し、表示された画面で[+作成]をクリックします。

qiita-square

キーにvolume_backend_nameを入力し、値にcinder.confへ追記したontap002を入力し[作成]をクリックします。

qiita-square

3-5. Cinder Volumeの作成

[プロジェクト]=>[ボリューム]=>[ボリューム]をクリックし、表示された画面で[ボリュームの作成]を選択します。

qiita-square

表示された画面で任意のVolume名とサイズを入力し、種別は先程定義したONTAPのものを指定して、[ボリュームの作成]をクリックします。

qiita-square

正常に作成できている事を確認します。

qiita-square

参考及びリンク

Quick Start for deployment/evaluation

openstack/kolla-ansible

Kolla Ansible’s documentation

Kolla Ansible利用のCinderでONTAP利用①【 OpenStack AntelopeのAll in One Install構築メモ】

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?