LoginSignup
3
2

More than 5 years have passed since last update.

CinderのストレージにNFSを使う

Posted at

NFSサーバ側

  • インストール
# yum -y install nfs-utils 
  • /etc/idmapd.confを編集
/etc/idmapd.conf
Domain = nova1.kccw.org
  • 公開ディレクトリの設定
# mkdir /exports
# chown nfsnobody:nfsnobody /exports
/etc/exports
/exports クライアントIP(rw,all_squash)
  • デーモンの再起動
# systemctl restart rpcbind
# systemctl restart nfs-server
# systemctl restart nfs-lock
# systemctl restart nfs-idmap
  • 確認
# exportfs -v
/exports
                クライアントIP(rw,wdelay,root_squash,all_squash,no_subtree_check,sec=sys,rw,secure,root_squash,all_squash)

Cinder側

  • マウント先の指定
/etc/cinder/nfsshares
NFSサーバIP:/exports
# chown root:cinder /etc/cinder/nfsshares
# chmod 0640 /etc/cinder/nfsshares
  • Cinder設定
# openstack-config --set /etc/cinder/cinder.conf DEFAULT nfs_shares_config /etc/cinder/nfsshares
# openstack-config --set /etc/cinder/cinder.conf DEFAULT volume_driver cinder.volume.drivers.nfs.NfsDriver
  • Cinder再起動
# service openstack-cinder-volume restart

動作確認

# cinder create --display_name test 1
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2016-01-08T05:08:08.277880      |
| display_description |                 None                 |
|     display_name    |                 test                 |
|      encrypted      |                False                 |
|          id         | 3d6f7675-f354-4fad-9195-fd335311a53a |
|       metadata      |                  {}                  |
|         size        |                  1                   |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+

# cinder list
+--------------------------------------+-----------+-------------------+------+-------------+----------+-------------+
|                  ID                  |   Status  |    Display Name   | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+-------------------+------+-------------+----------+-------------+
| 3d6f7675-f354-4fad-9195-fd335311a53a | available |        test       |  1   |     None    |  false   |             |
+--------------------------------------+-----------+-------------------+------+-------------+----------+-------------+

3
2
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
3
2