Controller Node:
1. sudo vi /etc/nova/nova.conf
[DEFAULT]
...
network_api_class = nova.network.api.API
security_group_api = nova
2. sudo service nova-api restart && sudo service nova-scheduler restart && sudo service nova-conductor restart
Compute Node:
1. sudo apt-get install nova-network nova-api-metadata
2. sudo vi /etc/nova/nova.conf
[DEFAULT]
...
network_api_class = nova.network.api.API
security_group_api = nova
firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
network_manager = nova.network.manager.FlatDHCPManager
network_size = 254
allow_same_net_traffic = False
multi_host = True
flat_injected = False
send_arp_for_ha = True
share_dhcp_address = True
force_dhcp_release = True
flat_network_bridge = br100
flat_interface = eth1
public_interface = eth0
3.
sudo service nova-network restart
sudo service nova-api-metadata restart
Create initial network (Controller Node):
1. source admin-openrc.sh
2. 为实例创建可以被分配的IP Pool
nova network-create demo-net --bridge br100 --multi-host T --fixed-range-v4 172.52.17.0/24
3. 生成net-id供第十四步中使用
nova net-list
4. 创建Floating IP以使外部网络可以访问到实例
sudo nova-manage floating create --pool nova --ip_range 192.168.0.0/24
sudo nova-manage floating list