在本文中我将重点记录一下成功安装Openstack Folsom 版本中,最简单的网络模式(Single Flat Network)的安装方法:
# Network settings network_api_class=nova.network.quantumv2.api.API quantum_url=http://100.1.1.2:9696 quantum_auth_strategy=keystone quantum_admin_tenant_name=admin quantum_admin_username=admin quantum_admin_password=password quantum_admin_auth_url=http://100.1.1.2:35357/v2.0 libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
/etc/quantum/api-paste:
[filter:authtoken] paste.filter_factory = keystone.middleware.auth_token:filter_factory auth_host = 100.1.1.2 auth_port = 35357 auth_protocol = http admin_tenant_name = admin admin_user = admin admin_password = password
/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini
#4.single Flat Network [DATABASE] sql_connection = mysql://root:[email protected]:3306/quantum_single?charset=utf8 [OVS] network_vlan_ranges = physnet1 bridge_mappings = physnet1:br-eth1 #连接到管理网络
Compute与Network 网络配置:
sudo ovs-vsctl list-br
#如果已有相关网络,应该先删除
#sudo ovs-vsctl del-br br-eth0
sudo ovs-vsctl add br-int sudo ovs-vsctl add-br br-eth0 sudo ovs-vsctl add-port br-eth0 eth0
下面在的命令在网络节点上执行(必要时安装python-novaclient并配置novarc环境):
quantum net-create --tenant-id c7fb80d964a24ab1bc0fd370696c804e sharednet1 --shared --provider:network_type flat --provider:physical_network physnet1
记下sharednet1 id: 5195d3c1-0d63-4e55-ac9b-87faf5164389
quantum subnet-create --tenant-id c7fb80d964a24ab1bc0fd370696c804e sharednet1 30.0.0.0/24
记下子网的network_id : 5195d3c1-0d63-4e55-ac9b-87faf5164389
nova boot --image f65ed980-7921-42fe-a944-805cf8ea42d4 --flavor 2 --nic net-id=5195d3c1-0d63-4e55-ac9b-87faf5164389 admin_VM1
sudo ip addr flush eth0 sudo ip addr add 30.0.0.201/24 dev br-eth0 ping 30.0.0.3
也可以自己的管理网络上配置30.0.0.0段的地址,即可直接连接虚拟机.