openstack的L版本安装(flat网络)

参考[url]http://docs.openstack.org/liberty/install-guide-rdo/keystone-install.html[/url]
最终结果:
[img]http://dl2.iteye.com/upload/attachment/0115/6685/42d74449-a79d-3bfd-9403-f8e3f62e0102.png[/img]

基础:
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.126 controller
192.168.139.62 compute
#192.168.139.79 net

systemctl stop firewalld.service
systemctl disable firewalld.service

yum install mariadb mariadb-server MySQL-python -y
vim /etc/my.cnf.d/mariadb_openstack.cnf
[mysqld]
bind-address = 10.0.0.11
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'@'ocontrol' IDENTIFIED BY 'haoning';
flush privileges;

yum install rabbitmq-server -y
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
rabbitmqctl add_user openstack haoning
rabbitmqctl set_permissions openstack ".*" ".*" ".*"

yum install mongodb-server mongodb -y
vim /etc/mongod.conf
bind_ip = 192.168.139.159

systemctl enable mongod.service
systemctl start mongod.service

一下密码全都设置成haoning

----------------------------------------------------------------------
■■■■■■■■■■■■■■■■■■keystone begin■■■■■■■■■■■■■■■■■■
keystone:


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'@'ocontrol' IDENTIFIED BY 'haoning';
flush privileges;

$ openssl rand -hex 10
06a0afd32e5265a9eba8

yum install openstack-keystone httpd mod_wsgi memcached python-memcached -y

systemctl enable memcached.service
systemctl start memcached.service

修改配置文件后得到
sed -i '/^#/d' /etc/keystone/keystone.conf
sed -i '/^$/d' /etc/keystone/keystone.conf
---------------------------
/etc/keystone/keystone.conf
[DEFAULT]
admin_token = 06a0afd32e5265a9eba8
verbose = True
[assignment]
[auth]
[cache]
[catalog]
[cors]
[cors.subdomain]
[credential]
[database]
connection = mysql://keystone:haoning@ocontrol/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

-------------------------
/etc/httpd/conf/httpd.conf
ServerName ocontrol


/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


###创建服务:
export OS_TOKEN=06a0afd32e5265a9eba8
export OS_URL=http://ocontrol:35357/v3
export OS_IDENTITY_API_VERSION=3

openstack service create --name keystone --description "OpenStack Identity" identity

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

###创建用户角色等 projects, users, and roles
openstack project create --domain default --description "Admin Project" admin
openstack user create --domain default --password-prompt 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 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://ocontrol: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://ocontrol: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://ocontrol: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://ocontrol: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
openstack token issue


■■■■■■■■■■■■■■■■■■keystone end■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■glance begin■■■■■■■■■■■■■■■■■■
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'@'ocontrol' IDENTIFIED BY 'haoning';
flush privileges;

source admin-openrc.sh

openstack user create --domain default --password-prompt 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://ocontrol:9292
openstack endpoint create --region wuhan image internal http://ocontrol:9292
openstack endpoint create --region wuhan image admin http://ocontrol:9292

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

---------------------------
/etc/glance/glance-api.conf
[DEFAULT]
notification_driver = noop
verbose = True
[database]
connection = mysql://glance:haoning@ocontrol/glance
[keystone_authtoken]
auth_uri = http://ocontrol:5000
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = haoning
#Comment out or remove any other options in the [keystone_authtoken] section.
[paste_deploy]
flavor = keystone
[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
#暂时没有这个目录

------------------------------------
/etc/glance/glance-registry.conf
[DEFAULT]
notification_driver = noop
verbose = True
[database]
connection = mysql://glance:haoning@ocontrol/glance
[keystone_authtoken]
auth_uri = http://ocontrol:5000
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = haoning
[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■■■■■■■■■■■■■■■■■■
#★★★★在ocontrol节点
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'@'ocontrol' IDENTIFIED BY 'haoning';
flush privileges;

source admin-openrc.sh
openstack user create --domain default --password-prompt 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://ocontrol:8774/v2/%\(tenant_id\)s
openstack endpoint create --region wuhan compute internal http://ocontrol:8774/v2/%\(tenant_id\)s
openstack endpoint create --region wuhan compute admin http://ocontrol: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
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
################
my_ip = 192.168.139.159
################
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
#disable the EC2 API:
enabled_apis=osapi_compute,metadata
verbose = True
[database]
connection = mysql://nova:haoning@ocontrol/nova
[oslo_messaging_rabbit]
rabbit_host = ocontrol
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://ocontrol:5000
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = haoning
[vnc]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[glance]
host = ocontrol
[oslo_concurrency]
lock_path = /var/lib/nova/tmp

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

#★★★在ocompute节点
yum install openstack-nova-compute sysfsutils -y

---------------------
/etc/nova/nova.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
#################
my_ip = 192.168.139.160
##############
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
#By default, Compute uses an internal firewall service. Since Networking includes a firewall service, you must disable the Compute firewall service by using the nova.virt.firewall.NoopFirewallDriver firewall driver.
verbose = True
[oslo_messaging_rabbit]
rabbit_host = ocontrol
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://ocontrol:5000
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = haoning
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://ocontrol:6080/vnc_auto.html
[glance]
host = ocontrol
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[libvirt]
#egrep -c '(vmx|svm)' /proc/cpuinfo
#virt_type = qemu

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■■■■■■■■■■■■■■■■■■
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'@'ocontrol' IDENTIFIED BY 'haoning';
flush privileges;

openstack user create --domain default --password-prompt 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://ocontrol:9696
openstack endpoint create --region wuhan network internal http://ocontrol:9696
openstack endpoint create --region wuhan network admin http://ocontrol:9696

###★★★★★★★★Networking Option 1: Provider networks----------begin★★★★★★★★
yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset
-------------------------------
/etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins =
rpc_backend = rabbit
auth_strategy = keystone

notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://ocontrol:8774/v2

verbose = True
[database]
connection = mysql://neutron:haoning@ocontrol/neutron
[oslo_messaging_rabbit]
rabbit_host = ocontrol
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://ocontrol:5000
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = haoning
####???????????这里不一样########★★★★★★★★★★★★★★★★★
[nova]
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = wuhan
project_name = service
username = nova
password = haoning
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

----------------
/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 = public
[securitygroup]
enable_ipset = True

----------------
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
########
physical_interface_mappings = public:eth0
##########
[vxlan]
enable_vxlan = False
[agent]
prevent_arp_spoofing = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

--------------------------------
/etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True

verbose = True

###★★★★★★★★Networking Option 1: Provider networks----------end★★★★★★★★
###★★★★★Networking Option 2: Self-service networks-------begin★★★★★★★★
yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset
###★★★★★Networking Option 2: Self-service networks------end★★★★★★★★


-------------------------------?????______
/etc/neutron/metadata_agent.ini
[DEFAULT]
auth_uri = http://ocontrol:5000
auth_url = http://ocontrol:35357
auth_region = wuhan
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = haoning

nova_metadata_ip = ocontrol

#########??????########
metadata_proxy_shared_secret = METADATA_SECRET
#########????###############

verbose = True

-------------------------------
/etc/nova/nova.conf
[neutron]
url = http://ocontrol:9696
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = wuhan
project_name = service
username = neutron
password = haoning

service_metadata_proxy = True
#########没关系不报错,先这么写########
metadata_proxy_shared_secret = METADATA_SECRET
#################

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 start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service 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


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


systemctl start neutron-server.service
systemctl start neutron-linuxbridge-agent.service
systemctl start neutron-dhcp-agent.service
systemctl stop neutron-metadata-agent.service


★★★★★★★★★★★★★★★compute 节点★☆★★★★★★★★★★★★★
yum install openstack-neutron openstack-neutron-linuxbridge ebtables ipset -y
-------------------------------------
/etc/neutron/neutron.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
verbose = True

[oslo_messaging_rabbit]
rabbit_host = ocontrol
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://ocontrol:5000
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = haoning

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

###★★★★★Networking Option 1: Provider networks-------begin★★★★★★★★
----------------------------
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:eth0
#the name of the underlying physical public network interface.
[vxlan]
enable_vxlan = False
[agent]
prevent_arp_spoofing = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver


#可以比较一下,是一样的
vimdiff scp://root@192.168.139.159//etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini

###★★★★★Networking Option 1: Provider networks------end★★★★★★★★
###★★★★★Networking Option 2: Self-service networks-------begin★★★★★★★★

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


-------------------------------
/etc/nova/nova.conf
[neutron]
url = http://ocontrol:9696
auth_url = http://ocontrol:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = wuhan
project_name = service
username = neutron
password = haoning

systemctl restart openstack-nova-compute.service

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


###Verify operation

# 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 |
+-----------------------+--------------------------+

###★★★★★Networking Option 1: Provider networks------begin★★★★★★★★
neutron agent-list
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| id | agent_type | host | alive | admin_state_up | binary |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| 1f7dd1e9-ef38-471e-a486-43e6c7c1c854 | Metadata agent | ocontrol | :-) | True | neutron-metadata-agent |
| a14b5ccc-60e0-4a85-9ce9-10ba6cb6a82e | Linux bridge agent | ocontrol | :-) | True | neutron-linuxbridge-agent |
| ba07f36d-ec0e-4a98-959f-72eabbdca0cc | Linux bridge agent | ocompute | :-) | True | neutron-linuxbridge-agent |
| bc7c2622-0887-4504-8928-dd12be23371a | DHCP agent | ocontrol | :-) | True | neutron-dhcp-agent |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+

#新建个vm

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

-----------------------------------
/etc/neutron/plugins/ml2/ml2_conf.ini
[ml2_type_flat]
flat_networks = public
------------------------------
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:eth0

#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.181,end=192.168.139.200 --dns-nameserver 8.8.4.4 --gateway 192.168.128.1
Created a new subnet:
+-------------------+--------------------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------------------+
| allocation_pools | {"start": "192.168.139.181", "end": "192.168.139.200"} |
| cidr | 192.168.128.0/20 |
| dns_nameservers | 8.8.4.4 |
| enable_dhcp | True |
| gateway_ip | 192.168.128.1 |
| host_routes | |
| id | fb2ec451-b2f6-4407-865e-5c4e657e9d59 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | public |
| network_id | 386b0ac1-3cdf-4be7-94c7-b52e6b46063e |
| subnetpool_id | |
| tenant_id | 261db0ad41984bd1b113e19c92aa4174 |
+-------------------+--------------------------------------------------------+

source admin-openrc.sh
#demo的不好使
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

nova flavor-list
nova image-list
# neutron net-list
+--------------------------------------+--------+-------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+--------+-------------------------------------------------------+
| 386b0ac1-3cdf-4be7-94c7-b52e6b46063e | public | fb2ec451-b2f6-4407-865e-5c4e657e9d59 192.168.128.0/20 |
+--------------------------------------+--------+-------------------------------------------------------+

#Replace PUBLIC_NET_ID with the ID of the public provider network
#nova boot --flavor m1.tiny --image cirros --nic net-id=PUBLIC_NET_ID --security-group default --key-name mykey public-instance
nova boot --flavor m1.tiny --image cirros --nic net-id=386b0ac1-3cdf-4be7-94c7-b52e6b46063e --security-group default --key-name mykey public-instance
+--------------------------------------+-----------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | |
| OS-EXT-SRV-ATTR:host | - |
| OS-EXT-SRV-ATTR:hypervisor_hostname | - |
| OS-EXT-SRV-ATTR:instance_name | instance-00000001 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | JgCpGqbkPpA3 |
| config_drive | |
| created | 2016-03-09T13:47:48Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | ea7129c7-18e1-44bf-a17b-ef8a167a8b4b |
| image | cirros (10e9295e-aa88-4cc5-a91e-11ccf0cc5764) |
| key_name | mykey |
| metadata | {} |
| name | public-instance |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | 261db0ad41984bd1b113e19c92aa4174 |
| updated | 2016-03-09T13:47:48Z |
| user_id | 606788646f2b474a9157c7c86c91faab |
+--------------------------------------+-----------------------------------------------+

nova list
+--------------------------------------+-----------------+--------+------------+-------------+------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-----------------+--------+------------+-------------+------------------------+
| ea7129c7-18e1-44bf-a17b-ef8a167a8b4b | public-instance | ACTIVE | - | Running | public=192.168.139.182 |
+--------------------------------------+-----------------+--------+------------+-------------+------------------------+

# nova get-vnc-console public-instance novnc
+-------+-------------------------------------------------------------------------------+
| Type | Url |
+-------+-------------------------------------------------------------------------------+
| novnc | http://ocontrol:6080/vnc_auto.html?token=ec2013e8-7cad-458e-82dd-ae4153f2190c |
+-------+-------------------------------------------------------------------------------+

#ping 网关
#ping 192.168.128.1
#ping www.baidu.com

ssh cirros@192.168.139.182

###★★★★★Networking Option 1: Provider networks------end★★★★★★★★
###★★★★★Networking Option 2: Self-service networks-------begin★★★★★★★★

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


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


■■■■■■■■■■■■■■■■■■horizon end■■■■■■■■■■■■■■■■■■
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值