openstack L版本(使用linux bridge的vxlan)

参考
[url]http://docs.openstack.org/liberty/install-guide-rdo/launch-instance-private.html[/url]

安装,多了一些,问题的处理

写了个通用的数据脚本mysql_openstack.sh
用来跟踪数据库的变化,
比如我们看keystone库有哪些数据,就是用
./mysql_openstack.sh keystone
脚本如下

#!/bin/sh
#for i in `awk ' {if(NR>4 && NR<40)print $2};' a.log `
#sed -i '/^#/d' cinder.conf
#sed -i '/^$/d' cinder.conf

mysql_user=root
mysql_password=haoning
mysql_host=ocontrol

if [ "$1" = "" ]
then
echo "please use ./mysql_openstack.sh [dbname], for example: ./mysql_openstack.sh keystone";
echo "this will exit."
exit 0;
fi

echo "use db " $1

for i in ` mysql -u$mysql_user -h$mysql_host -p$mysql_password $1 -e "show tables" |awk ' {if(NR>1)print $1};'|grep -v ml2_vxlan_allocations`
do
echo "\"select * from \`$i\`\"";
mysql -u$mysql_user -h$mysql_host -p$mysql_password $1 -e "select * from \`$i\`";
done



[color=red]
centos7.2升级iproute到3.10.0-54.el7后导致ip netns的结果后面带了个(id: 0),以至于openstack的L版本的neutron在建立router的时候解析不了,一直报错“ Cannot create namespace file” 解决办法[/color]
[url]https://bugzilla.redhat.com/show_bug.cgi?id=1292587[/url]
[url]https://review.openstack.org/#/c/258493/1/neutron/agent/linux/ip_lib.py[/url]


基础:
yum install centos-release-openstack-liberty
yum upgrade -y
yum install python-openstackclient openstack-selinux -y

rm -f /etc/localtime
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#ntpdate ntp.ubuntu.com

配置/etc/hostname
/etc/hosts
192.168.139.193 controller
192.168.139.192 compute
192.168.139.191 net

其实191没用上
网络节点也安装在了controller节点上

systemctl stop firewalld.service
systemctl disable firewalld.service

yum install mariadb mariadb-server MySQL-python -y
systemctl start mariadb.service
systemctl enable mariadb.service

安装mysql
vim /etc/my.cnf.d/mariadb_openstack.cnf
[mysqld]
bind-address 192.168.139.193
default-storage-engine innodb
innodb_file_per_table
collation-server utf8_general_ci
init-connect 'SET NAMES utf8'
character-set-server utf8


GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'controller' IDENTIFIED BY 'haoning';
flush privileges;


消息队列
yum install rabbitmq-server -y
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
#如果清空
#rabbitmqctl stop_app
#rabbitmqctl reset
rabbitmqctl add_user openstack haoning
rabbitmqctl set_permissions openstack ".*" ".*" ".*"



安装mongo,似乎没用上
yum install mongodb-server mongodb -y
vim /etc/mongod.conf
bind_ip 192.168.139.193

systemctl enable mongod.service
systemctl start mongod.service

一下密码全都设置成haoning

----------------------------------------------------------------------
■■■■■■■■■■■■■■■■■■keystone begin■■■■■■■■■■■■■■■■■■
keystone安装,在controller节点:


CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'controller' IDENTIFIED BY 'haoning';
flush privileges;


$ openssl rand -hex 10
06a0afd32e5265a9eba8

需要把memcache也装上,作为keystone的缓存。
这里keystone是通过阿帕奇发布
yum install openstack-keystone httpd mod_wsgi  memcached python-memcached -y 

systemctl enable memcached.service
systemctl start memcached.service

如果清空memcache使用
#echo "flush_all" | nc 127.0.0.1 11211
#清空

修改配置文件后得到
sed -i '/^#/d' /etc/keystone/keystone.conf
sed -i '/^$/d' /etc/keystone/keystone.conf
---------------------------
/etc/keystone/keystone.conf
[DEFAULT]
[DEFAULT]
admin_token=26d3c805d5033f6052b9
verbose=True
[assignment]
[auth]
[cache]
[catalog]
[cors]
[cors.subdomain]
[credential]
[database]
connection=mysql://keystone:haoning@controller/keystone
[domain_config]
[endpoint_filter]
[endpoint_policy]
[eventlet_server]
[eventlet_server_ssl]
[federation]
[fernet_tokens]
[identity]
[identity_mapping]
[kvs]
[ldap]
[matchmaker_redis]
[matchmaker_ring]
[memcache]
servers=localhost:11211
[oauth1]
[os_inherit]
[oslo_messaging_amqp]
[oslo_messaging_qpid]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[paste_deploy]
[policy]
[resource]
[revoke]
driver=sql
[role]
[saml]
[signing]
[ssl]
[token]
provider=uuid
driver=memcache
[tokenless_auth]
[trust]


同步数据库

su -s /bin/sh -c "keystone-manage db_sync" keystone


-------------------------
安http服务器
 /etc/httpd/conf/httpd.conf
ServerName controller


/etc/httpd/conf.d/wsgi-keystone.conf
Listen 5000
Listen 35357

<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined

<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
</VirtualHost>

<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined

<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
</VirtualHost>

systemctl enable httpd.service
systemctl start httpd.service


###创建服务:
第一次使用,由于keystone没完成,所以手动写上token
后续keystone安装后就另一种用法,source admin...


export OS_TOKEN=e9fc0e473e1b3072fc66
export OS_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3


向数据库里加 keystone 的endpoint
可以使用上面的脚本./mysql_openstack.sh keystone查看数据库变化
openstack service create  --name keystone --description "OpenStack Identity" identity

openstack endpoint create --region wuhan identity public http://controller:5000/v2.0
openstack endpoint create --region wuhan identity internal http://controller:5000/v2.0
openstack endpoint create --region wuhan identity admin http://controller:35357/v2.0


###创建用户角色等 projects, users, and roles
[code="java"]openstack project create --domain default --description "Admin Project" admin
#openstack user create --domain default --password-prompt admin
openstack user create --domain default --password haoning admin
openstack role create admin
openstack role add --project admin --user admin admin


openstack project create --domain default --description "Service Project" service
openstack project create --domain default --description "Demo Project" demo
#openstack user create --domain default --password-prompt demo
openstack user create --domain default --password haoning demo

openstack role create user
openstack role add --project demo --user demo user

###Verify operation
Edit the /usr/share/keystone/keystone-dist-paste.ini file and remove admin_token_auth from the [pipeline:public_api], [pipeline:admin_api], and [pipeline:api_v3] sections


#unset OS_TOKEN OS_URL
openstack --os-auth-url http://controller:35357/v3 --os-project-domain-id default --os-user-domain-id default --os-project-name admin --os-username admin --os-auth-type password token issue
openstack --os-auth-url http://controller:5000/v3 --os-project-domain-id default --os-user-domain-id default --os-project-name demo --os-username demo --os-auth-type password token issue

###Create OpenStack client environment scripts
unset OS_TOKEN OS_URL
# cat admin-openrc.sh
export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export PS1='[\u@\h \W(keystone_admin_v3)]\$ '

# cat demo-openrc.sh
export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=demo
export OS_TENANT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://controller:5000/v3
export OS_IMAGE_API_VERSION=2
export OS_IDENTITY_API_VERSION=3
export PS1='[\u@\h \W(keystone_demo_v3)]\$ '

source admin-openrc.sh
unset OS_TOKEN OS_URL
openstack token issue
执行这个之后再使用
openstack user list
等命令
[/code]


■■■■■■■■■■■■■■■■■■keystone end■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■glance begin■■■■■■■■■■■■■■■■■■
#换个窗口 安装glance


CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'controller' IDENTIFIED BY 'haoning';
flush privileges;



source admin-openrc.sh

openstack user create --domain default --password haoning glance
openstack role add --project service --user glance admin
openstack service create --name glance --description "OpenStack Image service" image

openstack endpoint create --region wuhan image public http://controller:9292
openstack endpoint create --region wuhan image internal http://controller:9292
openstack endpoint create --region wuhan image admin http://controller:9292

yum install openstack-glance python-glance python-glanceclient -y

---------------------------
配置/etc/glance/glance-api.conf

openstack-config --set /etc/glance/glance-api.conf DEFAULT notification_driver noop
openstack-config --set /etc/glance/glance-api.conf DEFAULT verbose True
openstack-config --set /etc/glance/glance-api.conf database connection mysql://glance:haoning@controller/glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_plugin password
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_name service
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken username glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken password haoning
openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone
openstack-config --set /etc/glance/glance-api.conf glance_store default_store file
openstack-config --set /etc/glance/glance-api.conf glance_store filesystem_store_datadir /var/lib/glance/images/




------------------------------------
配置 /etc/glance/glance-registry.conf

openstack-config --set /etc/glance/glance-registry.conf DEFAULT notification_driver noop
openstack-config --set /etc/glance/glance-registry.conf DEFAULT verbose True
openstack-config --set /etc/glance/glance-registry.conf database connection mysql://glance:haoning@controller/glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_plugin password
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_name service
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken username glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken password haoning
openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone

#★★★★★这里要注意一下,一些默认配置需要手工的去掉
#Comment out or remove any other options in the [keystone_authtoken] section

写入数据库,并启动和验证

su -s /bin/sh -c "glance-manage db_sync" glance

systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service

#Verify operation

echo "export OS_IMAGE_API_VERSION=2" | tee -a admin-openrc.sh demo-openrc.sh

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

glance image-create --name "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress
glance image-list

■■■■■■■■■■■■■■■■■■glance end■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■nova begin■■■■■■■■■■■■■■■■■■
#★★★★在controller节点 安装nova的客户端功能,真正起作用的在compute节点


CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'controller' IDENTIFIED BY 'haoning';
flush privileges;

source admin-openrc.sh
openstack user create --domain default --password haoning nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region wuhan compute public http://controller:8774/v2/%\(tenant_id\)s
openstack endpoint create --region wuhan compute internal http://controller:8774/v2/%\(tenant_id\)s
openstack endpoint create --region wuhan compute admin http://controller:8774/v2/%\(tenant_id\)s

yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient -y

-------------
配置 /etc/nova/nova.conf
-----------------------------------

openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.139.193
openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutron
openstack-config --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf DEFAULT verbose True
openstack-config --set /etc/nova/nova.conf database connection mysql://nova:haoning@controller/nova
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host controller
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password haoning
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_plugin password
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken password haoning
openstack-config --set /etc/nova/nova.conf vnc vncserver_listen $my_ip
openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address $my_ip
openstack-config --set /etc/nova/nova.conf glance host controller
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp

-----------------------------------------------

同步数据库并在controller节点上启动

su -s /bin/sh -c "nova-manage db sync" nova
#/var/log/nova 检查log是否成功
systemctl enable openstack-nova-api.service openstack-nova-cert.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-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

systemctl restart openstack-nova-api.service
systemctl restart openstack-nova-cert.service
systemctl restart openstack-nova-consoleauth.service
systemctl restart openstack-nova-scheduler.service
systemctl restart openstack-nova-conductor.service
systemctl restart openstack-nova-novncproxy.service


#★★★在compute节点--------------上装nova-compute功能

安装

yum install openstack-nova-compute sysfsutils openstack-utils -y

[color=red]#openstack-utils 才有openstack-config 可以rpm -qa openstack*
查看[/color]
配置/etc/nova/nova.conf
----------------------------------------
openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.139.192
openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutron
openstack-config --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf DEFAULT verbose True
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host controller
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password haoning
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_plugin password
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken password haoning
openstack-config --set /etc/nova/nova.conf vnc enabled True
openstack-config --set /etc/nova/nova.conf vnc vncserver_listen 0.0.0.0
openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address $my_ip
openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://controller:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf glance host controller
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp


-------------------
/etc/nova/nova.conf
如果没有进行kvm穿透,这里得到的结果是0,就需要设置成qemu
如何kvm穿透
自行google
[color=red]KVM虚拟化之嵌套虚拟化nested[/color]
kvm穿透,在libvirt的配置文件里面修改,查看其他的
#egrep -c '(vmx|svm)' /proc/cpuinfo
#virt_type qemu

启动libvert和nova

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service

#Verify operation
source admin-openrc.sh
nova service-list
nova endpoints
nova image-list

■■■■■■■■■■■■■■■■■■nova end■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■neutron begin■■■■■■■■■■■■■■■■■■
在controller节点安装neutron

数据库
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'controller' IDENTIFIED BY 'haoning';
flush privileges;


[color=red]每一步变化都可以./mysql_openstack.sh neutron 查看数据库变化[/color]

openstack user create --domain default --password haoning neutron
openstack role add --project service --user neutron admin

openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region wuhan network public http://controller:9696
openstack endpoint create --region wuhan network internal http://controller:9696
openstack endpoint create --region wuhan network admin http://controller:9696



###★★★★★Networking Option 2: Self-service networks-------begin★★★★★★★★
使用官方文档的linuxbridge和vxlan方式
建立共有网络public,和私有网络private
共有网络的vm使用flat模式和本地局域网一样就可以
私有网络,类似nat,
可以建一个浮动ip挂载有私有网络的vm上,让一个vm既有私有网络又有共有网络

安装


yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset -y

---------------------
配置文件
/etc/neutron/neutron.conf
neutron的基础网络配置

openstack-config --set /etc/neutron/neutron.conf database connection mysql://neutron:haoning@controller/neutron
openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins router
openstack-config --set /etc/neutron/neutron.conf DEFAULT allow_overlapping_ips True
openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf DEFAULT verbose True
openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes True
openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes True
openstack-config --set /etc/neutron/neutron.conf DEFAULT nova_url http://controller:8774/v2
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host controller
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password haoning
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_plugin password
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password haoning
openstack-config --set /etc/neutron/neutron.conf nova auth_url http://controller:35357
openstack-config --set /etc/neutron/neutron.conf nova auth_plugin password
openstack-config --set /etc/neutron/neutron.conf nova project_domain_id default
openstack-config --set /etc/neutron/neutron.conf nova user_domain_id default
openstack-config --set /etc/neutron/neutron.conf nova region_name wuhan
openstack-config --set /etc/neutron/neutron.conf nova project_name service
openstack-config --set /etc/neutron/neutron.conf nova username nova
openstack-config --set /etc/neutron/neutron.conf nova password haoning
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp



---------------
配置
/etc/neutron/plugins/ml2/ml2_conf.ini
二层网络用来配置vxlan


openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,vlan,vxlan
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge,l2population
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks public
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges 1:1000
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset True



--------------------
配置
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
linuxbridge相关的
brctl show 和ip netns查看

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings public:eth1
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 192.168.139.193
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini agent prevent_arp_spoofing True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver



--------------------
配置
/etc/neutron/l3_agent.ini
三层网络


openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
openstack-config --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge
openstack-config --set /etc/neutron/l3_agent.ini DEFAULT verbose True


#The external_network_bridge option intentionally lacks a value to enable multiple external networks on a single agent

#☆☆☆☆★★★★★
#Comment out or remove any other options in the [keystone_authtoken] section.

------------------------------------
配置获取ip的dhcp服务,

/etc/neutron/dhcp_agent.ini

openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata True
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT verbose True
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dnsmasq_config_file /etc/neutron/dnsmasq-neutron.conf


-----------------------------------
dhcp服务是通过dnsmasq进程起的

/etc/neutron/dnsmasq-neutron.conf

echo "dhcp-option-force=26,1450" >/etc/neutron/dnsmasq-neutron.conf



###★★★★★Networking Option 2: Self-service networks------end★★★★★★★★


-------------------------------
配置vm的metadata
/etc/neutron/metadata_agent.ini


openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_uri http://controller:5000
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_url http://controller:35357
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_region wuhan
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_plugin password
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_domain_id default
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT user_domain_id default
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_name service
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT username neutron
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT password haoning
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip controller
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret METADATA_SECRET
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT verbose True



[color=red]#★★★★★★★★★★注意这里metadata_agent.ini要删掉一部分东西[/color]
#admin_tenant_name = %SERVICE_TENANT_NAME%
#admin_user = %SERVICE_USER%
#admin_password = %SERVICE_PASSWORD%


------------------------------------------------------------------------------------------------------------
在nova的配置文件上加上neutron的关联,
[color=red]所有节点都要加上[/color]
/etc/nova/nova.conf

openstack-config --set /etc/nova/nova.conf neutron url http://controller:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url http://controller:35357
openstack-config --set /etc/nova/nova.conf neutron auth_plugin password
openstack-config --set /etc/nova/nova.conf neutron project_domain_id default
openstack-config --set /etc/nova/nova.conf neutron user_domain_id default
openstack-config --set /etc/nova/nova.conf neutron region_name wuhan
openstack-config --set /etc/nova/nova.conf neutron project_name service
openstack-config --set /etc/nova/nova.conf neutron username neutron
openstack-config --set /etc/nova/nova.conf neutron password haoning

openstack-config --set /etc/nova/nova.conf service_metadata_proxy True
openstack-config --set /etc/nova/nova.conf metadata_proxy_shared_secret METADATA_SECRET

------------------------------------------------------------------------------------------------------------
同步数据库并启动
[quote]
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
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

systemctl restart openstack-nova-api.service

systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl restart neutron-server.service
systemctl restart neutron-linuxbridge-agent.service
systemctl restart neutron-dhcp-agent.service
systemctl restart neutron-metadata-agent.service

##########For networking option 2, also enable and start the layer-3 service:
systemctl enable neutron-l3-agent.service
systemctl start neutron-l3-agent.service
[/quote]

检查错误:
cd /var/log/neutron
grep ERROR *


★★★★★★★★★★★★★★★compute 节点★☆★★★★★★★★★★★★★

在compute节点上添加neutron的agent服务
配合vm启动的时候关联网络
安装:

yum install openstack-neutron openstack-neutron-linuxbridge ebtables ipset -y

-------------------------------------
配置
/etc/neutron/neutron.conf
-------------------

openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf DEFAULT verbose True
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host controller
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password haoning
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_plugin password
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password haoning
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

-----------------------

###★★★★★Networking Option 2: Self-service networks-------begin★★★★★★★★
------------------------------
配置
/etc/neutron/plugins/ml2/linuxbridge_agent.ini

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings public:eth1
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 192.168.139.192
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini agent prevent_arp_spoofing True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

###★★★★★Networking Option 2: Self-service networks------end★★★★★★★★


----------------------这里controller节点和compute节点都要加★★★★---------
上面说过的,compute节点上也要把nova的配置文件上添加neutron的关联
注意改完配需要重启
/etc/nova/nova.conf
------------------

openstack-config --set /etc/nova/nova.conf neutron url http://controller:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url http://controller:35357
openstack-config --set /etc/nova/nova.conf neutron auth_plugin password
openstack-config --set /etc/nova/nova.conf neutron project_domain_id default
openstack-config --set /etc/nova/nova.conf neutron user_domain_id default
openstack-config --set /etc/nova/nova.conf neutron region_name wuhan
openstack-config --set /etc/nova/nova.conf neutron project_name service
openstack-config --set /etc/nova/nova.conf neutron username neutron
openstack-config --set /etc/nova/nova.conf neutron password haoning

-----------------
compute几点只有nova的compute服务和neutron的aget服务
启动:

systemctl restart openstack-nova-compute.service

systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service


###Verify operation验证:
[code="java"]
# neutron ext-list
+-----------------------+--------------------------+
| alias | name |
+-----------------------+--------------------------+
| flavors | Neutron Service Flavors |
| security-group | security-group |
| dns-integration | DNS Integration |
| net-mtu | Network MTU |
| port-security | Port Security |
| binding | Port Binding |
| provider | Provider Network |
| agent | agent |
| quotas | Quota management support |
| subnet_allocation | Subnet Allocation |
| dhcp_agent_scheduler | DHCP Agent Scheduler |
| rbac-policies | RBAC Policies |
| external-net | Neutron external network |
| multi-provider | Multi Provider Network |
| allowed-address-pairs | Allowed Address Pairs |
| extra_dhcp_opt | Neutron Extra DHCP opts |
+-----------------------+--------------------------+
[/code]
###★★★★★Networking Option 2: Self-service networks-------begin★★★★★★★★
开始配置neutron的网络

如果安装过程中
/var/log/keystone /var/log/nova /var/log/neutron都没有错误
即可

source admin-openrc.sh
neutron agent-list

[color=red]#public network建立共有网络的相对简单:[/color]

neutron net-create public --shared --provider:physical_network public --provider:network_type flat

#neutron subnet-create public PUBLIC_NETWORK_CIDR --name public --allocation-pool start=START_IP_ADDRESS,end=END_IP_ADDRESS --dns-nameserver DNS_RESOLVER --gateway PUBLIC_NETWORK_GATEWAY
neutron subnet-create public 192.168.139.0/20 --name public --allocation-pool start=192.168.139.201,end=192.168.139.210 --dns-nameserver 8.8.4.4 --gateway 192.168.128.1


[color=red]#private network建立一个私有的网络[/color]

neutron net-create private
neutron subnet-create private 172.16.1.0/24 --name private --dns-nameserver 8.8.4.4 --gateway 172.16.1.1

#Create a router
neutron net-update public --router:external

neutron router-create router

neutron router-interface-add router private

#Added interface 65b58347-09fa-43dd-914d-31b4885d84ef to router router.
neutron router-gateway-set router public

#Verify operation验证
ip netns
neutron router-port-list router

ping -c 4 192.168.139.202

brctl show

ip netns


#建立vm ,先简历秘钥对
source admin......[color=orange](demo为啥不好使?)[/color]

ssh-keygen -q -N ""
nova keypair-add --pub-key ~/.ssh/id_rsa.pub mykey
nova keypair-list

#安全组

nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule default tcp 22 22 0.0.0.0/0


#Launch an instance on the public network--------begin----------
source admin-openrc.sh
nova flavor-list
nova image-list
neutron net-list
nova secgroup-list
#nova boot --flavor m1.tiny --image cirros --nic net-id=PUBLIC_NET_ID --security-group default --key-name mykey public-instance
#Replace PUBLIC_NET_ID with the ID of the public provider network.
nova boot --flavor m1.tiny --image cirros --nic net-id=89f9ac2b-d7cf-4f45-8819-487c3b1c4fc7 --security-group default --key-name mykey public-instance
nova list
nova get-vnc-console public-instance novnc

#Launch an instance on the public network--------end----------


#删除网络 

如果遇到问题,需要把简历的网络一次删除

这里有顺序,先删router相关的再删子网,再删网络

neutron router-list
neutron router-gateway-clear f16bd408-181d-40d9-8998-5d556fec7e0f
neutron router-interface-delete f16bd408-181d-40d9-8998-5d556fec7e0f private
neutron router-delete f16bd408-181d-40d9-8998-5d556fec7e0f
neutron subnet-list
neutron subnet-delete 7b03ef7d-144f-479e-bf3c-4a880a48ac3d
neutron subnet-delete f3eb1841-6666-4821-8fea-0d8d98352c73
neutron net-list
neutron net-delete 89f9ac2b-d7cf-4f45-8819-487c3b1c4fc7
neutron net-delete 6ac13027-8e87-4696-b01f-5198a3ffa509



[color=red]################public network begin#############
完整的简历共有网络[/color]
★★★★★★★★★★★★★★★★★★★★★★★

neutron net-create public --shared --provider:physical_network public --provider:network_type flat
neutron net-list
neutron subnet-create public 192.168.139.0/20 --name public --allocation-pool start=192.168.139.221,end=192.168.139.230 --dns-nameserver 8.8.4.4 --gateway 192.168.128.1
neutron subnet-list

$ ssh-keygen -q -N ""
$ nova keypair-add --pub-key ~/.ssh/id_rsa.pub mykey
nova keypair-list

nova secgroup-list
nova secgroup-list-rules 1f676a35-7a31-4265-aa2b-cc4317de8633
nova help|grep secgroup

nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule default tcp 22 22 0.0.0.0/0

nova flavor-list
nova image-list
neutron net-list
nova secgroup-list

#nova boot --flavor m1.tiny --image cirros --nic net-id=PUBLIC_NET_ID --security-group default --key-name mykey public-instance
#Replace PUBLIC_NET_ID with the ID of the public provider network.
nova boot --flavor m1.tiny --image cirros --nic net-id=79fa9460-1f32-4141-9a16-08dea9355e2a --security-group default --key-name mykey public-instance
nova list
#能看到ip
nova get-vnc-console public-instance novnc

默认密码
cirros
cubswin:)

ping 192.168.139.222
ssh cirros@192.168.139.222

ip netns
ifconfig



[color=red]#建立个私有网络的vm[/color]
[b]这个最重要,容易出错[/b]
[code="java"]
neutron net-create private

#neutron subnet-create private PRIVATE_NETWORK_CIDR --name private --dns-nameserver DNS_RESOLVER --gateway PRIVATE_NETWORK_GATEWAY
neutron subnet-create private 172.16.1.0/24 --name private --dns-nameserver 8.8.4.4 --gateway 172.16.1.1
neutron net-list
neutron subnet-list

#Private project networks connect to public provider networks using a virtual router. Each router contains an interface to at least one private project network and a gateway on a public provider network.

#The public provider network must include the router: external option to enable project routers to use it for connectivity to external networks such as the Internet. The admin or other privileged user must include this option during network creation or add it later. In this case, we can add it to the existing public provider network.

#Add the router: external option to the public provider network:
neutron net-update public --router:external

# neutron router-create router
Created a new router:
+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | True |
| distributed | False |
| external_gateway_info | |
| ha | False |
| id | fc43e7ee-44d1-483b-a5b2-6622637bb106 |
| name | router |
| routes | |
| status | ACTIVE |
| tenant_id | a847d63d35e54622b641ea6b74c3c126 |
+-----------------------+--------------------------------------+
# neutron router-list
+--------------------------------------+--------+-----------------------+-------------+-------+
| id | name | external_gateway_info | distributed | ha |
+--------------------------------------+--------+-----------------------+-------------+-------+
| fc43e7ee-44d1-483b-a5b2-6622637bb106 | router | null | False | False |
+--------------------------------------+--------+-----------------------+-------------+-------+
#


# neutron router-interface-add router private
Added interface 9d9f73e7-a5e4-4d89-93c7-df135ac39a26 to router router.

# neutron router-gateway-set router public
Set gateway for router router
#
#
# neutron router-list
+--------------------------------------+--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
| id | name | external_gateway_info | distributed | ha |
+--------------------------------------+--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
| fc43e7ee-44d1-483b-a5b2-6622637bb106 | router | {"network_id": "79fa9460-1f32-4141-9a16-08dea9355e2a", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "1403be6d-fb25-4789-80ce-d570f291c6e4", "ip_address": "192.168.139.223"}]} | False | False |
+--------------------------------------+--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
# neutron net-list
+--------------------------------------+---------+-------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+---------+-------------------------------------------------------+
| 79fa9460-1f32-4141-9a16-08dea9355e2a | public | 1403be6d-fb25-4789-80ce-d570f291c6e4 192.168.128.0/20 |
| 1fd72b95-0264-4fca-8173-f321239a55fa | private | 97d8a9a1-d1b3-4091-9ee0-51af01c84b4b 172.16.1.0/24 |
+--------------------------------------+---------+-------------------------------------------------------+
# neutron subnet-list
+--------------------------------------+---------+------------------+--------------------------------------------------------+
| id | name | cidr | allocation_pools |
+--------------------------------------+---------+------------------+--------------------------------------------------------+
| 1403be6d-fb25-4789-80ce-d570f291c6e4 | public | 192.168.128.0/20 | {"start": "192.168.139.221", "end": "192.168.139.230"} |
| 97d8a9a1-d1b3-4091-9ee0-51af01c84b4b | private | 172.16.1.0/24 | {"start": "172.16.1.2", "end": "172.16.1.254"} |
+--------------------------------------+---------+------------------+--------------------------------------------------------+
# ip netns
qrouter-fc43e7ee-44d1-483b-a5b2-6622637bb106 (id: 2)
qdhcp-1fd72b95-0264-4fca-8173-f321239a55fa (id: 1)
qdhcp-79fa9460-1f32-4141-9a16-08dea9355e2a (id: 0)

# neutron router-port-list router
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+
| 8b18370f-345e-42bc-b4eb-30391866e757 | | fa:16:3e:78:33:40 | {"subnet_id": "1403be6d-fb25-4789-80ce-d570f291c6e4", "ip_address": "192.168.139.223"} |
| 9d9f73e7-a5e4-4d89-93c7-df135ac39a26 | | fa:16:3e:6b:08:b5 | {"subnet_id": "97d8a9a1-d1b3-4091-9ee0-51af01c84b4b", "ip_address": "172.16.1.1"} |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+
# brctl show
bridge name bridge id STP enabled interfaces
brq1fd72b95-02 8000.063507f2cee3 no tap65ad6fb9-ea
tap9d9f73e7-a5
vxlan-18
brq79fa9460-1f 8000.505112aa8214 no eth1
tap4b63544c-9b
virbr0 8000.5254009c2b11 yes virbr0-nic
# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether 50:52:18:aa:81:11 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master brq79fa9460-1f state UP mode DEFAULT qlen 1000
link/ether 50:51:12:aa:82:14 brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT
link/ether 52:54:00:9c:2b:11 brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT qlen 500
link/ether 52:54:00:9c:2b:11 brd ff:ff:ff:ff:ff:ff
13: tap4b63544c-9b@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master brq79fa9460-1f state UP mode DEFAULT qlen 1000
link/ether b6:67:ca:38:ff:b2 brd ff:ff:ff:ff:ff:ff link-netnsid 0
14: brq79fa9460-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT
link/ether 50:51:12:aa:82:14 brd ff:ff:ff:ff:ff:ff
15: tap65ad6fb9-ea@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master brq1fd72b95-02 state UP mode DEFAULT qlen 1000
link/ether e6:b7:1f:bc:bb:a2 brd ff:ff:ff:ff:ff:ff link-netnsid 1
16: vxlan-18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master brq1fd72b95-02 state UNKNOWN mode DEFAULT
link/ether 06:35:07:f2:ce:e3 brd ff:ff:ff:ff:ff:ff
17: brq1fd72b95-02: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP mode DEFAULT
link/ether 06:35:07:f2:ce:e3 brd ff:ff:ff:ff:ff:ff
18: tap9d9f73e7-a5@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master brq1fd72b95-02 state UP mode DEFAULT qlen 1000
link/ether 5e:84:a7:84:27:5b brd ff:ff:ff:ff:ff:ff link-netnsid 2
#

[/code]

[color=red][b]遇到的问题[/b][/color]

#如果升级了iproute
#如果报错:l3-agent.log
#[color=darkred]2016-03-12 21:29:26.103 1170 ERROR neutron.agent.l3.agent Stderr: Cannot create namespace file "/var/run/netns/qrouter-fc43e7ee-44d1-483b-a5b2-6622637bb106": File exists[/color]
#问题是
[url]https://bugzilla.redhat.com/show_bug.cgi?id=1292587[/url]
#需要修改[url]https://review.openstack.org/#/c/258493/1/neutron/agent/linux/ip_lib.py
/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py[/url]


#Replace PRIVATE_NET_ID with the ID of the private project network
#nova boot --flavor m1.tiny --image cirros --nic net-id=PRIVATE_NET_ID --security-group default --key-name mykey private-instance
[code="java"]
nova boot --flavor m1.tiny --image cirros --nic net-id=1fd72b95-0264-4fca-8173-f321239a55fa --security-group default --key-name mykey private-instance

# nova list
+--------------------------------------+------------------+--------+------------+-------------+------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------------------+--------+------------+-------------+------------------------+
| edd82475-1585-469f-aa43-95fa80f1f812 | private-instance | ACTIVE | - | Running | private=172.16.1.3 |
| bad46269-19d1-423a-88be-652a06c08723 | public-instance | ACTIVE | - | Running | public=192.168.139.222 |
+--------------------------------------+------------------+--------+------------+-------------+------------------------+

nova get-vnc-console private-instance novnc

neutron floatingip-create public

# neutron floatingip-list
+--------------------------------------+------------------+---------------------+---------+
| id | fixed_ip_address | floating_ip_address | port_id |
+--------------------------------------+------------------+---------------------+---------+
| 2cf23d2c-748f-4242-89eb-1d53721560a1 | | 192.168.139.225 | |
+--------------------------------------+------------------+---------------------+---------+
nova floating-ip-associate private-instance 192.168.139.225


neutron floatingip-create public
nova floating-ip-associate private-instance 203.0.113.104
# nova list
+--------------------------------------+------------------+--------+------------+-------------+-------------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------------------+--------+------------+-------------+-------------------------------------+
| edd82475-1585-469f-aa43-95fa80f1f812 | private-instance | ACTIVE | - | Running | private=172.16.1.3, 192.168.139.225 |
| bad46269-19d1-423a-88be-652a06c08723 | public-instance | ACTIVE | - | Running | public=192.168.139.222 |
+--------------------------------------+------------------+--------+------------+-------------+-------------------------------------+

ssh root@192.168.139.225

# neutron floatingip-list
+--------------------------------------+------------------+---------------------+--------------------------------------+
| id | fixed_ip_address | floating_ip_address | port_id |
+--------------------------------------+------------------+---------------------+--------------------------------------+
| 2cf23d2c-748f-4242-89eb-1d53721560a1 | 172.16.1.3 | 192.168.139.225 | af79694b-2f59-4bf0-a0d0-6c619de49941 |
+--------------------------------------+------------------+---------------------+--------------------------------------+
#

[/code]

################public network end#############

###★★★★★Networking Option 2: Self-service networks-------end★★★★★★★★


■■■■■■■■■■■■■■■■■■neutron end■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■horizon begin■■■■■■■■■■■■■■■■■■

■■■■■■■■■■■■■■■■■■horizon end■■■■■■■■■■■■■■■■■■
OpenStack Neutron网络配置实战:从核心架构到生产部署 虚拟化与云计算是现代数据中心的核心技术,通过软件定义网络(SDN)实现对物理网络资源的抽象与灵活调度。其原理在于将网络控制平面与数据平面分离,通过集中控制器管理虚拟网络设备。这项技术的核心价值在于为云平台提供了可编程、自动化且多租户隔离的网络服务。在OpenStack等主流云平台中,网络服务通常由Neutron组件实现,它管理着虚拟交换机、路由器和安全组等关键对象。典型的应用场景包括为虚拟机提供二层连通性、实现不同租户网络间的三层路由,以及通过浮动IP提供外部访问能力。本文将聚焦于OpenStack Neu 阅读详情

相关推荐

运维系列&虚拟化系列&OpenStack系列【仅供参考】:VXLAN 概念(Part II)- 每天5分钟玩转 OpenS(109)&&在 ML2 中配置 VXLAN - 每天5分钟玩转 OpenSt

VXLAN 概念(Part II)- 每天5分钟玩转 OpenStack(109)&& 在 ML2 中配置 VXLAN - 每天5分钟玩转 OpenStack(110)

weixin_54626591的博客 108

openstack版本查询

文章目录方法一(命令)方法二(命令)方法三(nova查询)demo1demo2 方法一(命令) [root@node-1 ~]# nova-manage shell python No handlers could be found for logger "oslo_config.cfg" Python 2.7.5 (default, Nov 20 2015, 02:00:19) [GCC 4....

崔崇鑫的博客,你linux/云运维工作中的百科全书。 8617

openstack--L版本

1.手动安装 liberty 版本 openstack 环境 2.手动安装 liberty 版本 openstack 环境(allinone)---安装数据库及 rabbitmq 3.手动安装liberty版本openstack环境(allinone)---安装keystone 4.手动安装 liberty 版本 openstack 环境(allinone)---安装 glance

openstack Linux bridge实现neutron网络

Linux bridge实现虚拟交换机的基本原理 br0是linux bridge,br0充当虚拟交换机的作用,负责将物理网卡eth0和虚拟机网卡tap设备vnet0/vnet1连接到同一个二层网络,实现虚拟机VM1和VM2,以及虚拟机与外网之间的通信。   Linux-bridge支持local、flat、vlan和vxlan四种网络类型,目前不支持gre。 一、local 

每天进步一点点。。。的博客 5535

Openstack linux网桥的知识

Openstack里面关于网桥的知识,讲得非常透彻,有利于我们理解Openstack是使用网桥以及网络的机理.

浅谈openstack中使用linux_bridge实现vxlan网络

主要介绍了浅谈openstack中使用linux_bridge实现vxlan网络,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

openstack neutron网络插件学习(一)【linux-bridge实现】

1、网络架构 openvswitch与linux-bridge相比较而言,openvswitch支持的网络类型更加丰富,应用也比较广泛,因此图示直接使用OVS。linux-bridge支持local, flat, vlan和vxlan 四种network type,目前不支持gre,相比较而言openvswitch支持GRE网络; 管理网络:用户管理所有节点的网络; 内部网络:计算节点与网络节点通过内部网络通信,tenant network(租户网络,租户自己创建管理,网络之间可以重合); 外部

weixin_45537413的博客 3831

Oracle EBS R12 AP模块发票导入接口实战:从SQL插入到API调用的完整流程

本文详细解析了Oracle EBS R12 AP模块发票导入接口的完整流程,从SQL插入到API调用的实战技巧。涵盖接口表设计、数据验证、双通道导入机制及错误诊断,特别分享官方文档未提及的高阶优化方案,助力企业实现财务数字化转型。

weixin_33728268的博客 476

openstack中使用linux_bridge实现vxlan网络

openstack环境: 1 版本:ocata 2 系统:ubuntu16.04.2 3 控制节点 1个 + 计算节点 1个 4 控制节点网卡为ens33,ip = 172.171.5.200 ens34 manual模式 无IP (为什么外网网卡ens34没有IP地址?这是另一个故事,后面有专门章节讲解。) 计算节点网卡 ens33 ,ip = 172.171.5....

weixin_30877227的博客 331

告别DLTS的模糊地带:手把手教你用拉普拉斯深能级瞬态光谱(LDLTS)精准揪出半导体缺陷

本文详细介绍了拉普拉斯深能级瞬态光谱(LDLTS)技术在半导体缺陷检测中的高分辨率解决方案。相比传统DLTS,LDLTS通过拉普拉斯变换和正则化算法,将分辨率提升至1meV,有效解析复杂重叠缺陷谱,适用于硅、GaN等材料的精确缺陷分析。文章涵盖LDLTS原理、系统搭建、测量流程及工业应用案例,为半导体工艺优化提供强大工具。

weixin_29238147的博客 193

40-基于STM32与LD3320的智能语音调光台灯开发全攻略(代码+硬件+调试心得)

本文详细介绍了基于STM32与LD3320的智能语音调光台灯开发全攻略,包括硬件设计、软件实现和调试心得。项目利用STM32单片机控制LD3320语音识别模块,实现语音控制开关和PWM调光功能,适合非接触式操作场景。文章还分享了硬件选型、PWM调光算法优化及常见问题解决方案,为开发者提供完整参考。

weixin_29163797的博客 325

理解 neutron(15):Neutron linux-bridge-agent 创建 linux bridge 的简要过程

学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)NeutronOpenvSwitch + GRE/VxLAN 虚拟网络 (4)Neutron OVS OpenFlow 流表 和 L2 Population (5)Neutron DHCP Agen...

weixin_34075551的博客 851

避坑指南:ANSYS流固耦合计算中System Coupling数据传递设置与常见报错解决

本文深入解析ANSYS Workbench中System Coupling模块在双向流固耦合(FSI)计算中的应用,详细讲解数据传递机制、典型报错解决方案及高阶调试技巧。通过实际案例展示如何优化耦合步长、处理大变形问题,并提升并行计算效率,帮助工程师有效规避常见技术陷阱。

weixin_29213525的博客 727

OpenStack Train版网络配置详解:从基础到实战

本文深度解析OpenStack Train版网络服务Neutron的架构与核心组件,提供从控制节点到计算节点的实战配置指南。重点阐述自服务网络模式下的VXLAN配置、LinuxBridge Agent部署及关键参数调优,并涵盖网络创建、安全组管理和常见故障排查,旨在帮助用户构建稳定高效的云网络环境。

algae的博客 820

springboot源码 红色J_通达信副图指标源码之,出手就赢

今天跟大家分享一个通达信副图指标源码,本指标没有未来函数,因为本指标没有卖点提示,所以本指标需配合主图指标使用效果会更好,简单易懂,很容易明白,所以就不过多介绍使用方法了,以下是指标的贴图。风险提示!股市有风险买卖需谨慎,本指标只做参考建议,不做买卖交易结果,自己要对自己交易结果的盈亏负责,以下是指标的源码。VAR2:=REF(LOW,1);VAR3:=SMA(ABS(LOW-VAR2),3,1)...

weixin_39859909的博客 2847

PMOS过压保护电路设计与仿真优化策略

本文深入探讨PMOS过压保护电路(OVP)的设计与仿真优化策略,详细解析PMOS管选型、稳压管特性及三极管配置等关键要素。通过Proteus仿真案例揭示典型设计误区,并提供响应速度提升、抗干扰设计等进阶优化方案,助力工程师实现高可靠性的电源保护系统设计。

weixin_42620340的博客 440

centos7.9上部署openstack(train版)——6. Networking--neutron

本文介绍了 OpenStack Neutron 网络服务的原理与部署实践。Neutron 提供网络即服务(NaaS),支持二层交换、三层路由、安全组及负载均衡等功能,可基于 Linux Bridge 或 OVS 实现 VLAN、Flat 或 VXLAN 网络。文章详细演示了在 Controller 和 Compute 节点上配置 Neutron 的两种模式:仅支持管理员管理的提供商网络,以及支持普通用户创建私有网络的自助服务网络(含 L3 路由与浮动 IP)。通过创建数据库、注册服务、配置 ML2 插件等

qq_40567491的博客 395

《一》:LBE,VR 大空间系列——场景环境需求解析

当前,大量 VR 体验活动在室内场地开展。因此,对于场地照明有特定要求:除天花板外,场地的所有表面均需有照明覆盖。这是为了保证玩家无论处于场地的哪个位置,地面与墙面都不会出现明显的影子。场地内不建议安装射灯或高强度的点光源,若已安装此类灯具,需使用柔光板进行遮盖。此外,要避免在阳光下使用 VR 设备台。参考图(请忽略其中Maker标签)

unitygroup的博客 944

理解 neutron(15):Neutron Linux Bridge + VLAN/VXLAN 虚拟网络

学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)NeutronOpenvSwitch + GRE/VxLAN 虚拟网络 (4)Neutron OVS OpenFlow 流表 和 L2 Population (5)Neutron DHCP Agent (6)Neutron L3...

weixin_30512089的博客 153

基于 YOLOv26 的陶瓷产品缺陷检测系统:智能视觉质检方案

本文提出了一种基于YOLOv26深度学习模型的陶瓷产品智能缺陷检测系统。该系统针对陶瓷生产中的裂纹、气泡、釉面缺陷等8类常见质量问题,采用YOLOv26目标检测算法实现高精度自动化检测。系统架构包含数据采集、预处理、YOLOv26检测和后处理四个模块,具有多类别分类、实时推理和强鲁棒性等技术优势。文章详细介绍了数据预处理与增强方法,并提供了Python代码实现示例。该方案可显著提升陶瓷产品质量检测效率,替代传统人工检测方式,为陶瓷制造业提供智能化质检解决方案。

一键难忘的博客 788

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Neutron:OpenStack网络虚拟化核心

Neutron是OpenStack云计算平台的核心网络服务组件,负责提供和管理云环境中的网络连接、IP地址分配、路由、防火墙等网络功能,实现了对虚拟网络资源的抽象、隔离和自动化管理。Neutron的核心作用在于将复杂的物理网络基础设施抽象为软件定义的、可按需创建和配置的逻辑网络资源,从而支撑OpenStack云平台中虚拟机(实例)之间的互联以及与外部网络的通信。Neutron采用分布式、插件化的架构,主要分为控制节点(运行)和网络节点/计算节点(运行各类Agentnet01subnet01br-int。

dreamborn的博客 400

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

openstack pike 使用 linuxbridge + vxlan

#openstack pike 使用 linuxbridge + vxlan #openstack pike 集群高可用 安装部署汇总http://www.cnblogs.com/elvi/p/7613861.html ############################################################ # openstack pike 使...

weixin_30783629的博客 144

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

Neutron二层网络服务实现原理

网络 ​ 网络(network)是一个隔离的二层网段,类似于物理网络世界中的虚拟 LAN (VLAN)。更具体来讲,它是为创建它的租户而保留的一个广播域,或者被显式配置为共享网段。端口和子网始终被分配给某个特定的网络。根据网络的类型,Neutron network 可以分为: VLAN network(虚拟局域网) :基于物理 VLAN 网络实现的虚拟网络。共享同一个物理网络的多个 ...

aa43795381的博客 787

11.三层网络VXLAN

先把之前基于flat模式创建的虚机,全部删除。

JCWang的博客 724

OpenStack网络的前世今生

声明: 本文转自OpenStack中国社区,原文链接:http://www.openstack.cn/p353.html,作者Joshua,转载请注明。   在OpenStack世界中,网络组件最初叫nova-network,它混迹于计算节点nova的代码库中。nova-network可以单独部署在一台机器上,为了高性能HA也可以和nova-compute一样部署在计算节点上(这也就是所...

weixin_30588675的博客 79

openstack pike linuxbridge换成openvswitch

现有网络节点的网络方案为: neutron ml2 type driver: vxlan neutron ml2 mechanism driver : linuxbridge neutron l2 agent: linux...

333
上一篇: openstack的L版本安装(flat网络)
下一篇: neutron router试验
linux内核控
博客等级 码龄19年 41粉丝 638原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值