Openstack I版 结合 Ceph 分布式存储 部署安装(三)

配置NOVA计算服务控制

安装服务

yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor \
  openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler \
  python-novaclient -y

同步ceph的配置文件

scp -r root@ceph-node01:/etc/ceph/ceph.conf root@controller:/etc/ceph/

备份nova配置文件

mv /etc/nova/nova.conf /etc/nova/nova.conf.bak

创建新的nova.conf
vi /etc/nova/nova.conf

[DEFAULT]
rpc_backend = qpid
qpid_hostname = controller
my_ip = 10.0.0.11
vncserver_listen = 10.0.0.11
vncserver_proxyclient_address = 10.0.0.11
auth_strategy = keystone
libvirt_images_type=rbd
libvirt_images_rbd_pool=volumes
libvirt_images_rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=volumes
network_api_class = nova.network.neutronv2.api.API
neutron_url = http://controller:9696
neutron_auth_strategy = keystone
neutron_admin_tenant_name = service
neutron_admin_username = neutron
neutron_admin_password = NEUTRON_PASS
neutron_admin_auth_url = http://controller:35357/v2.0
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
security_group_api = neutron
service_neutron_metadata_proxy = true
neutron_metadata_proxy_shared_secret = neutron
[baremetal]
[cells]
[conductor]
[database]
connection = mysql://nova:NOVA_DBPASS@controller/nova
[hyperv]
[image_file_url]
[keymgr]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_protocol = http
auth_port = 35357
admin_user = nova
admin_tenant_name = service
admin_password = NOVA_PASS
[libvirt]
virt_type=kvm
[matchmaker_ring]
[metrics]
[osapi_v3]
[rdp]
[spice]
[ssl]
[trusted_computing]
[upgrade_levels]
[vmware]
[xenserver]
[zookeeper]

修改配置文件权限

chown -R root:nova /etc/nova/nova.conf

同步导入nova数据库表

su -s /bin/sh -c "nova-manage db sync" nova

创建Nova管理员用户、角色、端点服务

keystone user-create --name=nova --pass=NOVA_PASS [email protected]
keystone user-role-add --user=nova --tenant=service --role=admin
keystone service-create --name=nova --type=compute \
  --description="OpenStack Compute" keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ compute / {print $2}') \ --publicurl=http://controller:8774/v2/%\(tenant_id\)s \ --internalurl=http://controller:8774/v2/%\(tenant_id\)s \ --adminurl=http://controller:8774/v2/%\(tenant_id\)s

启动nova相关服务

service openstack-nova-api start
service openstack-nova-cert start
service openstack-nova-consoleauth start
service openstack-nova-scheduler start
service openstack-nova-conductor start
service openstack-nova-novncproxy start
chkconfig openstack-nova-api on
chkconfig openstack-nova-cert on
chkconfig openstack-nova-consoleauth on
chkconfig openstack-nova-scheduler on
chkconfig openstack-nova-conductor on
chkconfig openstack-nova-novncproxy on

配置Glance镜像管理服务

安装组件

yum install openstack-glance python-glanceclient -y

备份glance配置文件

mv /etc/glance/glance-api.conf /etc/glance/glance-api.conf.bak
mv /etc/glance/glance-registry.conf /etc/glance/glance-registry.conf.bak

创建api配置文件,其中指定ceph rbd 参数
vi /etc/glance/glance-api.conf

[DEFAULT]
rpc_backend = qpid
qpid_hostname = controller
default_store=rbd
rbd_store_user=images
rbd_store_pool=images
show_image_direct_url=True
[database]
connection = mysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = GLANCE_PASS
[paste_deploy]
flavor = keystone
[store_type_location_strategy]

vi /etc/glance/glance-registry.conf

[DEFAULT]
[database]
connection = mysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = GLANCE_PASS
[paste_deploy]
flavor = keystone

修改配置文件权限

chown -R root:glance /etc/glance-api.conf
chown -R root:glance /etc/glance-registry.conf

同步导入glance数据库表

su -s /bin/sh -c "glance-manage db_sync" glance

创建glance用户、角色、端点服务

keystone user-create --name=glance --pass=GLANCE_PASS --email=glance@example.com
keystone user-role-add --user=glance --tenant=service --role=admin
keystone service-create --name=glance --type=image --description="OpenStack Image Service"
keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ image / {print $2}') \
--publicurl=http://controller:9292 \
--internalurl=http://controller:9292 \
--adminurl=http://controller:9292

修改ceph密钥权限

chown -R glance:glance /etc/ceph/ceph.client.images.keyring

启动glance相关服务

service openstack-glance-api start
service openstack-glance-registry start
chkconfig openstack-glance-api on
chkconfig openstack-glance-registry on

Glance 创建image镜像

下载cirrros镜像文件

wget http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img

上传到glance管理

glance image-create --name "cirros-0.3.2-x86_64" --disk-format qcow2 --container-format bare --is-public True --progress < cirros-0.3.2-x86_64-disk.img

查看上传好的镜像,active为正常状态

[root@controller ~]# glance image-list
+--------------------------------------+---------------------+-------------+------------------+----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+---------------------+-------------+------------------+----------+--------+
| 1d21b295-ceba-47b5-a0d7-611e77659cf2 | cirros-0.3.2-x86_64 | qcow2 | bare | 13167616 | active | +--------------------------------------+---------------------+-------------+------------------+----------+--------+

你可能感兴趣的:(openstack)