openstack安装和使用

前言

本篇文章会介绍openstack的安装、openstack各组件的配置和功能、还会演示openstack云主机的创建流程,整篇文章花费一天时间完成,万字长文,需要的可以关注,相互学习,本篇文章总体分为三个部分:

第一部分讲解openstack安装

第二部分讲解openstack组件,包括:

keystone
glance
nova
neutron
dashboard

第三部分讲解openstack使用,如:

创建云主机
创建公网
创建子网
配置路由
配置防火墙
配置安全策略
创建云主机存储卷等

openstack简介

Openstack是一个开源的云平台管理项目,可以用于构建公有云或者私有云平台,提供了基础设施及服务(Iaas)的解决方案,OpenStack是一个云操作系统,通过数据中心可控制计算、存储、网络等资源池,OpenStack覆盖了网络、虚拟化、操作系统、服务器等各个方面,通过openstack可以启动,分配和管理虚拟机资源,所有的管理也都可以通过前端界面就可以完成。我们部署openstack之后,可以通过这个平台创建各个不同版本的虚拟机,如centos,windows等系统,可以按需分配cpu,内存,磁盘给这些虚拟机,同时还可以提供网络支持。

第一部分:openstack安装篇

操作系统版本选择centos7.6或者更高版本

controller节点:三个60G硬盘 ,8G内存/4核CPU,两块桥接网卡

computer节点:两个60G硬盘 ,6G内存/4核CPU/,两块桥接网卡

机器规划

controller节点

ens33:192.168.0.100,提供浮动ip的,也就是出网地址(能访问baidu.com)
ens37:192.168.0.200,内网之间通信用

computer节点:

ens33:192.168.0.110,提供浮动ip的,也就是出网地址
ens37:192.168.0.210,内网之间通信用

修改虚拟机的ip变成静态ip,controller节点的配置如下所示:

cat /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=static

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens33

DEVICE=ens33

ONBOOT=yes

IPADDR=192.168.0.100

NETMASK=255.255.255.0

GATEWAY=192.168.0.1

DNS1=8.8.8.8

 

cat /etc/sysconfig/network-scripts/ifcfg-ens37

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=static

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens37

DEVICE=ens37

ONBOOT=yes

IPADDR=192.168.0.200

NETMASK=255.255.255.0

GATEWAY=192.168.0.1

DNS1=8.8.8.8

 

修改配置文件之后需要重启网络服务才能使配置生效,重启网络服务命令如下:

service network restart

 

注:ifcfg-ens33文件配置解释: 

IPADDR=192.168.0.100

#ip地址,需要跟自己电脑所在网段一致

NETMASK=255.255.255.0

#子网掩码,需要跟自己电脑所在网段一致

GATEWAY=192.168.0.1

#网关,在自己电脑打开cmd,输入ipconfig /all可看到

DNS1=192.168.0.1   

#DNS,在自己电脑打开cmd,输入ipconfig /all可看到

配置hosts文件,各个节点保持一致

cat /etc/hosts  

在最后一行添加如下内容

192.168.0.200 controller

192.168.0.210 computer

配置yum源,各个节点操作

(1)备份原来的yum源

mv /etc/yum.repos.d/CentOS-Base.repo  /etc/yum.repos.d/CentOS-Base.repo.backup

(2)下载阿里的yum源 

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

(3)生成新的yum缓存

yum makecache fast

(4)清理yum缓存 

yum clean all

(5)更新yum源 

yum -y update

初始化,各个节点操作

yum -y install wget net-tools nfs-utils lrzsz gccgcc-c++ make cmake libxml2-devel openssl-devel curl curl-devel unzip sudo ntplibaio-devel wget vim ncurses-devel autoconf automake zlib-devel python-devel epel-release lrzsz openssh-server telnet

关闭防火墙、networkmanager,iptables,各个节点操作

systemctl stop firewalld && systemctl disable firewalld && systemctl stop NetworkManager && systemctl disable NetworkManager && systemctl  stop  iptables &&  systemctl disable  iptables

关闭selinux,各个节点操作

关闭selinux,设置永久关闭,这样重启机器selinux也处于关闭状态

修改/etc/sysconfig/selinux和/etc/selinux/config文件,把

SELINUX=enforcing变成SELINUX=disabled,也可用下面方式修改:

sed -i  's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

配置主机名

192.168.0.100上操作

hostnamectl set-hostname controller

192.168.0.110上操作

hostnamectl set-hostname computer

做时间同步,各个节点操作

ntpdate cn.pool.ntp.org

配置无密码登陆,各个节点操作

ssh-keygen -t rsa   

#一直回车即可

ssh-copy-id -i .ssh/id_rsa.pub controller

ssh-copy-id -i .ssh/id_rsa.pub computer

开始安装openstack

openstack软件包在百度网盘,链接如下:

链接:https://pan.baidu.com/s/1dHDF4WxvNoqcJd90mDxrbA 
提取码:yz56

(1)上传openstack离线软件包到root目录下(在controller和computer节点操作)

在root下创建一个目录openstack,然后把软件包解压到这个目录下

mkdir /root/openstack && cd openstack && tar zxvf /root/openstack_N.tar.gz

(2)解压之后会出现一个openstack目录,把openstack目录整体移动到/下(controller和computer节点操作)

mv openstack /

(3)重新配置yum源(controller和computer节点都操作)

cd /etc/yum.repos.d/ && mkdir bak && mv CentOS-* bak/ && mv epel* bak/

cp bak/CentOS-Base.repo  ./

(4)生成一个新的openstack的yum源

cat < /etc/yum.repos.d/openstack.repo

[openstack]

enable=1

gpgcheck=0

baseurl=file:///openstack

EOF

yum makecache

安装openstack应答文件(controller节点操作)

yum install centos-release-openstack-newton -y

在controller和computer节点执行如下一条命令

cd /etc/yum.repos.d && mv *.repo bak/ && mv bak/openstack.repo ./ && cp bak/CentOS-Base.repo ./

这样在/etc/yum.repos.d下只有如下两个repo文件,这样才可以确保后面安装成功:

CentOS-Base.repo 
openstack.repo

接下来的操作继续在controller节点执行

yum makecache

yum install openstack-packstack -y

cd /root

packstack --gen-answer-file=openstack.txt

#这样会生成一个应答文件openstack.txt

(1)查看openstack应答文件内容

grep -vE '^$|^#' 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=y

CONFIG_CEILOMETER_INSTALL=y

CONFIG_AODH_INSTALL=y

CONFIG_GNOCCHI_INSTALL=y

CONFIG_SAHARA_INSTALL=n

CONFIG_HEAT_INSTALL=n

CONFIG_TROVE_INSTALL=n

CONFIG_IRONIC_INSTALL=n

CONFIG_CLIENT_INSTALL=y

CONFIG_NTP_SERVERS=

CONFIG_NAGIOS_INSTALL=y

EXCLUDE_SERVERS=

CONFIG_DEBUG_MODE=n

CONFIG_CONTROLLER_HOST=192.168.0.100

CONFIG_COMPUTE_HOSTS=192.168.0.100

CONFIG_NETWORK_HOSTS=192.168.0.100

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.0.100

CONFIG_SAHARA_HOST=192.168.0.100

CONFIG_USE_EPEL=n

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=controller

CONFIG_SSL_CERT_SUBJECT_MAIL=admin@controller

CONFIG_AMQP_BACKEND=rabbitmq

CONFIG_AMQP_HOST=192.168.0.100

CONFIG_AMQP_ENABLE_SSL=n

CONFIG_AMQP_ENABLE_AUTH=n

CONFIG_AMQP_NSS_CERTDB_PW=PW_PLACEHOLDER

CONFIG_AMQP_AUTH_USER=amqp_user

CONFIG_AMQP_AUTH_PASSWORD=PW_PLACEHOLDER

CONFIG_MARIADB_HOST=192.168.0.100

CONFIG_MARIADB_USER=root

CONFIG_MARIADB_PW=790d13b37c5d4256

CONFIG_KEYSTONE_DB_PW=d00c51216f0d407e

CONFIG_KEYSTONE_DB_PURGE_ENABLE=True

CONFIG_KEYSTONE_REGION=RegionOne

CONFIG_KEYSTONE_ADMIN_TOKEN=1929401395424bbfae56e4f5d3d14470

CONFIG_KEYSTONE_ADMIN_EMAIL=root@localhost

CONFIG_KEYSTONE_ADMIN_USERNAME=admin

CONFIG_KEYSTONE_ADMIN_PW=98bb8a18d3b44d5b

CONFIG_KEYSTONE_DEMO_PW=3a1c3aa52f714ce7

CONFIG_KEYSTONE_API_VERSION=v2.0

CONFIG_KEYSTONE_TOKEN_FORMAT=UUID

CONFIG_KEYSTONE_IDENTITY_BACKEND=sql

CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.0.100

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=8d1d5db7e0ea4b0e

CONFIG_GLANCE_KS_PW=4373de2ce59c4282

CONFIG_GLANCE_BACKEND=file

CONFIG_CINDER_DB_PW=f17a2c40c2a34d3d

CONFIG_CINDER_DB_PURGE_ENABLE=True

CONFIG_CINDER_KS_PW=6e37e28106a34dcb

CONFIG_CINDER_BACKEND=lvm

CONFIG_CINDER_VOLUMES_CREATE=y

CONFIG_CINDER_VOLUMES_SIZE=20G

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=PW_PLACEHOLDER

CONFIG_IRONIC_KS_PW=PW_PLACEHOLDER

CONFIG_NOVA_DB_PURGE_ENABLE=True

CONFIG_NOVA_DB_PW=9a58820d437a4602

CONFIG_NOVA_KS_PW=146383d19ded4bf3

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=tcp

CONFIG_NOVA_COMPUTE_MANAGER=nova.compute.manager.ComputeManager

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_NOVA_COMPUTE_PRIVIF=

CONFIG_NOVA_NETWORK_MANAGER=nova.network.manager.FlatDHCPManager

CONFIG_NOVA_NETWORK_PUBIF=eth0

CONFIG_NOVA_NETWORK_PRIVIF=

CONFIG_NOVA_NETWORK_FIXEDRANGE=192.168.32.0/22

CONFIG_NOVA_NETWORK_FLOATRANGE=10.3.4.0/22

CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP=n

CONFIG_NOVA_NETWORK_VLAN_START=100

CONFIG_NOVA_NETWORK_NUMBER=1

CONFIG_NOVA_NETWORK_SIZE=255

CONFIG_NEUTRON_KS_PW=9977d7bd457c4981

CONFIG_NEUTRON_DB_PW=f41058185ba84956

CONFIG_NEUTRON_L3_EXT_BRIDGE=br-ex

CONFIG_NEUTRON_METADATA_PW=5c098167b4f941a8

CONFIG_LBAAS_INSTALL=n

CONFIG_NEUTRON_METERING_AGENT_INSTALL=y

CONFIG_NEUTRON_FWAAS=n

CONFIG_NEUTRON_VPNAAS=n

CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan

CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan

CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch

CONFIG_NEUTRON_ML2_FLAT_NETWORKS=*

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_SUPPORTED_PCI_VENDOR_DEVS=['15b3:1004','8086:10ca']

CONFIG_NEUTRON_ML2_SRIOV_AGENT_REQUIRED=n

CONFIG_NEUTRON_ML2_SRIOV_INTERFACE_MAPPINGS=

CONFIG_NEUTRON_LB_INTERFACE_MAPPINGS=

CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=

CONFIG_NEUTRON_OVS_BRIDGE_IFACES=

CONFIG_NEUTRON_OVS_BRIDGES_COMPUTE=

CONFIG_NEUTRON_OVS_TUNNEL_IF=

CONFIG_NEUTRON_OVS_TUNNEL_SUBNETS=

CONFIG_NEUTRON_OVS_VXLAN_UDP_PORT=4789

CONFIG_MANILA_DB_PW=PW_PLACEHOLDER

CONFIG_MANILA_KS_PW=PW_PLACEHOLDER

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=a0158fbb560a411dbe29ebca9a3d2f66

CONFIG_HORIZON_SSL_CERT=

CONFIG_HORIZON_SSL_KEY=

CONFIG_HORIZON_SSL_CACERT=

CONFIG_SWIFT_KS_PW=af2c0e6494874e79

CONFIG_SWIFT_STORAGES=

CONFIG_SWIFT_STORAGE_ZONES=1

CONFIG_SWIFT_STORAGE_REPLICAS=1

CONFIG_SWIFT_STORAGE_FSTYPE=ext4

CONFIG_SWIFT_HASH=1c92f9123f994595

CONFIG_SWIFT_STORAGE_SIZE=2G

CONFIG_HEAT_DB_PW=PW_PLACEHOLDER

CONFIG_HEAT_AUTH_ENC_KEY=15f6ef4aad554643

CONFIG_HEAT_KS_PW=PW_PLACEHOLDER

CONFIG_HEAT_CLOUDWATCH_INSTALL=n

CONFIG_HEAT_CFN_INSTALL=y

CONFIG_HEAT_DOMAIN=heat

CONFIG_HEAT_DOMAIN_ADMIN=heat_admin

CONFIG_HEAT_DOMAIN_PASSWORD=PW_PLACEHOLDER

CONFIG_PROVISION_DEMO=y

CONFIG_PROVISION_TEMPEST=n

CONFIG_PROVISION_DEMO_FLOATRANGE=172.24.4.224/28

CONFIG_PROVISION_IMAGE_NAME=cirros

CONFIG_PROVISION_IMAGE_URL=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

CONFIG_PROVISION_IMAGE_FORMAT=qcow2

CONFIG_PROVISION_IMAGE_SSH_USER=cirros

CONFIG_PROVISION_UEC_IMAGE_NAME=cirros-uec

CONFIG_PROVISION_UEC_IMAGE_KERNEL_URL=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-kernel

CONFIG_PROVISION_UEC_IMAGE_RAMDISK_URL=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-initramfs

CONFIG_PROVISION_UEC_IMAGE_DISK_URL=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

CONFIG_TEMPEST_HOST=

CONFIG_PROVISION_TEMPEST_USER=

CONFIG_PROVISION_TEMPEST_USER_PW=PW_PLACEHOLDER

CONFIG_PROVISION_TEMPEST_FLOATRANGE=172.24.4.224/28

CONFIG_PROVISION_TEMPEST_REPO_URI=https://github.com/openstack/tempest.git

CONFIG_PROVISION_TEMPEST_REPO_REVISION=master

CONFIG_RUN_TEMPEST=n

CONFIG_RUN_TEMPEST_TESTS=smoke

CONFIG_PROVISION_OVS_BRIDGE=y

CONFIG_GNOCCHI_DB_PW=de94d43493ee4f22

CONFIG_GNOCCHI_KS_PW=851d3c2e0dfb4733

CONFIG_CEILOMETER_SECRET=fd8180f8741b4577

CONFIG_CEILOMETER_KS_PW=4ecf716db75d4df8

CONFIG_CEILOMETER_SERVICE_NAME=httpd

CONFIG_CEILOMETER_COORDINATION_BACKEND=redis

CONFIG_CEILOMETER_METERING_BACKEND=database

CONFIG_MONGODB_HOST=192.168.0.100

CONFIG_REDIS_HOST=192.168.0.100

CONFIG_REDIS_PORT=6379

CONFIG_AODH_KS_PW=aa05a4e252aa4d8b

CONFIG_TROVE_DB_PW=PW_PLACEHOLDER

CONFIG_TROVE_KS_PW=PW_PLACEHOLDER

CONFIG_TROVE_NOVA_USER=trove

CONFIG_TROVE_NOVA_TENANT=services

CONFIG_TROVE_NOVA_PW=PW_PLACEHOLDER

CONFIG_SAHARA_DB_PW=PW_PLACEHOLDER

CONFIG_SAHARA_KS_PW=PW_PLACEHOLDER

CONFIG_NAGIOS_PW=3df8622a70e64edf

 

(2)修改openstack.txt文件,需要修改的内容如下,大家按照你们自己规划ens33和ens37网段的ip进行修改:

CONFIG_DEFAULT_PASSWORD=123456

CONFIG_SWIFT_INSTALL=n

CONFIG_NAGIOS_INSTALL=n

CONFIG_CINDER_VOLUMES_SIZE=2G

CONFIG_PROVISION_DEMO=n

CONFIG_LBAAS_INSTALL=y

CONFIG_NEUTRON_FWAAS=y

CONFIG_NEUTRON_VPNAAS=y

CONFIG_CONTROLLER_HOST=192.168.0.200

#controller节点的ens37网卡的ip

CONFIG_COMPUTE_HOSTS=192.168.0.210

#computer节点的ens37网卡的ip

CONFIG_NETWORK_HOSTS=192.168.0.210

#computer节点的ens37网卡的ip

(3)查看修改之后的openstack.txt文件中安装哪些

grep -vE '^$|^#' openstack.txt |grep y

CONFIG_MARIADB_INSTALL=y

CONFIG_GLANCE_INSTALL=y

CONFIG_CINDER_INSTALL=y

CONFIG_NOVA_INSTALL=y

CONFIG_NEUTRON_INSTALL=y

CONFIG_HORIZON_INSTALL=y

CONFIG_CEILOMETER_INSTALL=y

CONFIG_AODH_INSTALL=y

CONFIG_GNOCCHI_INSTALL=y

CONFIG_CLIENT_INSTALL=y

CONFIG_RH_OPTIONAL=y

CONFIG_SSL_CACERT_KEY_FILE=/etc/pki/tls/private/selfkey.key

CONFIG_SSL_CACERT_SELFSIGN=y

CONFIG_SSL_CERT_SUBJECT_L=City

CONFIG_CINDER_VOLUMES_CREATE=y

CONFIG_NOVA_MANAGE_FLAVORS=y

CONFIG_NOVA_LIBVIRT_VIRT_TYPE=%{::default_hypervisor}

CONFIG_LBAAS_INSTALL=y

CONFIG_NEUTRON_METERING_AGENT_INSTALL=y

CONFIG_NEUTRON_FWAAS=y

CONFIG_NEUTRON_VPNAAS=y

CONFIG_HEAT_CFN_INSTALL=y

CONFIG_PROVISION_OVS_BRIDGE=y

看到y的表示是需要安装的组件

安装openstack组件-controller节点操作

基于应答文件安装openstack组件,按如下命令操作:

packstack--answer-file=openstack.txt

上面命令执行成功之后再回到conputer节点执行如下操作:

cd /etc/yum.repos.d && mv CentOS-Ceph-Jewel.repo CentOS-OpenStack-newton.repo CentOS-QEMU-EV.repo CentOS-Storage-common.repo bak/

(1)安装过程需要查看iptables状态,在controller和computer节点

systemctl status iptables

如果发现iptables处于active状态,需要停掉

systemctl stop iptables

(2)看到如下说明安装成功

192.168.124.200_controller.pp:                       [ DONE ]            
Applying 192.168.124.201_network.pp
192.168.124.201_network.pp:                          [ DONE ]         
Applying 192.168.124.201_compute.pp
192.168.124.201_compute.pp:                          [ DONE ]         
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]


 **** Installation completed successfully ******

配置rabbitmq:

(1)启动rabbitmq的管理界面,controller节点操作

rabbitmq-plugins enable rabbitmq_management

(2)在浏览器访问

192.168.0.200:15672

账号:guest

密码:guest

出现如下界面

openstack安装和使用_第1张图片

技术交流群

为了大家更快速的学习知识,掌握技术,随时沟通问题,特组建了技术交流群,大家在群里可以分享自己的技术栈,抛出日常问题,群里会有很多大佬及时解答,这样我们就会结识很多志同道合的人,群里还有很多关于kubernetes/docker/devops/openstack/openshift/linux/IaaS/PaaS的免费文章和视频,长按下图可加我微信,备注运维或者k8s或者devops即可进群,让我们共同努力,向着美好的未来出发吧~~~

微信:luckylucky421302

微信公众号

长按如下指纹可关注公众号·


第二部分:openstack组件介绍

访问openstack的dashboard界面

在浏览器输入:

192.168.0.200

账号:admin

密码:16e424911af144ca

#密码获取方式参考后文内容

登陆之后显示如下界面

openstack安装和使用_第2张图片

获取密码的方法,在controller节点上操作:

cd  /root

你可能感兴趣的:(openstack安装和使用)