no about note

エンジニアのメモ書き

【Openstack】Glanceのimageの保存先を変更する

Remaining photons from the dying refractions of a nearby rainbow

  • デフォルトは/var/lib/glance/images/
  • /data/glance/imagesに変更する

glance-api.confのfilesystem_store_datadirを変更

# vi /etc/glance/glance-api.conf

#filesystem_store_datadir = /var/lib/glance/images
↓
filesystem_store_datadir = /data/glance/images/

ディレクト作成

# cd /data
# mkdir -p glance/images
# chown -R glance:glance glance/images/

glanceサービスを再起動

# ls /usr/lib/systemd/system/ | grep glance
openstack-glance-api.service
openstack-glance-glare.service
openstack-glance-registry.service
openstack-glance-scrubber.service

# systemctl restart openstack-glance-api.service openstack-glance-glare.service openstack-glance-registry.service openstack-glance-scrubber.service

イメージを再登録

  • インスタンス起動時にCloud not found が出てる
  • 入れなおしたら問題なくいった、保存先をDBとかに持ってたのかもしれない
  • 存在するイメージを一旦削除し、ダウンロードしておいたイメージファイルを再登録すると解決した

参考

Where are the Openstack images stored?