安装 Quantum openvswitch agent, l3 agent 和 dhcp agent:
apt-get install quantum-plugin-openvswitch-agent quantum-dhcp-agent quantum-l3-agent更改 /etc/quantum/quantum.conf:
[DEFAULT] debug = True verbose = True state_path = /var/lib/quantum lock_path = $state_path/lock bind_host = 0.0.0.0 bind_port = 9696 core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2 api_paste_config = /etc/quantum/api-paste.ini control_exchange = quantum rabbit_host = 172.16.0.51 rabbit_password = guest rabbit_port = 5672 rabbit_userid = guest notification_driver = quantum.openstack.common.notifier.rpc_notifier default_notification_level = INFO notification_topics = notifications [QUOTAS] [DEFAULT_SERVICETYPE] [AGENT] root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf [keystone_authtoken] auth_host = 172.16.0.51 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = quantum admin_password = password signing_dir = /var/lib/quantum/keystone-signing编辑 OVS 插件配置文件 /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini:
[DATABASE] sql_connection = mysql://quantum:quantum@172.16.0.51/quantum reconnect_interval = 2 [OVS] enable_tunneling = True tenant_network_type = gre tunnel_id_ranges = 1:1000 local_ip = 10.10.10.52 integration_bridge = br-int tunnel_bridge = br-tun [AGENT] polling_interval = 2 [SECURITYGROUP]编辑 /etc/quantum/l3_agent.ini:
[DEFAULT] debug = True verbose = True use_namespaces = True external_network_bridge = br-ex signing_dir = /var/cache/quantum admin_tenant_name = service admin_user = quantum admin_password = password auth_url = :35357/v2.0 l3_agent_manager = quantum.agent.l3_agent.L3NATAgentWithStateReport root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver编辑 /etc/quantum/dhcp_agent.ini:
[DEFAULT] debug = True verbose = True use_namespaces = True signing_dir = /var/cache/quantum admin_tenant_name = service admin_user = quantum admin_password = password auth_url = :35357/v2.0 dhcp_agent_manager = quantum.agent.dhcp_agent.DhcpAgentWithStateReport root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf state_path = /var/lib/quantum interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver dhcp_driver = quantum.agent.linux.dhcp.Dnsmasq编辑 /etc/quantum/metadata_agent.ini:
[DEFAULT] debug = True auth_url = :35357/v2.0 auth_region = RegionOne admin_tenant_name = service admin_user = quantum admin_password = password state_path = /var/lib/quantum nova_metadata_ip = 172.16.0.51 nova_metadata_port = 8775启动 quantum 所有服务:
service quantum-plugin-openvswitch-agent restart service quantum-dhcp-agent restart service quantum-l3-agent restart service quantum-metadata-agent restart 计算节点 网络设置 cat /etc/network/interfaces auto eth0 iface eth0 inet static address 172.16.0.53 netmask 255.255.0.0 auto eth1 iface eth1 inet static address 10.10.10.53 netmask 255.255.255.0* 因为没有内网 apt 源,所以临时设置个虚拟网卡来 apt-get:
ifconfig eth0:0 192.168.8.53/24 up route add default gw 192.168.8.1 dev eth0:0 echo 'nameserver 8.8.8.8' >> /etc/resolv.conf 添加源添加 Grizzly 源,并升级系统:
echo 'deb Ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main' > /etc/apt/sources.list.d/grizzly.list apt-get update apt-get upgrade apt-get install ubuntu-cloud-keyring设置 ntp 和开启路由转发:
# apt-get install ntp # sed -i 's/server ntp.ubuntu.com/server 172.16.0.51/g' /etc/ntp.conf # service ntp restart # vim /etc/sysctl.conf net.ipv4.ip_forward=1 # sysctl -p OpenVSwitch安装 openVSwitch:
apt-get install openvswitch-switch openvswitch-brcompat设置 ovs-brcompatd 启动:
sed -i 's/# BRCOMPAT=no/BRCOMPAT=yes/g' /etc/default/openvswitch-switch echo 'brcompat' >> /etc/module启动 openvswitch-switch:
/etc/init.d/openvswitch-switch restart * ovs-brcompatd is not running # brcompatd 没有启动,尝试再次启动. * ovs-vswitchd is not running * ovsdb-server is not running * Inserting openvswitch module * /etc/openvswitch/conf.db does not exist * Creating empty database /etc/openvswitch/conf.db * Starting ovsdb-server * Configuring Open vSwitch system IDs * Starting ovs-vswitchd * Enabling gre with iptables再次启动,直到 ovs-brcompatd、ovs-vswitchd、ovsdb-server等服务都启动:
# /etc/init.d/openvswitch-switch restart # lsmod | grep brcompat brcompat 13512 0 openvswitch 84038 7 brcompat如果还是启动不了 brcompat,执行下面命令:
/etc/init.d/openvswitch-switch force-reload-kmod创建 br-int 网桥:
ovs-vsctl add-br br-int