利用Packstack自动化部署Openstack

事前准备:

①手动部署openstack确实是个麻烦事,packstack可以利用编好的脚本迅速部署可靠的openstack环境,感觉比devstack更简单

②资料参考https://www.rdoproject.org/Quickstart,安装完成后网络还需修改才可使用

③环境:(一台虚拟机(或实体机),40G硬盘以上硬盘,10G以上内存,两块网卡)  注:搭建环境为allinone,所有组件在一台机器上,方便测试

④系统:(系统:RHEL7,Openstack:Kilo,Packstack:2015.1.dev1537.gba5183c)

⑤网络:

ens3: flags=4163  mtu 1500
        inet 192.168.102.80  netmask 255.255.255.0  broadcast 192.168.102.255
        inet6 fe80::5054:ff:fe36:d440  prefixlen 64  scopeid 0x20
        ether 52:54:00:36:d4:40  txqueuelen 1000  (Ethernet)
        RX packets 740715  bytes 35417699 (33.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 34979  bytes 3396552 (3.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens7: flags=4163  mtu 1500
        inet 193.168.140.235  netmask 255.255.0.0  broadcast 193.168.255.255
        inet6 fe80::5054:ff:fe66:b131  prefixlen 64  scopeid 0x20
        ether 52:54:00:66:b1:31  txqueuelen 1000  (Ethernet)
        RX packets 28080082  bytes 1965879786 (1.8 GiB)
        RX errors 0  dropped 286  overruns 0  frame 0
        TX packets 7335  bytes 540350 (527.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
ens3负责内部通信,ens7负责外部通信

⑥添加源:最好是搭建本地源,这样可以是整个部署流程更快,如果没有,添加rdo源

# yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epelrelease-7-5.noarch.rpm
# yum install http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm

就绪,开始!

一、关闭NetworkManager

# systemctl stop NetworkManager
# systemctl disable NetworkManager

二、安装packstack,生成应答文件

# yum install openstack-packstack
# packstack --gen-answer-file=answer.conf
Packstack changed given value  to required value /root/.ssh/id_rsa.pub
 
  

三、根据需要修改应答文件

①选用组件(‘y’为安装,默认如下,可自行修改)

CONFIG_MARIADB_INSTALL=y
CONFIG_GLANCE_INSTALL=y
CONFIG_CINDER_INSTALL=y
CONFIG_MANILA_INSTALL=n
CONFIG_NOVA_INSTALL=y
CONFIG_NEUTRON_INSTALL=y
CONFIG_HORIZON_INSTALL=y
CONFIG_SWIFT_INSTALL=y
CONFIG_CEILOMETER_INSTALL=y
CONFIG_HEAT_INSTALL=n
CONFIG_SAHARA_INSTALL=n
CONFIG_TROVE_INSTALL=n
CONFIG_IRONIC_INSTALL=n
CONFIG_CLIENT_INSTALL=y

②修改组件ip(全部改为对内通信的ip,此处为ens3)

CONFIG_CONTROLLER_HOST=192.168.102.80
CONFIG_COMPUTE_HOSTS=192.168.102.80
CONFIG_NETWORK_HOSTS=192.168.102.80
CONFIG_STORAGE_HOST=192.168.102.80
CONFIG_SAHARA_HOST=192.168.102.80
CONFIG_AMQP_HOST=192.168.102.80
CONFIG_MARIADB_HOST=192.168.102.80
CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.102.80
CONFIG_MONGODB_HOST=192.168.102.80
CONFIG_REDIS_MASTER_HOST=192.168.102.80

③修改admin用户密码,取消demo用户安装(demo可在自动部署完成后自行创建)

 CONFIG_DEFAULT_PASSWORD=shitou92
 CONFIG_KEYSTONE_ADMIN_PW=shitou92
 CONFIG_PROVISION_DEMO=n

④修改neutron网络配置(我习惯用gre)

CONFIG_NEUTRON_ML2_TYPE_DRIVERS=gre
CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=gre
CONFIG_NEUTRON_ML2_TUNNEL_ID_RANGES=100:1000
CONFIG_NEUTRON_OVS_TUNNEL_IF=ens3


四、开始安装

# packstack --answer-file=answer.conf
大约30分钟完成


五、修改网络配置文件

# cd /etc/sysconfig/network-scripts/

# vim ifcfg-br-ex
DEVICE=br-ex
ONBOOT=yes
BOOTPROTO=none
IPADDR=193.168.140.51
NETMASK=255.255.0.0
GATEWAY=193.168.1.1

# vim ifcfg-ens7
TYPE=Ethernet
BOOTPROTO=none
HWADDR=52:54:00:ca:ea:0e
DEVICE=ens7
ONBOOT=yes

# ovs-vsctl add-port br-ex ens7
# service network restart

六、创建网络、创建instance

这些不用讲了吧,参考官网,环境大功告成!!!





你可能感兴趣的:(Openstack)