很多新手在入门 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目录。
[root@compute2 ~]# scp root@10.110.45.221:/opt/bendi.repo /etc/yum.repos.d/
注:如果不知道密码,可以使用其他方法复制。
[root@compute2 ~]# cd /etc/yum.repos.d
[root@compute2 ~]# mkdir bak
[root@compute2 ~]# mv C* bak
[root@compute2 ~]# yum clean all
[root@compute2 ~]#yum repolist
在控制节点上执行
hostnamectl set-hostname controller1
vi /etc/hosts
写入
192.168.100.11 controller1
192.168.100.12 compute1
192.168.100.13 compute2
在计算节点1上执行
hostnamectl set-hostname compute1
vi /etc/hosts
写入
192.168.100.11 controller1
192.168.100.12 compute1
192.168.100.13 compute2
在计算节点2上执行
hostnamectl set-hostname compute2
vi /etc/hosts
写入
192.168.100.11 controller1
192.168.100.12 compute1
192.168.100.13 compute2
3、做预处理在所有节点上
echo 'net.ipv4.ip_forward=1 ' >>/etc/sysctl.conf
echo 'net.ipv4.tcp_tw_recycle=1 ' >>/etc/sysctl.conf
echo 'net.ipv4.tcp_tw_reuse=1 ' >>/etc/sysctl.conf
sysctl -p
chmod +x /etc/rc.d/rc.local
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
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
systemctl stop NetworkManager
systemctl disable NetworkManager
yum clean all
yum makecache
ntpdate ntp1.aliyun.com
echo '*/30 * * * * /sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1' >>/var/spool/cron/root
4、安装 packstack 并配置应答文件(从本步开始,只在 packstack(控制节点) 做配置)
yum install centos-release-openstack-train -y
#将新增加的yum源文件移到bak目录,因为我们的本地源里面有该要的rpm。
cd /etc/yum.repos.d
mv C* bak
yum install openstack-packstack -y
#不执行此步骤会故障报错
#facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
#leatherman rpm包版本问题
yum list | grep leatherman
#leatherman.x86_64 1.10.0-1.el7 @epel
#leatherman-devel.x86_64 1.10.0-1.el7 epel
#而facter需要1.3.0
facter -p
#facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
#回退leatherman版本
yum downgrade leatherman -y
#生成应答文件
packstack --gen-answer-file=openstack.txt
#用vim编辑 openstack.txt具体修改的内容在下一个代码框。
vim openstack.txt
#设置所有密码为123456
sed -i -r 's/(.+_PW)=.+/\1=123456/' openstack.txt
#备份应答文件
egrep -v "^#|^$" openstack.txt >openstack.txt.bak1
#使用openstack.txt应答文件进行系统自动部署。
packstack --answer-file=openstack.txt
此时可以喝杯茶,或者吃个饭,完事就可以看到安装完成的 openstack 了
完成后即可在浏览器打开http://192.168.100.11 访问 dashboard
vim openstack.txt
41 CONFIG_SWIFT_INSTALL=n #y-n SWIFT是OpenStack的对象存储组件,默认是Y,在生产环境中一般是不装,所以改n
50 CONFIG_AODH_INSTALL=n #y-n 不安装该服务
97 CONFIG_COMPUTE_HOSTS=192.168.100.12,192.168.100.13 #计算节点ip地址,IP地址之间用英文逗号隔开。
795 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat
801 CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
808 CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch
813 CONFIG_NEUTRON_ML2_FLAT_NETWORKS=enp7s0 #flat网络这边要设置物理网卡名字
840 CONFIG_NEUTRON_L2_AGENT=openvswitch #L2网络的代理模式,也可选择linuxbridge
858 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=enp7s0:br-ex #这边要设置物理网卡的名字
869 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:enp8s0 #这边br-ex:eth0是网络节点的nat网卡,到时候安装完毕之后IP地址会漂到这个上
1181 CONFIG_PROVISION_DEMO=n #DEMO是OpenStack联网下载一个测试镜像,这边没联网。说以改成n
注意:以下仅作为参考。不是必须要做的。
packstack 部署禁止了 openstack 的 dashbrard 界面对域的支持,需要可打开
vim /etc/openstack-dashboard/local_settings
79 OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
85 OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
461 TIME_ZONE = "Asia/Shanghai"
systemctl restart httpd.service memcached.service
查看用户密码:
#使用admin用户的变量文件
[root@controller1 ~]# . keystonerc_admin
[root@controller1 ~]# cat keystonerc_admin
export OS_USERNAME=admin
export OS_PASSWORD='123456'
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://192.168.100.11:5000/v3
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3
[root@controller1 ~(keystone_admin)]# openstack network agent list
+--------------------------------------+--------------------+-------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+-------------+-------------------+-------+-------+---------------------------+
| 0743b47d-8b77-4fce-b0b1-5dcf9c71ec9a | Open vSwitch agent | controller1 | None | :-) | UP | neutron-openvswitch-agent |
| 21932357-d17d-4cee-bf26-19a5b3e93085 | Open vSwitch agent | compute1 | None | :-) | UP | neutron-openvswitch-agent |
| 3b79817d-fd7b-4cbb-a0d4-eb02d5082967 | Open vSwitch agent | compute2 | None | :-) | UP | neutron-openvswitch-agent |
| 52e5dd18-bc66-465d-ab7f-114835be3414 | Metering agent | controller1 | None | :-) | UP | neutron-metering-agent |
| 84c1fa8f-b28a-43af-b198-d1f65bcd319a | DHCP agent | controller1 | nova | :-) | UP | neutron-dhcp-agent |
| e9b2bc7e-a06c-4498-acc7-40595b677d4e | Metadata agent | controller1 | None | :-) | UP | neutron-metadata-agent |
| fedead92-7d25-48ce-9743-4393cd92d8cd | L3 agent | controller1 | nova | :-) | UP | neutron-l3-agent |
+--------------------------------------+--------------------+-------------+-------------------+-------+-------+---------------------------+
openstack.txt应答文件内容,仅供参考。
[general]
CONFIG_SSH_KEY=/root/.ssh/id_rsa.pub
CONFIG_DEFAULT_PASSWORD=
CONFIG_SERVICE_WORKERS=%{::processorcount}
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=n
CONFIG_CEILOMETER_INSTALL=y
CONFIG_AODH_INSTALL=n
CONFIG_PANKO_INSTALL=n
CONFIG_SAHARA_INSTALL=n
CONFIG_HEAT_INSTALL=n
CONFIG_MAGNUM_INSTALL=n
CONFIG_TROVE_INSTALL=n
CONFIG_IRONIC_INSTALL=n
CONFIG_CLIENT_INSTALL=y
CONFIG_NTP_SERVERS=
EXCLUDE_SERVERS=
CONFIG_DEBUG_MODE=n
CONFIG_CONTROLLER_HOST=192.168.100.11
CONFIG_COMPUTE_HOSTS=192.168.100.12,192.168.100.13
CONFIG_NETWORK_HOSTS=192.168.100.11
CONFIG_VMWARE_BACKEND=n
CONFIG_UNSUPPORTED=n
CONFIG_USE_SUBNETS=n
CONFIG_VCENTER_HOST=
CONFIG_VCENTER_USER=
CONFIG_VCENTER_PASSWORD=
CONFIG_VCENTER_CLUSTER_NAMES=
CONFIG_STORAGE_HOST=192.168.100.11
CONFIG_SAHARA_HOST=192.168.100.11
CONFIG_REPO=
CONFIG_ENABLE_RDO_TESTING=n
CONFIG_RH_USER=
CONFIG_SATELLITE_URL=
CONFIG_RH_SAT6_SERVER=
CONFIG_RH_PW=
CONFIG_RH_OPTIONAL=y
CONFIG_RH_PROXY=
CONFIG_RH_SAT6_ORG=
CONFIG_RH_SAT6_KEY=
CONFIG_RH_PROXY_PORT=
CONFIG_RH_PROXY_USER=
CONFIG_RH_PROXY_PW=
CONFIG_SATELLITE_USER=
CONFIG_SATELLITE_PW=
CONFIG_SATELLITE_AKEY=
CONFIG_SATELLITE_CACERT=
CONFIG_SATELLITE_PROFILE=
CONFIG_SATELLITE_FLAGS=
CONFIG_SATELLITE_PROXY=
CONFIG_SATELLITE_PROXY_USER=
CONFIG_SATELLITE_PROXY_PW=
CONFIG_SSL_CACERT_FILE=/etc/pki/tls/certs/selfcert.crt
CONFIG_SSL_CACERT_KEY_FILE=/etc/pki/tls/private/selfkey.key
CONFIG_SSL_CERT_DIR=~/packstackca/
CONFIG_SSL_CACERT_SELFSIGN=y
CONFIG_SSL_CERT_SUBJECT_C=--
CONFIG_SSL_CERT_SUBJECT_ST=State
CONFIG_SSL_CERT_SUBJECT_L=City
CONFIG_SSL_CERT_SUBJECT_O=openstack
CONFIG_SSL_CERT_SUBJECT_OU=packstack
CONFIG_SSL_CERT_SUBJECT_CN=controller1
CONFIG_SSL_CERT_SUBJECT_MAIL=admin@controller1
CONFIG_AMQP_BACKEND=rabbitmq
CONFIG_AMQP_HOST=192.168.100.11
CONFIG_AMQP_ENABLE_SSL=n
CONFIG_AMQP_ENABLE_AUTH=n
CONFIG_AMQP_NSS_CERTDB_PW=000000
CONFIG_AMQP_AUTH_USER=amqp_user
CONFIG_AMQP_AUTH_PASSWORD=PW_PLACEHOLDER
CONFIG_MARIADB_HOST=192.168.100.11
CONFIG_MARIADB_USER=root
CONFIG_MARIADB_PW=000000
CONFIG_KEYSTONE_DB_PW=000000
CONFIG_KEYSTONE_FERNET_TOKEN_ROTATE_ENABLE=True
CONFIG_KEYSTONE_REGION=RegionOne
CONFIG_KEYSTONE_ADMIN_TOKEN=9ca4529914f64da4b4f31222bbffbeed
CONFIG_KEYSTONE_ADMIN_EMAIL=root@localhost
CONFIG_KEYSTONE_ADMIN_USERNAME=admin
CONFIG_KEYSTONE_ADMIN_PW=000000
CONFIG_KEYSTONE_DEMO_PW=000000
CONFIG_KEYSTONE_API_VERSION=v3
CONFIG_KEYSTONE_TOKEN_FORMAT=FERNET
CONFIG_KEYSTONE_IDENTITY_BACKEND=sql
CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.100.11
CONFIG_KEYSTONE_LDAP_USER_DN=
CONFIG_KEYSTONE_LDAP_USER_PASSWORD=
CONFIG_KEYSTONE_LDAP_SUFFIX=
CONFIG_KEYSTONE_LDAP_QUERY_SCOPE=one
CONFIG_KEYSTONE_LDAP_PAGE_SIZE=-1
CONFIG_KEYSTONE_LDAP_USER_SUBTREE=
CONFIG_KEYSTONE_LDAP_USER_FILTER=
CONFIG_KEYSTONE_LDAP_USER_OBJECTCLASS=
CONFIG_KEYSTONE_LDAP_USER_ID_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_USER_NAME_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_USER_MAIL_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_USER_ENABLED_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_USER_ENABLED_MASK=-1
CONFIG_KEYSTONE_LDAP_USER_ENABLED_DEFAULT=TRUE
CONFIG_KEYSTONE_LDAP_USER_ENABLED_INVERT=n
CONFIG_KEYSTONE_LDAP_USER_ATTRIBUTE_IGNORE=
CONFIG_KEYSTONE_LDAP_USER_DEFAULT_PROJECT_ID_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_USER_ALLOW_CREATE=n
CONFIG_KEYSTONE_LDAP_USER_ALLOW_UPDATE=n
CONFIG_KEYSTONE_LDAP_USER_ALLOW_DELETE=n
CONFIG_KEYSTONE_LDAP_USER_PASS_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_USER_ENABLED_EMULATION_DN=
CONFIG_KEYSTONE_LDAP_USER_ADDITIONAL_ATTRIBUTE_MAPPING=
CONFIG_KEYSTONE_LDAP_GROUP_SUBTREE=
CONFIG_KEYSTONE_LDAP_GROUP_FILTER=
CONFIG_KEYSTONE_LDAP_GROUP_OBJECTCLASS=
CONFIG_KEYSTONE_LDAP_GROUP_ID_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_GROUP_NAME_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_GROUP_MEMBER_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_GROUP_DESC_ATTRIBUTE=
CONFIG_KEYSTONE_LDAP_GROUP_ATTRIBUTE_IGNORE=
CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_CREATE=n
CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_UPDATE=n
CONFIG_KEYSTONE_LDAP_GROUP_ALLOW_DELETE=n
CONFIG_KEYSTONE_LDAP_GROUP_ADDITIONAL_ATTRIBUTE_MAPPING=
CONFIG_KEYSTONE_LDAP_USE_TLS=n
CONFIG_KEYSTONE_LDAP_TLS_CACERTDIR=
CONFIG_KEYSTONE_LDAP_TLS_CACERTFILE=
CONFIG_KEYSTONE_LDAP_TLS_REQ_CERT=demand
CONFIG_GLANCE_DB_PW=000000
CONFIG_GLANCE_KS_PW=000000
CONFIG_GLANCE_BACKEND=file
CONFIG_CINDER_DB_PW=000000
CONFIG_CINDER_DB_PURGE_ENABLE=True
CONFIG_CINDER_KS_PW=000000
CONFIG_CINDER_BACKEND=lvm
CONFIG_CINDER_VOLUMES_CREATE=y
CONFIG_CINDER_VOLUME_NAME=cinder-volumes
CONFIG_CINDER_VOLUMES_SIZE=2G
CONFIG_CINDER_GLUSTER_MOUNTS=
CONFIG_CINDER_NFS_MOUNTS=
CONFIG_CINDER_NETAPP_LOGIN=
CONFIG_CINDER_NETAPP_PASSWORD=
CONFIG_CINDER_NETAPP_HOSTNAME=
CONFIG_CINDER_NETAPP_SERVER_PORT=80
CONFIG_CINDER_NETAPP_STORAGE_FAMILY=ontap_cluster
CONFIG_CINDER_NETAPP_TRANSPORT_TYPE=http
CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL=nfs
CONFIG_CINDER_NETAPP_SIZE_MULTIPLIER=1.0
CONFIG_CINDER_NETAPP_EXPIRY_THRES_MINUTES=720
CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START=20
CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP=60
CONFIG_CINDER_NETAPP_NFS_SHARES=
CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG=/etc/cinder/shares.conf
CONFIG_CINDER_NETAPP_VOLUME_LIST=
CONFIG_CINDER_NETAPP_VFILER=
CONFIG_CINDER_NETAPP_PARTNER_BACKEND_NAME=
CONFIG_CINDER_NETAPP_VSERVER=
CONFIG_CINDER_NETAPP_CONTROLLER_IPS=
CONFIG_CINDER_NETAPP_SA_PASSWORD=
CONFIG_CINDER_NETAPP_ESERIES_HOST_TYPE=linux_dm_mp
CONFIG_CINDER_NETAPP_WEBSERVICE_PATH=/devmgr/v2
CONFIG_CINDER_NETAPP_STORAGE_POOLS=
CONFIG_CINDER_SOLIDFIRE_LOGIN=
CONFIG_CINDER_SOLIDFIRE_PASSWORD=
CONFIG_CINDER_SOLIDFIRE_HOSTNAME=
CONFIG_IRONIC_DB_PW=000000
CONFIG_IRONIC_KS_PW=000000
CONFIG_NOVA_DB_PURGE_ENABLE=True
CONFIG_NOVA_DB_PW=000000
CONFIG_NOVA_KS_PW=000000
CONFIG_NOVA_MANAGE_FLAVORS=y
CONFIG_NOVA_SCHED_CPU_ALLOC_RATIO=16.0
CONFIG_NOVA_SCHED_RAM_ALLOC_RATIO=1.5
CONFIG_NOVA_COMPUTE_MIGRATE_PROTOCOL=ssh
CONFIG_VNC_SSL_CERT=
CONFIG_VNC_SSL_KEY=
CONFIG_NOVA_PCI_ALIAS=
CONFIG_NOVA_PCI_PASSTHROUGH_WHITELIST=
CONFIG_NOVA_LIBVIRT_VIRT_TYPE=%{::default_hypervisor}
CONFIG_NEUTRON_KS_PW=000000
CONFIG_NEUTRON_DB_PW=000000
CONFIG_NEUTRON_L3_EXT_BRIDGE=br-ex
CONFIG_NEUTRON_METADATA_PW=000000
CONFIG_NEUTRON_METERING_AGENT_INSTALL=y
CONFIG_NEUTRON_FWAAS=n
CONFIG_NEUTRON_VPNAAS=n
CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat
CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch
CONFIG_NEUTRON_ML2_FLAT_NETWORKS=enp7s0
CONFIG_NEUTRON_ML2_VLAN_RANGES=
CONFIG_NEUTRON_ML2_TUNNEL_ID_RANGES=
CONFIG_NEUTRON_ML2_VXLAN_GROUP=
CONFIG_NEUTRON_ML2_VNI_RANGES=10:100
CONFIG_NEUTRON_L2_AGENT=openvswitch
CONFIG_NEUTRON_ML2_SRIOV_INTERFACE_MAPPINGS=
CONFIG_NEUTRON_LB_INTERFACE_MAPPINGS=
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=enp7s0:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:enp8s0
CONFIG_NEUTRON_OVS_BRIDGES_COMPUTE=
CONFIG_NEUTRON_OVS_EXTERNAL_PHYSNET=extnet
CONFIG_NEUTRON_OVS_TUNNEL_IF=
CONFIG_NEUTRON_OVS_TUNNEL_SUBNETS=
CONFIG_NEUTRON_OVS_VXLAN_UDP_PORT=4789
CONFIG_NEUTRON_OVN_BRIDGE_MAPPINGS=extnet:br-ex
CONFIG_NEUTRON_OVN_BRIDGE_IFACES=
CONFIG_NEUTRON_OVN_BRIDGES_COMPUTE=
CONFIG_NEUTRON_OVN_EXTERNAL_PHYSNET=extnet
CONFIG_NEUTRON_OVN_TUNNEL_IF=
CONFIG_NEUTRON_OVN_TUNNEL_SUBNETS=
CONFIG_MANILA_DB_PW=000000
CONFIG_MANILA_KS_PW=000000
CONFIG_MANILA_BACKEND=generic
CONFIG_MANILA_NETAPP_DRV_HANDLES_SHARE_SERVERS=false
CONFIG_MANILA_NETAPP_TRANSPORT_TYPE=https
CONFIG_MANILA_NETAPP_LOGIN=admin
CONFIG_MANILA_NETAPP_PASSWORD=
CONFIG_MANILA_NETAPP_SERVER_HOSTNAME=
CONFIG_MANILA_NETAPP_STORAGE_FAMILY=ontap_cluster
CONFIG_MANILA_NETAPP_SERVER_PORT=443
CONFIG_MANILA_NETAPP_AGGREGATE_NAME_SEARCH_PATTERN=(.*)
CONFIG_MANILA_NETAPP_ROOT_VOLUME_AGGREGATE=
CONFIG_MANILA_NETAPP_ROOT_VOLUME_NAME=root
CONFIG_MANILA_NETAPP_VSERVER=
CONFIG_MANILA_GENERIC_DRV_HANDLES_SHARE_SERVERS=true
CONFIG_MANILA_GENERIC_VOLUME_NAME_TEMPLATE=manila-share-%s
CONFIG_MANILA_GENERIC_SHARE_MOUNT_PATH=/shares
CONFIG_MANILA_SERVICE_IMAGE_LOCATION=https://www.dropbox.com/s/vi5oeh10q1qkckh/ubuntu_1204_nfs_cifs.qcow2
CONFIG_MANILA_SERVICE_INSTANCE_USER=ubuntu
CONFIG_MANILA_SERVICE_INSTANCE_PASSWORD=ubuntu
CONFIG_MANILA_NETWORK_TYPE=neutron
CONFIG_MANILA_NETWORK_STANDALONE_GATEWAY=
CONFIG_MANILA_NETWORK_STANDALONE_NETMASK=
CONFIG_MANILA_NETWORK_STANDALONE_SEG_ID=
CONFIG_MANILA_NETWORK_STANDALONE_IP_RANGE=
CONFIG_MANILA_NETWORK_STANDALONE_IP_VERSION=4
CONFIG_MANILA_GLUSTERFS_SERVERS=
CONFIG_MANILA_GLUSTERFS_NATIVE_PATH_TO_PRIVATE_KEY=
CONFIG_MANILA_GLUSTERFS_VOLUME_PATTERN=
CONFIG_MANILA_GLUSTERFS_TARGET=
CONFIG_MANILA_GLUSTERFS_MOUNT_POINT_BASE=
CONFIG_MANILA_GLUSTERFS_NFS_SERVER_TYPE=gluster
CONFIG_MANILA_GLUSTERFS_PATH_TO_PRIVATE_KEY=
CONFIG_MANILA_GLUSTERFS_GANESHA_SERVER_IP=
CONFIG_HORIZON_SSL=n
CONFIG_HORIZON_SECRET_KEY=3d13779b7c2d40d19d3bec5d15f47575
CONFIG_HORIZON_SSL_CERT=
CONFIG_HORIZON_SSL_KEY=
CONFIG_HORIZON_SSL_CACERT=
CONFIG_SWIFT_KS_PW=000000
CONFIG_SWIFT_STORAGES=
CONFIG_SWIFT_STORAGE_ZONES=1
CONFIG_SWIFT_STORAGE_REPLICAS=1
CONFIG_SWIFT_STORAGE_FSTYPE=ext4
CONFIG_SWIFT_HASH=20e88edd9f9d4e86
CONFIG_SWIFT_STORAGE_SIZE=2G
CONFIG_HEAT_DB_PW=000000
CONFIG_HEAT_AUTH_ENC_KEY=3103d76d9338406f
CONFIG_HEAT_KS_PW=000000
CONFIG_HEAT_CFN_INSTALL=y
CONFIG_HEAT_DOMAIN=heat
CONFIG_HEAT_DOMAIN_ADMIN=heat_admin
CONFIG_HEAT_DOMAIN_PASSWORD=PW_PLACEHOLDER
CONFIG_PROVISION_DEMO=n
CONFIG_PROVISION_TEMPEST=n
CONFIG_PROVISION_DEMO_FLOATRANGE=172.24.4.0/24
CONFIG_PROVISION_DEMO_ALLOCATION_POOLS=[]
CONFIG_PROVISION_IMAGE_NAME=cirros
CONFIG_PROVISION_IMAGE_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
CONFIG_PROVISION_IMAGE_FORMAT=qcow2
CONFIG_PROVISION_IMAGE_PROPERTIES=
CONFIG_PROVISION_IMAGE_SSH_USER=cirros
CONFIG_PROVISION_UEC_IMAGE_NAME=cirros-uec
CONFIG_PROVISION_UEC_IMAGE_KERNEL_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-kernel
CONFIG_PROVISION_UEC_IMAGE_RAMDISK_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-initramfs
CONFIG_PROVISION_UEC_IMAGE_DISK_URL=https://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
CONFIG_TEMPEST_HOST=
CONFIG_PROVISION_TEMPEST_USER=
CONFIG_PROVISION_TEMPEST_USER_PW=000000
CONFIG_PROVISION_TEMPEST_FLOATRANGE=172.24.4.0/24
CONFIG_PROVISION_TEMPEST_FLAVOR_NAME=m1.nano
CONFIG_PROVISION_TEMPEST_FLAVOR_DISK=1
CONFIG_PROVISION_TEMPEST_FLAVOR_RAM=128
CONFIG_PROVISION_TEMPEST_FLAVOR_VCPUS=1
CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_NAME=m1.micro
CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_DISK=1
CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_RAM=128
CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_VCPUS=1
CONFIG_RUN_TEMPEST=n
CONFIG_RUN_TEMPEST_TESTS=smoke
CONFIG_PROVISION_OVS_BRIDGE=y
CONFIG_GNOCCHI_DB_PW=000000
CONFIG_GNOCCHI_KS_PW=000000
CONFIG_CEILOMETER_SECRET=d90bc65daa5c41d9
CONFIG_CEILOMETER_KS_PW=000000
CONFIG_CEILOMETER_SERVICE_NAME=httpd
CONFIG_CEILOMETER_COORDINATION_BACKEND=redis
CONFIG_ENABLE_CEILOMETER_MIDDLEWARE=n
CONFIG_REDIS_HOST=192.168.100.11
CONFIG_REDIS_PORT=6379
CONFIG_AODH_KS_PW=000000
CONFIG_AODH_DB_PW=000000
CONFIG_PANKO_DB_PW=000000
CONFIG_PANKO_KS_PW=000000
CONFIG_TROVE_DB_PW=000000
CONFIG_TROVE_KS_PW=000000
CONFIG_TROVE_NOVA_USER=trove
CONFIG_TROVE_NOVA_TENANT=services
CONFIG_TROVE_NOVA_PW=000000
CONFIG_SAHARA_DB_PW=000000
CONFIG_SAHARA_KS_PW=000000
CONFIG_MAGNUM_DB_PW=000000
CONFIG_MAGNUM_KS_PW=000000
[root@control ~]# yum -y install openstack-packstack
[root@control ~]# packstack --gen-answer-file=openstack.txt
[root@control ~]# sed -i -r 's/192.168.17.10/192.168.100.10/g' openstack.txt
[root@control ~]#vi openstack.txt
41 CONFIG_SWIFT_INSTALL=n ●第41行SWIFT是OpenStack的对象存储组件,默认是Y,在生产环境中一般是不装,所以该n
50 CONFIG_AODH_INSTALL=n ●第50行,默认是Y 需要改n
94 CONFIG_CONTROLLER_HOST=192.168.100.10 第94行CONTROLLER是OpenStack的控制节点,在控制节点上配置的,不需要更改IP地址。
97 CONFIG_COMPUTE_HOSTS=192.168.100.11 ●第97行需要更改计算节点的IP地址
101 CONFIG_NETWORK_HOSTS=192.168.100.10 ●第101行 需要更改网络节点的IP地址
557 CONFIG_CINDER_VOLUMES_SIZE=1G ●第557行 系统在创建CINDER组件的的时候回创建一个20G卷,因为我们虚拟机空间有限所以把空间改下点1G
778 CONFIG_NEUTRON_METADATA_PW=29948657b3aa409c ●第778行,这样的29948657b3aa409c是密码
782 CONFIG_LBAAS_INSTALL=y ●第782行 LBAAS负载均衡组件。必选要装 选y
790 CONFIG_NEUTRON_FWAAS=y ●第790行 FWAAS是防火墙组件。必选要装 选y
794 CONFIG_NEUTRON_VPNAAS=y ●第794行 VPNAAS是VPN组件。必选要装 选y
817 CONFIG_NEUTRON_ML2_FLAT_NETWORKS=physnet1 ●第817行,FLAT网络这边要设置物理网卡名字
862 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex ●第862行,这边要设置物理网卡的名字
873 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth1 ●第873行,这边br-ex:eth1是网络节点的nat网卡
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 网桥上
通过 dashboard 创建外部网络(选择简单的 flat 类型)
创建租户网络
创建租户路由
为路由添加接口到刚刚创建的子网上
创建完成后查看网络拓扑
因为 packstack 测试镜像 cirros 都已经下好了 现在就可以愉快的启动实例了
曾经被 openstack 的网络搞的头皮发麻,这里发一下简单的流量走向,请大佬不喜勿喷,如有错误请大佬指点