続きましてglanceのインストールからどすえ。
yum -y install openstack-glance
コンフィグのバックアップ
cp -a /etc/glance /etc/glance_bak
これでもくらえと投入するべし。
openstack-config --set /etc/glance/glance-api.conf DEFAULT sql_connection mysql://glance:password@take/glance?charset=utf8
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_password glance
openstack-config --set /etc/glance/glance-registry.conf DEFAULT sql_connection mysql://glance:password@take/glance?charset=utf8
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_password glance
openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone
openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone
sed -i "s#127.0.0.1#take#" /etc/glance/glance-api.conf
sed -i "s#localhost#take#" /etc/glance/glance-api.conf
sed -i "s#127.0.0.1#take#" /etc/glance/glance-registry.conf
sed -i "s#localhost#take#" /etc/glance/glance-registry.conf
glanceのデータベースを作成する
mysql> drop database if exists glance;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> create database glance character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on glance.* to glance identified by'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on glance.* to glance@localhost identified by'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on glance.* to glance@take identified by'password';
Query OK, 0 rows affected (0.00 sec)
mysql> quit
glance-manage db_sync
権限の設定とプロセス起動
chown -R glance:glance /var/log/glance
for i in api registry
do
service openstack-glance-$i restart
done
for i in api registry
do
chkconfig openstack-glance-$i on
done
環境変数を設定してイメージを登録してみる動作確認。
export OS_USERNAME=admin
export OS_PASSWORD=secrete
export OS_TENANT_NAME=demo
export OS_AUTH_URL=http://take:35357/v2.0/
qcow2の作り方は、過去の日記 困ったこと集 を参考にしてくださお。
もしくは参考サイト様のfedoraかcentosを使うなど。
mkdir -p /opt/virt/freebsd ; cd /opt/virt/freebsd
glance image-create --name="freebsd01" --is-public=true --disk-format=qcow2 --container-format=ovf < freebsd9.qcow2
うまくいけばactiveで出来上がるはず。
| status | active |
glanceは以上です。問題なければ次いってみよう。
Cinderのインストールいっきまーす
yum -y install openstack-cinder
コンフィグのバックアップ
cp -a /etc/cinder /etc/cinder_bak
コンフィグを設定します。これ作るのは手間だけど楽でいいっすな。
openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection 'mysql://cinder:password@take/cinder'
openstack-config --set /etc/cinder/cinder.conf DEFAULT qpid_hostname take
openstack-config --set /etc/cinder/cinder.conf DEFAULT qpid_port 5672
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf DEFAULT volume_group cinder-volumes
openstack-config --set /etc/cinder/cinder.conf DEFAULT log_file cinder.log
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_user nova
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password nova
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_host take
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_port 35357
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken service_host take
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken service_port 5000
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken auth_host take
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken auth_port 35357
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken auth_uri http://take:5000/
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken admin_user nova
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken admin_tenant_name service
openstack-config --set /etc/cinder/api-paste.ini filter:authtoken admin_password nova
tgtの設定をします。
vim /etc/tgt/conf.d/cinder.conf
include /etc/cinder/volumes/*
vim /etc/tgt/targets.conf
include /etc/tgt/conf.d/*.conf
service tgtd start
SCSI target daemon を起動中: [ OK ]
chkconfig tgtd on
cinderのデータベース作成しませう。今回もログインして。
mysql> drop database if exists cinder;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> create database cinder character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on cinder.* to cinder identified by'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on cinder.* to cinder@localhost identified by'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on cinder.* to cinder@take identified by'password';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
cinder-manage db sync
cinderを起動します。権限設定とプロセス起動。
chown -R cinder:cinder /var/log/cinder/
for i in volume api scheduler
do
service openstack-cinder-$i restart
done
for i in volume api scheduler
do
chkconfig openstack-cinder-$i on
done
cinder-volumesを作成します。空いてる物理ボリュームに構築する。インストールの段階で物理ボリュームを作成していると吉。
pvcreate /dev/sda3
vgcreate cinder-volumes /dev/sda3
確認してみるとこんな感じ。
[root@take ~]# vgdisplay
--- Volume group ---
VG Name cinder-volumes
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 232.63 GiB
PE Size 4.00 MiB
Total PE 59554
Alloc PE / Size 256 / 1.00 GiB
Free PE / Size 59298 / 231.63 GiB
VG UUID EGcDro-fsZC-xUpm-CGts-Acel-Pvoy-smgIz1
--- Volume group ---
VG Name vg_take
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 232.63 GiB
PE Size 4.00 MiB
Total PE 59554
Alloc PE / Size 59554 / 232.63 GiB
Free PE / Size 0 / 0
VG UUID l8MuDs-rME0-QlPn-AU04-FmRc-wZdv-H5i3k6
glanceとcinderが終わりました。肝はLVMの設定とコンフィグ設定だす。
次はnovaとhorizonのインストールに進もう。