一、部署基础环境:
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
2、创建 demo project
openstack project create --domain default --description "Demo Project" demo
3、创建 demo user:
openstack user create --domain default --password-prompt demo
4、创建 user role:
openstack role create user
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
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
创建登录脚本(在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
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
C.关联
openstack role add --project service --user glance admin
D.创建 glance service:
openstack service create --name glance --description "OpenStack Image" image
E.创建API
openstack endpoint create --region RegionOne image public http://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292
下载和配置
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
E.查看列表
openstack image list
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
C.关联
openstack role add --project service --user nova admin
D.创建 nova service
openstack service create --name nova --description "OpenStack Compute" compute
E.创建 API
openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
创建 placement
A.登录. admin-openrc
B.创建 placement user
openstack user create --domain default --password-prompt placement
C.关联
openstack role add --project service --user placement admin
D.创建 API
openstack service create --name placement --description "Placement API" placement
openstack endpoint create --region RegionOne placement public http://controller:8778
openstack endpoint create --region RegionOne placement internal http://controller:8778
openstack endpoint create --region RegionOne placement admin http://controller:8778
下载和配置
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
su -s /bin/sh -c "nova-manage db sync" nova
F.验证 cell0 cell1
nova-manage cell_v2 list_cells
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
C.手动注册compute节点到cell数据库 (每次添加新compute节点都需要这个操作)
su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
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
C.查看 api:openstack catalog list
D.查看镜像列表:openstack image list
E.检查cells和placementAPI 是否正常工作
nova-status upgrade check
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
C.关联:
openstack role add --project service --user neutron admin
D.创建neutronservice:
openstack service create --name neutron --description "OpenStack Networking" network
E.创建API:
openstack endpoint create --region RegionOne network public http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696
安装和配置(基于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
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}
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