在controller上
创建neutron用户、角色、端点服务1
2
3
4
5
6
7
8keystone user-create --name neutron --pass NEUTRON_PASS --email neutron@example.com
keystone user-role-add --user neutron --tenant service --role admin
keystone service-create --name neutron --type network --description "OpenStack Networking"
keystone endpoint-create \
--service-id $(keystone service-list | awk '/ network / {print $2}') \
--publicurl http://controller:9696 \
--adminurl http://controller:9696 \
--internalurl http://controller:9696
安装neutron-server组件1
yum install openstack-neutron openstack-neutron-ml2 python-neutronclient -y
备份配置文件1
mv /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
创建neutron配置文件
vi /etc/neutron/neutron.conf1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26[DEFAULT]
auth_strategy = keystone
rpc_backend = neutron.openstack.common.rpc.impl_qpid
qpid_hostname = controller
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://controller:8774/v2
nova_admin_username = nova
nova_admin_password = NOVA_PASS
nova_admin_auth_url = http://controller:35357/v2.0
core_plugin = ml2
service_plugins = router
verbose = True
[quotas]
[agent]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_protocol = http
auth_port = 35357
admin_tenant_name = service
admin_user = neutron
admin_password = NEUTRON_PASS
[database]
connection = mysql://neutron:NEUTRON_DBPASS@controller/neutron
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
修改配置文件权限1
chown -R root:neutron /etc/neutron/neutron.conf
配置文件写入服务身份 的租户ID1
2uuid=`keystone tenant-list | awk '/ service / { print $2 }'`
sed -i '/1/a\'"$uuid"'' /etc/neutron/neutron.conf
备份ml2配置文件1
mv /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
创建ml2配置文件
vi /etc/neutron/plugins/ml2/ml2_conf.ini1
2
3
4
5
6
7
8
9
10
11
12[ml2]
type_drivers = gre
tenant_network_types = gre
mechanism_drivers = openvswitch
[ml2_type_flat]
[ml2_type_vlan]
[ml2_type_gre]
tunnel_id_ranges = 1:1000
[ml2_type_vxlan]
[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
enable_security_group = True
修改ml2配置权限1
chown -R root:neutron /etc/neutron/plugins/ml2/ml2_conf.ini
创建软连接指向ml2配置1
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
启动neutron-server服务1
2
3
4
5service openstack-nova-api restart
service openstack-nova-scheduler restart
service openstack-nova-conductor restart
service neutron-server start
chkconfig neutron-server on
安装nova-compute的相关组件1
yum install openstack-nova-compute MySQL-python -y
安装ceph-fuse客户端,以便可以访问cephfs文件系统1
yum install ceph ceph-fuse -y
添加compute节点访问MDS的认证权限
在ceph-node01上执行,获取密钥值并且写入compute节点的目录下1
ceph auth get-or-create client.fuse | ssh compute01 tee /ect/ceph/ceph.client.fuse.keyring
同步ceph配置文件1
scp -r root@ceph-node01:/etc/ceph/ceph.conf root@compute01:/etc/ceph/
启动ceph-fuse挂载cephfs到nova实例目录,必须加上id和key参数1
ceph-fuse -m ceph-node01:6789 /var/lib/nova/instances --id fuse --keyring=/etc/ceph/ceph.client.fuse.keyring
写入启动脚本实现开机自动挂载1
echo "ceph-fuse -m ceph-node01:6789 /var/lib/nova/instances --id fuse --keyring=/etc/ceph/ceph.client.fuse.keyring" >> /etc/rc.local
改变实例目录所属的用户权限1
chown -R nova:nova /var/lib/nova/instances
启动libvirt管理服务1
2service libvirtd start
chkconfig libvirtd on
安装服务1
2
3yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler \
python-novaclient -y
同步ceph的配置文件1
scp -r root@ceph-node01:/etc/ceph/ceph.conf root@controller:/etc/ceph/
备份nova配置文件1
mv /etc/nova/nova.conf /etc/nova/nova.conf.bak
创建新的nova.conf
vi /etc/nova/nova.conf1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52[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]
修改配置文件权限1
chown -R root:nova /etc/nova/nova.conf
同步导入nova数据库表1
su -s /bin/sh -c "nova-manage db sync" nova
创建Nova管理员用户、角色、端点服务1
2
3
4
5
6
7
8
9keystone user-create --name=nova --pass=NOVA_PASS --email=nova@example.com
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相关服务1
2
3
4
5
6
7
8
9
10
11
12service 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
通过Ceph-Deploy部署了3节点的Ceph分布式存储后,先要为openstack的集成做配置准备
在ceph-node01上
创建卷池和镜像池,分别用来存放cinder卷,实例卷,和镜像1
2rados mkpool volumes
rados mkpool images
增加两个pool的复制水平,设置为两份1
2ceph osd pool set volumes size 2
ceph osd pool set images size 2
创建cephx安全认证的密钥1
2
3ceph auth get-or-create client.volumes mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rx pool=images'
ceph auth get-or-create client.images mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'
ceph auth get-or-create client.fuse mon 'allow r' mds 'allow' osd 'allow *'