OpenStack构建企业私有云平台


一、部署基础环境:

A.IP地址规划:
controller节点:192.168.0.201,compute节点:192.168.0.202
B.关闭防火墙Firewalld(所有节点)
systemctl disable firewalld.service
systemctl stop firewalld.service
C.禁止Selinux内核安全机制(所有节点)
vim /etc/sysconfig/selinux
SELINUX=disabled
D.配置固定IP地址(所有节点)
ens33(外网地址);ens37(内网地址)
controller:ens37   192.168.0.201
compute:ens37    192.168.0.202

二、构建企业私有云平台实施步骤如下:

1.  配置hosts和hostname(controller和compute节点)
vi /etc/hostname(controller节点)
controller
vi /etc/hostname(compute节点)
compute
vi /etc/hosts(controller和compute节点)
192.168.0.201    controller
192.168.0.202    compute
2.  配置NTP(controller和compute节点)
在controller节点配置
下载:yum -y install chrony
配置:vi /etc/chrony.conf
allow 192.168.0.0/24
server ntp1.aliyun.com iburst
启动
systemctl enable chronyd.service
systemctl start chronyd.service
验证
chronyc sources

在compute节点配置
下载:yum -y install chrony
配置:vi /etc/chrony.conf(删除所有内容)
server controller iburst
启动
systemctl enable chronyd.service
systemctl start chronyd.service
验证
chronyc sources

3.  使用阿里云官方YUM源(所有节点)注:本操作跳过
备份
cd /etc/yum.repo.d/
mkdir bak
mv C* ./bak
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
获取阿里源文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
更新cache
yum makecache
更新
yum -y update
4.  安装openstack包(所有节点)
注:如果通过yum源无法找到其依赖包,那么可以换源
下载pike
yum -y install centos-release-openstack-pike
更新
yum -y upgrade
下载openstackclient
yum install python-openstackclient
下载selinux
yum install openstack-selinux
4. 安装数据库(仅controller节点)
下载mariadb
yum -y install mariadb mariadb-server python2-PyMySQL
创建openstack.cnf
vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address =192.168.0.201
default-storage-engine = innodb
innodb_file_per_tablemax_connections =4096
collation-server = utf8_general_ci
character-set-server = utf8

启动
systemctl enable mariadb.service
systemctl start mariadb.service

修改密码
登录:mysql -u root mysql
修改密码:UPDATE user SET PASSWORD=PASSWORD('123456') where USER='root';
立即刷新:FLUSH PRIVILEGES;
退出:quit

5.  安装rabbitmq(仅controller节点)

下载
yum -y install rabbitmq-server

启动
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service

添加openstack用户
rabbitmqctl add_user openstack 123456

添加权限
rabbitmqctl set_permissions openstack ".*" ".*" ".*"

5.  安装memcached(仅controller节点)

下载
yum -y install memcached python-memcached

配置
vi /etc/sysconfig/memcached
OPTIONS="-l 127.0.0.1,::1,controller"

启动
systemctl enable memcached.service
systemctl start memcached.service

6.  安装Etcd(仅controller节点)这是一个分布式的可靠键值存储,用于分布式密钥锁定、存储配置、跟踪服务的实时状态和其他场景

下载
yum -y install etcd

配置
vi /etc/etcd/etcd.conf

#[Member]
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.0.201:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.0.201:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.0.201:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.0.201:2379"
ETCD_INITIAL_CLUSTER="controller=http://192.168.0.201:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"

启动

systemctl enable etcd
systemctl start etcd

7.  身份服务(仅controller节点)

数据库

登录mysql -uroot -p123456
注:如果显示 1045报错,那么执行以下操作
停服务:systemctl stop mariadb.service
启动服务:mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
登录:mysql -u root mysql
改密码:UPDATE user SET PASSWORD=PASSWORD('123456') where USER='root';
FLUSH PRIVILEGES;
退出:quit

创建数据库keystone
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'controller' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY '123456';

下载和配置

下载
yum -y install openstack-keystone httpd mod_wsgi

配置
vi /etc/keystone/keystone.conf
[database]
...connection = mysql+pymysql://keystone:123456@controller/keystone
[token]
...provider = fernet

创建数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone

初始化Fernet密钥存储库:
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone

初始化身份服务
keystone-manage bootstrap --bootstrap-password 123456 --bootstrap-admin-url http://controller:35357/v3/ --bootstrap-internal-url http://controller:5000/v3/ --bootstrap-public-url http://controller:5000/v3/ --bootstrap-region-id RegionOne

配置httpd

配置:vi /etc/httpd/conf/httpd.conf
ServerName controller

创建link:ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/

启动服务
systemctl enable httpd.service
systemctl start httpd.service

登录
export OS_USERNAME=admin
export OS_PASSWORD=123456
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3

创建 domain, projects, users, and roles

创建 service project
openstack project create --domain default --description "Service Project" service

image.png

2、创建 demo project

openstack project create --domain default --description "Demo Project" demo

image.png

3、创建 demo user:

openstack user create --domain default --password-prompt demo

image.png

4、创建 user role:

openstack role create user

image.png

5、关联
openstack role add --project demo --user demo user

验证

1、登出
unset OS_AUTH_URL OS_PASSWORD

2、验证 admin
openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name admin --os-username admin token issue

image.png

3、验证 demo
openstack --os-auth-url http://controller:5000/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name demo --os-username demo token issue

image.png

创建登录脚本(在root的~目录下)
注: 通过 readlink -f ./ 获取当前目录的绝对路径

A、创建 admin-openrc

vim admin-openrc
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=123456
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2

B、创建 demo-openrc

vi demo-openrc
exportOS_PROJECT_DOMAIN_NAME=Default
exportOS_USER_DOMAIN_NAME=Default
exportOS_PROJECT_NAME=demo
exportOS_USERNAME=demo
exportOS_PASSWORD=123456
exportOS_AUTH_URL=http://controller:5000/v3 exportOS_IDENTITY_API_VERSION=3
exportOS_IMAGE_API_VERSION=2

C、验证admin

登录:. admin-openrc
注:登录也可以用source admin-openrc,注意上面是 . admin-openrc,不是 ./admin-openrc

验证:openstack token issue

image.png

4、查看环境变量
echo $OS_PROJECT_DOMAIN_NAME $OS_USER_DOMAIN_NAME $OS_PROJECT_NAME $OS_USERNAME $OS_PASSWORD $OS_AUTH_URL $OS_IDENTITY_API_VERSION $OS_IMAGE_API_VERSION

5、登出
unset OS_PROJECT_DOMAIN_NAME OS_USER_DOMAIN_NAME OS_PROJECT_NAME OS_USERNAME OS_PASSWORD OS_AUTH_URL OS_IDENTITY_API_VERSION OS_IMAGE_API_VERSION

8.  镜像服务(仅controller节点)

数据库

A.登录
mysql -uroot -p123456

B.创建数据库glance
CREATE DATABASE glance;

C.登录操作权限
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'controller' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '123456';

D.退出 exit

创建 glance

A.登录 . admin-openrc

B.创建 glance user:
openstack user create --domain default --password-prompt glance

image.png

C.关联
openstack role add --project service --user glance admin

D.创建 glance service:
openstack service create --name glance --description "OpenStack Image" image

image.png

E.创建API
openstack endpoint create --region RegionOne image public http://controller:9292

image.png

openstack endpoint create --region RegionOne image internal http://controller:9292

image.png

openstack endpoint create --region RegionOne image admin http://controller:9292

image.png

下载和配置

A.下载
yum -y install openstack-glance

B.配置
vim /etc/glance/glance-api.conf
[database]
...
connection = mysql+pymysql://glance:123456@controller/glance

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name =default
user_domain_name =default
project_name = service
username = glance
password =123456

[paste_deploy]
...
flavor = keystone

[glance_store]
...
stores = file,http
default_store = file
filesystem_store_datadir =/var/lib/glance/images/

C.配置

vim /etc/glance/glance-registry.conf

[database]
...
connection = mysql+pymysql://glance:123456@controller/glance

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name =default
user_domain_name =default
project_name = service
username = glance
password =123456

[paste_deploy]
...
flavor = keystone

D.填充数据库
su -s /bin/sh -c "glance-manage db_sync" glance

E.启动
systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service

验证

A.登录:. admin-openrc

B.下载:wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img

C.上传:openstack image create "cirros" --file cirros-0.3.5-x86_64-disk.img --disk-format qcow2 --container-format bare --public

image.png

E.查看列表
openstack image list

image.png

9. 计算服务(controller节点)

数据库

A.登录:mysql -u root -p123456

B.创建数据库:
CREATE DATABASE nova_api;
CREATE DATABASE nova;
CREATE DATABASE nova_cell0;

C.设置权限
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'controller' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'controller' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'controller' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY '123456';

D.退出exit

创建 nova

A.登录. admin-openrc

B.创建 nova user:
openstack user create --domain default --password-prompt nova

image.png

C.关联
openstack role add --project service --user nova admin

D.创建 nova service
openstack service create --name nova --description "OpenStack Compute" compute

image.png

E.创建 API
openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1

image.png

openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1

image.png

openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1

image.png

创建 placement

A.登录. admin-openrc

B.创建 placement user
openstack user create --domain default --password-prompt placement

image.png

C.关联

openstack role add --project service --user placement admin

D.创建 API
openstack service create --name placement --description "Placement API" placement

image.png

openstack endpoint create --region RegionOne placement public http://controller:8778

image.png

openstack endpoint create --region RegionOne placement internal http://controller:8778

image.png

openstack endpoint create --region RegionOne placement admin http://controller:8778

image.png

下载和配置

A.下载:
yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api

B.配置
vi /etc/nova/nova.conf
[DEFAULT]
...
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:123456@controller
my_ip =192.168.0.201use_neutron =Truefirewall_driver = nova.virt.firewall.NoopFirewallDriver

[api_database]
...
connection = mysql+pymysql://nova:123456@controller/nova_api

[database]
...
connection = mysql+pymysql://nova:123456@controller/nova

[api]
...
auth_strategy = keystone

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name =default
user_domain_name =default
project_name = service
username = nova
password =123456

[vnc]
enabled =true
...
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip

[glance]
...
api_servers = http://controller:9292
[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

[placement]
...
os_region_name = RegionOne
project_domain_name =Default
project_name = service
auth_type = password
user_domain_name =Default
auth_url = http://controller:35357/v3
username = placement
password =123456

注:删掉[placement] [keystone_authtoken]的其他项

C.配置

vi /etc/httpd/conf.d/00-nova-placement-api.conf
 ...
<Directory /usr/bin>
   <IfVersion >= 2.4>
      Require all granted
    </IfVersion>
   <IfVersion < 2.4>
       Order allow,deny
       Allow from all
   </IfVersion>
</Directory>

D.重启httpd
systemctl restart httpd.service

E.填充数据库
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova

image.png

su -s /bin/sh -c "nova-manage db sync" nova

F.验证 cell0 cell1
nova-manage cell_v2 list_cells

image.png

G.启动
systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

10. 计算服务(compute节点)

下载和配置

A.下载
yum -y install openstack-nova-compute

B.配置
vim /etc/nova/nova.conf
[DEFAULT]
...
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:123456@controller
my_ip =192.168.0.202
use_neutron =True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[api]
...
auth_strategy = keystone

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name =default
user_domain_name =default
project_name = service
username = nova
password =123456

[vnc]
...
enabled =True
vncserver_listen =0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html

[glance]
...
api_servers = http://controller:9292
[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

[placement]
...
os_region_name = RegionOne
project_domain_name =Default
project_name = service
auth_type = password
user_domain_name =Default
auth_url = http://controller:35357/v3
username = placement
password = 123456

C.启动
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service

11.  计算服务(controller节点)

添加compute节点到cell数据库

A.登陆:. admin-openrc

B.查看:openstack compute service list --service nova-compute

image.png

C.手动注册compute节点到cell数据库 (每次添加新compute节点都需要这个操作)
su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

image.png

D.自动注册compute节点到cell数据库(只需要操作一次)
vi /etc/nova/nova.conf
[scheduler]
discover_hosts_in_cells_interval = 300

注:C与D步操作任选其一

验证

A.登陆:. admin-openrc

B.查看计算服务列表:openstack compute service list

image.png

C.查看 api:openstack catalog list

image.png

D.查看镜像列表:openstack image list

image.png

E.检查cells和placementAPI 是否正常工作
nova-status upgrade check

image.png

12. 网络服务(controller节点)

数据库

A.登陆:mysql -uroot -p123456

B.创建neutron
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'controller' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '123456';

C.登出:exit

创建neutron用户

A.登陆:

. admin-openrc

B.创建neutron用户:
openstack user create --domain default --password-prompt neutron

image.png

C.关联:
openstack role add --project service --user neutron admin

D.创建neutronservice:
openstack service create --name neutron --description "OpenStack Networking" network

image.png

E.创建API:
openstack endpoint create --region RegionOne network public http://controller:9696

image.png

openstack endpoint create --region RegionOne network internal http://controller:9696

image.png

openstack endpoint create --region RegionOne network admin http://controller:9696

image.png

安装和配置(基于Provider networks)

A.安装:
yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables

B.配置:
vim /etc/neutron/neutron.conf
[DEFAULT]
...
core_plugin = ml2
service_plugins = 
transport_url = rabbit://openstack:123456@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

[database]
...
connection = mysql+pymysql://neutron:123456@controller/neutron

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 123456

[nova]
...
auth_url = http://controller:35357
auth_type = password
project_domain_name =default
user_domain_name =default
region_name = RegionOne
project_name = service
username = nova
password = 123456

[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp

C.配置

vi /etc/neutron/plugins/ml2/ml2_conf.ini

[ml2]
...
type_drivers = flat,vlan
tenant_network_types = 
mechanism_drivers = linuxbridge
extension_drivers = port_security

[ml2_type_flat]
...
flat_networks = provider

[securitygroup]
...
enable_ipset = true

D.配置
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:eth1

[vxlan]
enable_vxlan =false

[securitygroup]
...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

E.配置

vi /etc/neutron/dhcp_agent.ini

[DEFAULT]
...
interface_driver = linuxbridgedhcp_driver = neutron.agent.linux.dhcp.Dnsmasqenable_isolated_metadata = true

配置和启动

A.配置

vim /etc/neutron/metadata_agent.ini

[DEFAULT]
...
nova_metadata_host = controller
metadata_proxy_shared_secret = 123456

B.配置

vim /etc/nova/nova.conf
[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456
service_metadata_proxy = true
metadata_proxy_shared_secret = 123456

C.link创建软链接文件
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

D.填充数据库
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

E.重启APIservice
systemctl restart openstack-nova-api.service

F.启动服务
systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

13. 网络服务(compute节点)

安装和配置

A.下载
yum -y install openstack-neutron-linuxbridge ebtables ipset

B.配置
vim /etc/neutron/neutron.conf
[DEFAULT]
...
transport_url = rabbit://openstack:123456@controller
auth_strategy = keystone

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 123456

[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp

配置(基于 Provider networks)

A.配置

vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:eth1

[vxlan]
enable_vxlan =false

[securitygroup]
...
enable_security_group =true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

配置和启动

A.配置

vi /etc/nova/nova.conf

[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password =123456

B.启动
systemctl restart openstack-nova-compute.service
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service

验证(Controller 节点)

A.登录:. admin-openrc

B.查看列表:openstack network agent list

image.png

14. 仪表盘dashboard(controller节点)

A.下载
yum -y install openstack-dashboard

B.配置
vim /etc/openstack-dashboard/local_settings

OPENSTACK_HOST ="controller"
OPENSTACK_KEYSTONE_URL ="http://%s:5000/v3"% OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE ="user"
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
SESSION_ENGINE ='django.contrib.sessions.backends.cache'
CACHES = {'default': {'BACKEND':'django.core.cache.backends.memcached.MemcachedCache','LOCATION':'controller:11211',  }}OPENSTACK_API_VERSIONS = {"identity":3,"image":2,"volume":2,}OPENSTACK_KEYSTONE_DEFAULT_DOMAIN ="Default"ALLOWED_HOSTS = ['*']OPENSTACK_NEUTRON_NETWORK = {  ...'enable_router':False,'enable_quotas':False,'enable_distributed_router':False,'enable_ha_router':False,'enable_lb':False,'enable_firewall':False,'enable_vpn':False,'enable_fip_topology_check':False,}TIME_ZONE ="UTC"

C.配置

vim /etc/httpd/conf.d/openstack-dashboard.conf
...
WSGIApplicationGroup %{GLOBAL}

image.png

D.重启
systemctl restart httpd.service memcached.service

E.测试
http://192.168.0.201/dashboard

15.启动一个实例

创建虚拟网络(基于 provider networks)

登录. admin-openrc

创建network

openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider

image.png

创建子网

openstack subnet create --network provider --allocation-pool start=192.168.0.220,end=192.168.0.229 --dns-nameserver 192.168.0.1 --gateway 192.168.0.1 --subnet-range 192.168.0.0/24 provider

image.png

创建flavor

登录. admin-openrc

创建:

openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano

创建 key pair

登录:. demo-openrc

创建:

ssh-keygen -q -N ""

回车

openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey

查看

openstack keypair list

配置安全组

登录:. demo-openrc

ICMP

openstack security group rule create --proto icmp default

SSH

openstack security group rule create --proto tcp --dst-port 22 default

创建一个instance

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,921评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,635评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,393评论 0 338
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,836评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,833评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,685评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,043评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,694评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 42,671评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,670评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,779评论 1 332
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,424评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,027评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,984评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,214评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,108评论 2 351
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,517评论 2 343

推荐阅读更多精彩内容