很多新手在入门 OpenStack 时往往会被复杂的部署步骤所困扰,如何快速拥有一个 openstack 实验环境呢,我选择 packstack,虽然是上古年间的工具,但是不得不说,真香~~~

1、实验环境

主机名 硬件,系统 网卡 IP
controller1 16g 500g,centos-2003 enp7s0 192.168.100.11
controller1 16g 500g,centos-2003 enp8s0 10.110.45.246
compute1 16g 3t,centos-2003 enp8s0 192.168.100.12
compute1 16g 3t,centos-2003 enp9s0 10.110.45.247
compute2 16g 3t,centos-2003 enp7s0 192.168.100.13
compute2 16g 3t,centos-2003 enp8s0 10.110.45.248

注意:第一块网卡为管理地址,第二块网卡为外网地址,本次实验使用100 网段为管理 ip,45 网段为公网(假装)ip,用作访问外网

2、配置 yum 源。(在所有节点)

由于前期已经在校园网上配置了完整的yum源,故直接拿来使用。
将ftp://10.110.45.221/bendi.repo下载到本地,并上传至所有节点的/etc/yum.repos.d目录。

  1. [root@compute2 ~]# scp root@10.110.45.221:/opt/bendi.repo /etc/yum.repos.d/
  2. 注:如果不知道密码,可以使用其他方法复制。
  3. [root@compute2 ~]# cd /etc/yum.repos.d
  4. [root@compute2 ~]# mkdir bak
  5. [root@compute2 ~]# mv C* bak
  6. [root@compute2 ~]# yum clean all
  7. [root@compute2 ~]#yum repolist

在控制节点上执行

  1. hostnamectl set-hostname controller1
  2. vi /etc/hosts
  3. 写入
  4. 192.168.100.11 controller1
  5. 192.168.100.12 compute1
  6. 192.168.100.13 compute2

在计算节点1上执行

  1. hostnamectl set-hostname compute1
  2. vi /etc/hosts
  3. 写入
  4. 192.168.100.11 controller1
  5. 192.168.100.12 compute1
  6. 192.168.100.13 compute2

在计算节点2上执行

  1. hostnamectl set-hostname compute2
  2. vi /etc/hosts
  3. 写入
  4. 192.168.100.11 controller1
  5. 192.168.100.12 compute1
  6. 192.168.100.13 compute2

3、做预处理在所有节点上

  1. echo 'net.ipv4.ip_forward=1 ' >>/etc/sysctl.conf
  2. echo 'net.ipv4.tcp_tw_recycle=1 ' >>/etc/sysctl.conf
  3. echo 'net.ipv4.tcp_tw_reuse=1 ' >>/etc/sysctl.conf
  4. sysctl -p
  5. chmod +x /etc/rc.d/rc.local
  6. yum install -y mlocate lrzsz tree vim nc nmap wget bash-completion bash-completion-extras cowsay sl htop iotop iftop lsof net-tools sysstat unzip bc psmisc ntpdate wc telnet-server bind-utils sshpass
  7. systemctl stop firewalld
  8. systemctl disable firewalld
  9. setenforce 0
  10. sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
  11. systemctl stop NetworkManager
  12. systemctl disable NetworkManager
  13. yum clean all
  14. yum makecache
  15. ntpdate ntp1.aliyun.com
  16. echo '*/30 * * * * /sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1' >>/var/spool/cron/root

4、安装 packstack 并配置应答文件(从本步开始,只在 packstack(控制节点) 做配置)

  1. yum install centos-release-openstack-train -y
  2. #将新增加的yum源文件移到bak目录,因为我们的本地源里面有该要的rpm。
  3. cd /etc/yum.repos.d
  4. mv C* bak
  5. yum install openstack-packstack -y
  6. #不执行此步骤会故障报错
  7. #facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
  8. #leatherman rpm包版本问题
  9. yum list | grep leatherman
  10. #leatherman.x86_64 1.10.0-1.el7 @epel
  11. #leatherman-devel.x86_64 1.10.0-1.el7 epel
  12. #而facter需要1.3.0
  13. facter -p
  14. #facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
  15. #回退leatherman版本
  16. yum downgrade leatherman -y
  17. #生成应答文件
  18. packstack --gen-answer-file=openstack.txt
  19. #用vim编辑 openstack.txt具体修改的内容在下一个代码框。
  20. vim openstack.txt
  21. #设置所有密码为123456
  22. sed -i -r 's/(.+_PW)=.+/\1=123456/' openstack.txt
  23. #备份应答文件
  24. egrep -v "^#|^$" openstack.txt >openstack.txt.bak1
  25. #使用openstack.txt应答文件进行系统自动部署。
  26. packstack --answer-file=openstack.txt
  27. 此时可以喝杯茶,或者吃个饭,完事就可以看到安装完成的 openstack
  28. 完成后即可在浏览器打开http://192.168.100.11 访问 dashboard
  1. vim openstack.txt
  2. 41 CONFIG_SWIFT_INSTALL=n #y-n SWIFT是OpenStack的对象存储组件,默认是Y,在生产环境中一般是不装,所以改n
  3. 50 CONFIG_AODH_INSTALL=n #y-n 不安装该服务
  4. 97 CONFIG_COMPUTE_HOSTS=192.168.100.12,192.168.100.13 #计算节点ip地址,IP地址之间用英文逗号隔开。
  5. 795 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat
  6. 801 CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
  7. 808 CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch
  8. 813 CONFIG_NEUTRON_ML2_FLAT_NETWORKS=enp7s0 #flat网络这边要设置物理网卡名字
  9. 840 CONFIG_NEUTRON_L2_AGENT=openvswitch #L2网络的代理模式,也可选择linuxbridge
  10. 858 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=enp7s0:br-ex #这边要设置物理网卡的名字
  11. 869 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:enp8s0 #这边br-ex:eth0是网络节点的nat网卡,到时候安装完毕之后IP地址会漂到这个上
  12. 1181 CONFIG_PROVISION_DEMO=n #DEMO是OpenStack联网下载一个测试镜像,这边没联网。说以改成n

注意:以下仅作为参考。不是必须要做的。

packstack 部署禁止了 openstack 的 dashbrard 界面对域的支持,需要可打开

  1. vim /etc/openstack-dashboard/local_settings
  2. 79 OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
  3. 85 OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
  4. 461 TIME_ZONE = "Asia/Shanghai"
  5. systemctl restart httpd.service memcached.service

查看用户密码:

  1. #使用admin用户的变量文件
  2. [root@controller1 ~]# . keystonerc_admin
  3. [root@controller1 ~]# cat keystonerc_admin
  4. export OS_USERNAME=admin
  5. export OS_PASSWORD='123456'
  6. export OS_REGION_NAME=RegionOne
  7. export OS_AUTH_URL=http://192.168.100.11:5000/v3
  8. export OS_PROJECT_NAME=admin
  9. export OS_USER_DOMAIN_NAME=Default
  10. export OS_PROJECT_DOMAIN_NAME=Default
  11. export OS_IDENTITY_API_VERSION=3
  12. [root@controller1 ~(keystone_admin)]# openstack network agent list
  13. +--------------------------------------+--------------------+-------------+-------------------+-------+-------+---------------------------+
  14. | ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
  15. +--------------------------------------+--------------------+-------------+-------------------+-------+-------+---------------------------+
  16. | 0743b47d-8b77-4fce-b0b1-5dcf9c71ec9a | Open vSwitch agent | controller1 | None | :-) | UP | neutron-openvswitch-agent |
  17. | 21932357-d17d-4cee-bf26-19a5b3e93085 | Open vSwitch agent | compute1 | None | :-) | UP | neutron-openvswitch-agent |
  18. | 3b79817d-fd7b-4cbb-a0d4-eb02d5082967 | Open vSwitch agent | compute2 | None | :-) | UP | neutron-openvswitch-agent |
  19. | 52e5dd18-bc66-465d-ab7f-114835be3414 | Metering agent | controller1 | None | :-) | UP | neutron-metering-agent |
  20. | 84c1fa8f-b28a-43af-b198-d1f65bcd319a | DHCP agent | controller1 | nova | :-) | UP | neutron-dhcp-agent |
  21. | e9b2bc7e-a06c-4498-acc7-40595b677d4e | Metadata agent | controller1 | None | :-) | UP | neutron-metadata-agent |
  22. | fedead92-7d25-48ce-9743-4393cd92d8cd | L3 agent | controller1 | nova | :-) | UP | neutron-l3-agent |
  23. +--------------------------------------+--------------------+-------------+-------------------+-------+-------+---------------------------+

openstack.txt应答文件内容,仅供参考。

  1. [general]
  2. CONFIG_SSH_KEY=/root/.ssh/id_rsa.pub
  3. CONFIG_DEFAULT_PASSWORD=
  4. CONFIG_SERVICE_WORKERS=%{::processorcount}
  5. CONFIG_MARIADB_INSTALL=y
  6. CONFIG_GLANCE_INSTALL=y
  7. CONFIG_CINDER_INSTALL=y
  8. CONFIG_MANILA_INSTALL=n
  9. CONFIG_NOVA_INSTALL=y
  10. CONFIG_NEUTRON_INSTALL=y
  11. CONFIG_HORIZON_INSTALL=y
  12. CONFIG_SWIFT_INSTALL=n
  13. CONFIG_CEILOMETER_INSTALL=y
  14. CONFIG_AODH_INSTALL=n
  15. CONFIG_PANKO_INSTALL=n
  16. CONFIG_SAHARA_INSTALL=n
  17. CONFIG_HEAT_INSTALL=n
  18. CONFIG_MAGNUM_INSTALL=n
  19. CONFIG_TROVE_INSTALL=n
  20. CONFIG_IRONIC_INSTALL=n
  21. CONFIG_CLIENT_INSTALL=y
  22. CONFIG_NTP_SERVERS=
  23. EXCLUDE_SERVERS=
  24. CONFIG_DEBUG_MODE=n
  25. CONFIG_CONTROLLER_HOST=192.168.100.11
  26. CONFIG_COMPUTE_HOSTS=192.168.100.12,192.168.100.13
  27. CONFIG_NETWORK_HOSTS=192.168.100.11
  28. CONFIG_VMWARE_BACKEND=n
  29. CONFIG_UNSUPPORTED=n
  30. CONFIG_USE_SUBNETS=n
  31. CONFIG_VCENTER_HOST=
  32. CONFIG_VCENTER_USER=
  33. CONFIG_VCENTER_PASSWORD=
  34. CONFIG_VCENTER_CLUSTER_NAMES=
  35. CONFIG_STORAGE_HOST=192.168.100.11
  36. CONFIG_SAHARA_HOST=192.168.100.11
  37. CONFIG_REPO=
  38. CONFIG_ENABLE_RDO_TESTING=n
  39. CONFIG_RH_USER=
  40. CONFIG_SATELLITE_URL=
  41. CONFIG_RH_SAT6_SERVER=
  42. CONFIG_RH_PW=
  43. CONFIG_RH_OPTIONAL=y
  44. CONFIG_RH_PROXY=
  45. CONFIG_RH_SAT6_ORG=
  46. CONFIG_RH_SAT6_KEY=
  47. CONFIG_RH_PROXY_PORT=
  48. CONFIG_RH_PROXY_USER=
  49. CONFIG_RH_PROXY_PW=
  50. CONFIG_SATELLITE_USER=
  51. CONFIG_SATELLITE_PW=
  52. CONFIG_SATELLITE_AKEY=
  53. CONFIG_SATELLITE_CACERT=
  54. CONFIG_SATELLITE_PROFILE=
  55. CONFIG_SATELLITE_FLAGS=
  56. CONFIG_SATELLITE_PROXY=
  57. CONFIG_SATELLITE_PROXY_USER=
  58. CONFIG_SATELLITE_PROXY_PW=
  59. CONFIG_SSL_CACERT_FILE=/etc/pki/tls/certs/selfcert.crt
  60. CONFIG_SSL_CACERT_KEY_FILE=/etc/pki/tls/private/selfkey.key
  61. CONFIG_SSL_CERT_DIR=~/packstackca/
  62. CONFIG_SSL_CACERT_SELFSIGN=y
  63. CONFIG_SSL_CERT_SUBJECT_C=--
  64. CONFIG_SSL_CERT_SUBJECT_ST=State
  65. CONFIG_SSL_CERT_SUBJECT_L=City
  66. CONFIG_SSL_CERT_SUBJECT_O=openstack
  67. CONFIG_SSL_CERT_SUBJECT_OU=packstack
  68. CONFIG_SSL_CERT_SUBJECT_CN=controller1
  69. CONFIG_SSL_CERT_SUBJECT_MAIL=admin@controller1
  70. CONFIG_AMQP_BACKEND=rabbitmq
  71. CONFIG_AMQP_HOST=192.168.100.11
  72. CONFIG_AMQP_ENABLE_SSL=n
  73. CONFIG_AMQP_ENABLE_AUTH=n
  74. CONFIG_AMQP_NSS_CERTDB_PW=000000
  75. CONFIG_AMQP_AUTH_USER=amqp_user
  76. CONFIG_AMQP_AUTH_PASSWORD=PW_PLACEHOLDER
  77. CONFIG_MARIADB_HOST=192.168.100.11
  78. CONFIG_MARIADB_USER=root
  79. CONFIG_MARIADB_PW=000000
  80. CONFIG_KEYSTONE_DB_PW=000000
  81. CONFIG_KEYSTONE_FERNET_TOKEN_ROTATE_ENABLE=True
  82. CONFIG_KEYSTONE_REGION=RegionOne
  83. CONFIG_KEYSTONE_ADMIN_TOKEN=9ca4529914f64da4b4f31222bbffbeed
  84. CONFIG_KEYSTONE_ADMIN_EMAIL=root@localhost
  85. CONFIG_KEYSTONE_ADMIN_USERNAME=admin
  86. CONFIG_KEYSTONE_ADMIN_PW=000000
  87. CONFIG_KEYSTONE_DEMO_PW=000000
  88. CONFIG_KEYSTONE_API_VERSION=v3
  89. CONFIG_KEYSTONE_TOKEN_FORMAT=FERNET
  90. CONFIG_KEYSTONE_IDENTITY_BACKEND=sql
  91. CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.100.11
  92. CONFIG_KEYSTONE_LDAP_USER_DN=
  93. CONFIG_KEYSTONE_LDAP_USER_PASSWORD=
  94. CONFIG_KEYSTONE_LDAP_SUFFIX=
  95. CONFIG_KEYSTONE_LDAP_QUERY_SCOPE=one
  96. CONFIG_KEYSTONE_LDAP_PAGE_SIZE=-1
  97. CONFIG_KEYSTONE_LDAP_USER_SUBTREE=
  98. CONFIG_KEYSTONE_LDAP_USER_FILTER=
  99. CONFIG_KEYSTONE_LDAP_USER_OBJECTCLASS=
  100. CONFIG_KEYSTONE_LDAP_USER_ID_ATTRIBUTE=
  101. CONFIG_KEYSTONE_LDAP_USER_NAME_ATTRIBUTE=
  102. CONFIG_KEYSTONE_LDAP_USER_MAIL_ATTRIBUTE=
  103. CONFIG_KEYSTONE_LDAP_USER_ENABLED_ATTRIBUTE=
  104. CONFIG_KEYSTONE_LDAP_USER_ENABLED_MASK=-1
  105. CONFIG_KEYSTONE_LDAP_USER_ENABLED_DEFAULT=TRUE
  106. CONFIG_KEYSTONE_LDAP_USER_ENABLED_INVERT=n
  107. CONFIG_KEYSTONE_LDAP_USER_ATTRIBUTE_IGNORE=
  108. CONFIG_KEYSTONE_LDAP_USER_DEFAULT_PROJECT_ID_ATTRIBUTE=
  109. CONFIG_KEYSTONE_LDAP_USER_ALLOW_CREATE=n
  110. CONFIG_KEYSTONE_LDAP_USER_ALLOW_UPDATE=n
  111. CONFIG_KEYSTONE_LDAP_USER_ALLOW_DELETE=n
  112. CONFIG_KEYSTONE_LDAP_USER_PASS_ATTRIBUTE=
  113. CONFIG_KEYSTONE_LDAP_USER_ENABLED_EMULATION_DN=
  114. CONFIG_KEYSTONE_LDAP_USER_ADDITIONAL_ATTRIBUTE_MAPPING=
  115. CONFIG_KEYSTONE_LDAP_GROUP_SUBTREE=
  116. CONFIG_KEYSTONE_LDAP_GROUP_FILTER=
  117. CONFIG_KEYSTONE_LDAP_GROUP_OBJECTCLASS=
  118. CONFIG_KEYSTONE_LDAP_GROUP_ID_ATTRIBUTE=
  119. CONFIG_KEYSTONE_LDAP_GROUP_NAME_ATTRIBUTE=
  120. CONFIG_KEYSTONE_LDAP_GROUP_MEMBER_ATTRIBUTE=
  121. CONFIG_KEYSTONE_LDAP_GROUP_DESC_ATTRIBUTE=
  122. CONFIG_KEYSTONE_LDAP_GROUP_ATTRIBUTE_IGNORE=
  123. CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_CREATE=n
  124. CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_UPDATE=n
  125. CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_DELETE=n
  126. CONFIG_KEYSTONE_LDAP_GROUP_ADDITIONAL_ATTRIBUTE_MAPPING=
  127. CONFIG_KEYSTONE_LDAP_USE_TLS=n
  128. CONFIG_KEYSTONE_LDAP_TLS_CACERTDIR=
  129. CONFIG_KEYSTONE_LDAP_TLS_CACERTFILE=
  130. CONFIG_KEYSTONE_LDAP_TLS_REQ_CERT=demand
  131. CONFIG_GLANCE_DB_PW=000000
  132. CONFIG_GLANCE_KS_PW=000000
  133. CONFIG_GLANCE_BACKEND=file
  134. CONFIG_CINDER_DB_PW=000000
  135. CONFIG_CINDER_DB_PURGE_ENABLE=True
  136. CONFIG_CINDER_KS_PW=000000
  137. CONFIG_CINDER_BACKEND=lvm
  138. CONFIG_CINDER_VOLUMES_CREATE=y
  139. CONFIG_CINDER_VOLUME_NAME=cinder-volumes
  140. CONFIG_CINDER_VOLUMES_SIZE=2G
  141. CONFIG_CINDER_GLUSTER_MOUNTS=
  142. CONFIG_CINDER_NFS_MOUNTS=
  143. CONFIG_CINDER_NETAPP_LOGIN=
  144. CONFIG_CINDER_NETAPP_PASSWORD=
  145. CONFIG_CINDER_NETAPP_HOSTNAME=
  146. CONFIG_CINDER_NETAPP_SERVER_PORT=80
  147. CONFIG_CINDER_NETAPP_STORAGE_FAMILY=ontap_cluster
  148. CONFIG_CINDER_NETAPP_TRANSPORT_TYPE=http
  149. CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL=nfs
  150. CONFIG_CINDER_NETAPP_SIZE_MULTIPLIER=1.0
  151. CONFIG_CINDER_NETAPP_EXPIRY_THRES_MINUTES=720
  152. CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START=20
  153. CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP=60
  154. CONFIG_CINDER_NETAPP_NFS_SHARES=
  155. CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG=/etc/cinder/shares.conf
  156. CONFIG_CINDER_NETAPP_VOLUME_LIST=
  157. CONFIG_CINDER_NETAPP_VFILER=
  158. CONFIG_CINDER_NETAPP_PARTNER_BACKEND_NAME=
  159. CONFIG_CINDER_NETAPP_VSERVER=
  160. CONFIG_CINDER_NETAPP_CONTROLLER_IPS=
  161. CONFIG_CINDER_NETAPP_SA_PASSWORD=
  162. CONFIG_CINDER_NETAPP_ESERIES_HOST_TYPE=linux_dm_mp
  163. CONFIG_CINDER_NETAPP_WEBSERVICE_PATH=/devmgr/v2
  164. CONFIG_CINDER_NETAPP_STORAGE_POOLS=
  165. CONFIG_CINDER_SOLIDFIRE_LOGIN=
  166. CONFIG_CINDER_SOLIDFIRE_PASSWORD=
  167. CONFIG_CINDER_SOLIDFIRE_HOSTNAME=
  168. CONFIG_IRONIC_DB_PW=000000
  169. CONFIG_IRONIC_KS_PW=000000
  170. CONFIG_NOVA_DB_PURGE_ENABLE=True
  171. CONFIG_NOVA_DB_PW=000000
  172. CONFIG_NOVA_KS_PW=000000
  173. CONFIG_NOVA_MANAGE_FLAVORS=y
  174. CONFIG_NOVA_SCHED_CPU_ALLOC_RATIO=16.0
  175. CONFIG_NOVA_SCHED_RAM_ALLOC_RATIO=1.5
  176. CONFIG_NOVA_COMPUTE_MIGRATE_PROTOCOL=ssh
  177. CONFIG_VNC_SSL_CERT=
  178. CONFIG_VNC_SSL_KEY=
  179. CONFIG_NOVA_PCI_ALIAS=
  180. CONFIG_NOVA_PCI_PASSTHROUGH_WHITELIST=
  181. CONFIG_NOVA_LIBVIRT_VIRT_TYPE=%{::default_hypervisor}
  182. CONFIG_NEUTRON_KS_PW=000000
  183. CONFIG_NEUTRON_DB_PW=000000
  184. CONFIG_NEUTRON_L3_EXT_BRIDGE=br-ex
  185. CONFIG_NEUTRON_METADATA_PW=000000
  186. CONFIG_NEUTRON_METERING_AGENT_INSTALL=y
  187. CONFIG_NEUTRON_FWAAS=n
  188. CONFIG_NEUTRON_VPNAAS=n
  189. CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat
  190. CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
  191. CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch
  192. CONFIG_NEUTRON_ML2_FLAT_NETWORKS=enp7s0
  193. CONFIG_NEUTRON_ML2_VLAN_RANGES=
  194. CONFIG_NEUTRON_ML2_TUNNEL_ID_RANGES=
  195. CONFIG_NEUTRON_ML2_VXLAN_GROUP=
  196. CONFIG_NEUTRON_ML2_VNI_RANGES=10:100
  197. CONFIG_NEUTRON_L2_AGENT=openvswitch
  198. CONFIG_NEUTRON_ML2_SRIOV_INTERFACE_MAPPINGS=
  199. CONFIG_NEUTRON_LB_INTERFACE_MAPPINGS=
  200. CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=enp7s0:br-ex
  201. CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:enp8s0
  202. CONFIG_NEUTRON_OVS_BRIDGES_COMPUTE=
  203. CONFIG_NEUTRON_OVS_EXTERNAL_PHYSNET=extnet
  204. CONFIG_NEUTRON_OVS_TUNNEL_IF=
  205. CONFIG_NEUTRON_OVS_TUNNEL_SUBNETS=
  206. CONFIG_NEUTRON_OVS_VXLAN_UDP_PORT=4789
  207. CONFIG_NEUTRON_OVN_BRIDGE_MAPPINGS=extnet:br-ex
  208. CONFIG_NEUTRON_OVN_BRIDGE_IFACES=
  209. CONFIG_NEUTRON_OVN_BRIDGES_COMPUTE=
  210. CONFIG_NEUTRON_OVN_EXTERNAL_PHYSNET=extnet
  211. CONFIG_NEUTRON_OVN_TUNNEL_IF=
  212. CONFIG_NEUTRON_OVN_TUNNEL_SUBNETS=
  213. CONFIG_MANILA_DB_PW=000000
  214. CONFIG_MANILA_KS_PW=000000
  215. CONFIG_MANILA_BACKEND=generic
  216. CONFIG_MANILA_NETAPP_DRV_HANDLES_SHARE_SERVERS=false
  217. CONFIG_MANILA_NETAPP_TRANSPORT_TYPE=https
  218. CONFIG_MANILA_NETAPP_LOGIN=admin
  219. CONFIG_MANILA_NETAPP_PASSWORD=
  220. CONFIG_MANILA_NETAPP_SERVER_HOSTNAME=
  221. CONFIG_MANILA_NETAPP_STORAGE_FAMILY=ontap_cluster
  222. CONFIG_MANILA_NETAPP_SERVER_PORT=443
  223. CONFIG_MANILA_NETAPP_AGGREGATE_NAME_SEARCH_PATTERN=(.*)
  224. CONFIG_MANILA_NETAPP_ROOT_VOLUME_AGGREGATE=
  225. CONFIG_MANILA_NETAPP_ROOT_VOLUME_NAME=root
  226. CONFIG_MANILA_NETAPP_VSERVER=
  227. CONFIG_MANILA_GENERIC_DRV_HANDLES_SHARE_SERVERS=true
  228. CONFIG_MANILA_GENERIC_VOLUME_NAME_TEMPLATE=manila-share-%s
  229. CONFIG_MANILA_GENERIC_SHARE_MOUNT_PATH=/shares
  230. CONFIG_MANILA_SERVICE_IMAGE_LOCATION=https://www.dropbox.com/s/vi5oeh10q1qkckh/ubuntu_1204_nfs_cifs.qcow2
  231. CONFIG_MANILA_SERVICE_INSTANCE_USER=ubuntu
  232. CONFIG_MANILA_SERVICE_INSTANCE_PASSWORD=ubuntu
  233. CONFIG_MANILA_NETWORK_TYPE=neutron
  234. CONFIG_MANILA_NETWORK_STANDALONE_GATEWAY=
  235. CONFIG_MANILA_NETWORK_STANDALONE_NETMASK=
  236. CONFIG_MANILA_NETWORK_STANDALONE_SEG_ID=
  237. CONFIG_MANILA_NETWORK_STANDALONE_IP_RANGE=
  238. CONFIG_MANILA_NETWORK_STANDALONE_IP_VERSION=4
  239. CONFIG_MANILA_GLUSTERFS_SERVERS=
  240. CONFIG_MANILA_GLUSTERFS_NATIVE_PATH_TO_PRIVATE_KEY=
  241. CONFIG_MANILA_GLUSTERFS_VOLUME_PATTERN=
  242. CONFIG_MANILA_GLUSTERFS_TARGET=
  243. CONFIG_MANILA_GLUSTERFS_MOUNT_POINT_BASE=
  244. CONFIG_MANILA_GLUSTERFS_NFS_SERVER_TYPE=gluster
  245. CONFIG_MANILA_GLUSTERFS_PATH_TO_PRIVATE_KEY=
  246. CONFIG_MANILA_GLUSTERFS_GANESHA_SERVER_IP=
  247. CONFIG_HORIZON_SSL=n
  248. CONFIG_HORIZON_SECRET_KEY=3d13779b7c2d40d19d3bec5d15f47575
  249. CONFIG_HORIZON_SSL_CERT=
  250. CONFIG_HORIZON_SSL_KEY=
  251. CONFIG_HORIZON_SSL_CACERT=
  252. CONFIG_SWIFT_KS_PW=000000
  253. CONFIG_SWIFT_STORAGES=
  254. CONFIG_SWIFT_STORAGE_ZONES=1
  255. CONFIG_SWIFT_STORAGE_REPLICAS=1
  256. CONFIG_SWIFT_STORAGE_FSTYPE=ext4
  257. CONFIG_SWIFT_HASH=20e88edd9f9d4e86
  258. CONFIG_SWIFT_STORAGE_SIZE=2G
  259. CONFIG_HEAT_DB_PW=000000
  260. CONFIG_HEAT_AUTH_ENC_KEY=3103d76d9338406f
  261. CONFIG_HEAT_KS_PW=000000
  262. CONFIG_HEAT_CFN_INSTALL=y
  263. CONFIG_HEAT_DOMAIN=heat
  264. CONFIG_HEAT_DOMAIN_ADMIN=heat_admin
  265. CONFIG_HEAT_DOMAIN_PASSWORD=PW_PLACEHOLDER
  266. CONFIG_PROVISION_DEMO=n
  267. CONFIG_PROVISION_TEMPEST=n
  268. CONFIG_PROVISION_DEMO_FLOATRANGE=172.24.4.0/24
  269. CONFIG_PROVISION_DEMO_ALLOCATION_POOLS=[]
  270. CONFIG_PROVISION_IMAGE_NAME=cirros
  271. CONFIG_PROVISION_IMAGE_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
  272. CONFIG_PROVISION_IMAGE_FORMAT=qcow2
  273. CONFIG_PROVISION_IMAGE_PROPERTIES=
  274. CONFIG_PROVISION_IMAGE_SSH_USER=cirros
  275. CONFIG_PROVISION_UEC_IMAGE_NAME=cirros-uec
  276. CONFIG_PROVISION_UEC_IMAGE_KERNEL_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-kernel
  277. CONFIG_PROVISION_UEC_IMAGE_RAMDISK_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-initramfs
  278. CONFIG_PROVISION_UEC_IMAGE_DISK_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
  279. CONFIG_TEMPEST_HOST=
  280. CONFIG_PROVISION_TEMPEST_USER=
  281. CONFIG_PROVISION_TEMPEST_USER_PW=000000
  282. CONFIG_PROVISION_TEMPEST_FLOATRANGE=172.24.4.0/24
  283. CONFIG_PROVISION_TEMPEST_FLAVOR_NAME=m1.nano
  284. CONFIG_PROVISION_TEMPEST_FLAVOR_DISK=1
  285. CONFIG_PROVISION_TEMPEST_FLAVOR_RAM=128
  286. CONFIG_PROVISION_TEMPEST_FLAVOR_VCPUS=1
  287. CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_NAME=m1.micro
  288. CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_DISK=1
  289. CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_RAM=128
  290. CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_VCPUS=1
  291. CONFIG_RUN_TEMPEST=n
  292. CONFIG_RUN_TEMPEST_TESTS=smoke
  293. CONFIG_PROVISION_OVS_BRIDGE=y
  294. CONFIG_GNOCCHI_DB_PW=000000
  295. CONFIG_GNOCCHI_KS_PW=000000
  296. CONFIG_CEILOMETER_SECRET=d90bc65daa5c41d9
  297. CONFIG_CEILOMETER_KS_PW=000000
  298. CONFIG_CEILOMETER_SERVICE_NAME=httpd
  299. CONFIG_CEILOMETER_COORDINATION_BACKEND=redis
  300. CONFIG_ENABLE_CEILOMETER_MIDDLEWARE=n
  301. CONFIG_REDIS_HOST=192.168.100.11
  302. CONFIG_REDIS_PORT=6379
  303. CONFIG_AODH_KS_PW=000000
  304. CONFIG_AODH_DB_PW=000000
  305. CONFIG_PANKO_DB_PW=000000
  306. CONFIG_PANKO_KS_PW=000000
  307. CONFIG_TROVE_DB_PW=000000
  308. CONFIG_TROVE_KS_PW=000000
  309. CONFIG_TROVE_NOVA_USER=trove
  310. CONFIG_TROVE_NOVA_TENANT=services
  311. CONFIG_TROVE_NOVA_PW=000000
  312. CONFIG_SAHARA_DB_PW=000000
  313. CONFIG_SAHARA_KS_PW=000000
  314. CONFIG_MAGNUM_DB_PW=000000
  315. CONFIG_MAGNUM_KS_PW=000000
  1. [root@control ~]# yum -y install openstack-packstack
  2. [root@control ~]# packstack --gen-answer-file=openstack.txt
  3. [root@control ~]# sed -i -r 's/192.168.17.10/192.168.100.10/g' openstack.txt
  4. [root@control ~]#vi openstack.txt
  5. 41 CONFIG_SWIFT_INSTALL=n ●第41SWIFTOpenStack的对象存储组件,默认是Y,在生产环境中一般是不装,所以该n
  6. 50 CONFIG_AODH_INSTALL=n ●第50行,默认是Y 需要改n
  7. 94 CONFIG_CONTROLLER_HOST=192.168.100.10 94CONTROLLEROpenStack的控制节点,在控制节点上配置的,不需要更改IP地址。
  8. 97 CONFIG_COMPUTE_HOSTS=192.168.100.11 ●第97行需要更改计算节点的IP地址
  9. 101 CONFIG_NETWORK_HOSTS=192.168.100.10 ●第101 需要更改网络节点的IP地址
  10. 557 CONFIG_CINDER_VOLUMES_SIZE=1G ●第557 系统在创建CINDER组件的的时候回创建一个20G卷,因为我们虚拟机空间有限所以把空间改下点1G
  11. 778 CONFIG_NEUTRON_METADATA_PW=29948657b3aa409c ●第778行,这样的29948657b3aa409c是密码
  12. 782 CONFIG_LBAAS_INSTALL=y ●第782 LBAAS负载均衡组件。必选要装 y
  13. 790 CONFIG_NEUTRON_FWAAS=y ●第790 FWAAS是防火墙组件。必选要装 y
  14. 794 CONFIG_NEUTRON_VPNAAS=y ●第794 VPNAASVPN组件。必选要装 y
  15. 817 CONFIG_NEUTRON_ML2_FLAT_NETWORKS=physnet1 ●第817行,FLAT网络这边要设置物理网卡名字
  16. 862 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex ●第862行,这边要设置物理网卡的名字
  17. 873 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth1 ●第873行,这边br-ex:eth1是网络节点的nat网卡
  18. 1185 CONFIG_PROVISION_DEMO=n ●第1185 OpenStack联网下载一个测试镜像,这边没联网。说以改成n

7、配置网络

创建 br-ex 网桥配置

创建并编辑 / etc/sysconfig/network-scripts/ifcfg-br-ex

DEVICE=br-ex

ONBOOT=yes

DEVICETYPE=ovs

TYPE=OVSBridge

BOOTPROTO=static

IPADDR=192.168.211.60

NETMASK=255.255.255.0

GATEWAY=192.168.211.1

将 ens33 网卡桥接到 br-ex 上去

修改 / etc/sysconfig/network-scripts/ifcfg-ens33

DEVICE=ens33

ONBOOT=yes

DEVICETYPE=ovs

TYPE=OVSPort

BOOTPROTO=yes

OVS_BRIDGE=br-ex

桥接完成后查看网卡信息,会发现 ens33 已经没有了 ip 地址,ip 转移到了 br-ex 网桥上

packstack部署openstack-train三节点 - 图1

通过 dashboard 创建外部网络(选择简单的 flat 类型)

packstack部署openstack-train三节点 - 图2

packstack部署openstack-train三节点 - 图3

创建租户网络

packstack部署openstack-train三节点 - 图4

packstack部署openstack-train三节点 - 图5

创建租户路由

packstack部署openstack-train三节点 - 图6

为路由添加接口到刚刚创建的子网上

packstack部署openstack-train三节点 - 图7

创建完成后查看网络拓扑

packstack部署openstack-train三节点 - 图8

因为 packstack 测试镜像 cirros 都已经下好了 现在就可以愉快的启动实例了

曾经被 openstack 的网络搞的头皮发麻,这里发一下简单的流量走向,请大佬不喜勿喷,如有错误请大佬指点

packstack部署openstack-train三节点 - 图9

https://blog.51cto.com/14210294/2385696