本文主要是介绍nova-network创建实例之FlatManager,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1 安装devstack,配置local.conf
FLOATING_RANGE=192.168.1.224/27
FIXED_RANGE=10.10.10.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth1
NETWORK_MANAGER=FlatManager
PUBLIC_INTERFACE=br200
VLAN_INTERFACE=eth1
FLAT_NETWORK_BRIDGE=br200ADMIN_PASSWORD=123456
MYSQL_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=azertytokenzhfLOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
2 创建br200
stack@ubuntu:~/devstack$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 08:00:27:62:e7:0cinet addr:9.186.50.180 Bcast:9.186.50.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fe62:e70c/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:20609 errors:0 dropped:0 overruns:0 frame:0TX packets:6624 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:2176837 (2.1 MB) TX bytes:2356718 (2.3 MB)eth1 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeBROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:65536 Metric:1RX packets:222020 errors:0 dropped:0 overruns:0 frame:0TX packets:222020 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:89741814 (89.7 MB) TX bytes:89741814 (89.7 MB)virbr0 Link encap:Ethernet HWaddr f6:a1:06:b2:9c:b5inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0UP BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)stack@ubuntu:~/devstack$ brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
stack@ubuntu:~/devstack$ sudo ifconfig eth1 0.0.0.0
stack@ubuntu:~/devstack$ sudo brctl addbr br200
stack@ubuntu:~/devstack$ sudo brctl addif br200 eth1
stack@ubuntu:~/devstack$ sudo ifconfig br200 10.10.10.1 netmask 255.255.255.0
stack@ubuntu:~/devstack$ ifconfig -a
br200 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:7 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:578 (578.0 B)eth0 Link encap:Ethernet HWaddr 08:00:27:62:e7:0cinet addr:9.186.50.180 Bcast:9.186.50.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fe62:e70c/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:20919 errors:0 dropped:0 overruns:0 frame:0TX packets:6752 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:2204826 (2.2 MB) TX bytes:2375728 (2.3 MB)eth1 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:15 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:1226 (1.2 KB)lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:65536 Metric:1RX packets:223045 errors:0 dropped:0 overruns:0 frame:0TX packets:223045 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:89946624 (89.9 MB) TX bytes:89946624 (89.9 MB)virbr0 Link encap:Ethernet HWaddr f6:a1:06:b2:9c:b5inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0UP BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)stack@ubuntu:~/devstack$
stack@ubuntu:~/devstack$ brctl show
bridge name bridge id STP enabled interfaces
br200 8000.080027c663ae no eth1
virbr0 8000.000000000000 yes
3 运行stack.sh,并执行. openrc admin demo
4 生成实例
stack@ubuntu:~/devstack$ nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
stack@ubuntu:~/devstack$ nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 42 | m1.nano | 64 | 0 | 0 | | 1 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
| 84 | m1.micro | 128 | 0 | 0 | | 1 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
stack@ubuntu:~/devstack$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| 7d7dbb10-d0be-4583-8ef5-4ab4a4633416 | cirros-0.3.2-x86_64-uec | ACTIVE | |
| a1b73f3d-7502-47d0-8d94-8ff3c6684124 | cirros-0.3.2-x86_64-uec-kernel | ACTIVE | |
| 10bd312b-4f7c-44fa-b447-849cf59cf885 | cirros-0.3.2-x86_64-uec-ramdisk | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+
stack@ubuntu:~/devstack$ nova keypair-list
+------+-------------+
| Name | Fingerprint |
+------+-------------+
+------+-------------+
stack@ubuntu:~/devstack$ nova keypair-add vmkey >vmkey.pem
stack@ubuntu:~/devstack$ nova keypair-list
+-------+-------------------------------------------------+
| Name | Fingerprint |
+-------+-------------------------------------------------+
| vmkey | 16:b2:f3:41:c2:18:bd:39:68:7c:6a:6c:49:6e:5a:43 |
+-------+-------------------------------------------------+
stack@ubuntu:~/devstack$ nova secgroup-list
+----+---------+-------------+
| Id | Name | Description |
+----+---------+-------------+
| 1 | default | default |
+----+---------+-------------+
stack@ubuntu:~/devstack$ nova network-list
+--------------------------------------+---------+---------------+
| ID | Label | Cidr |
+--------------------------------------+---------+---------------+
| 6307c3cc-c8c5-4577-b242-4311117b0b0e | private | 10.10.10.0/24 |
+--------------------------------------+---------+---------------+
stack@ubuntu:~/devstack$ nova network-delete private
stack@ubuntu:~/devstack$ nova network-list
+----+-------+------+
| ID | Label | Cidr |
+----+-------+------+
+----+-------+------+
stack@ubuntu:~/devstack$ nova network-create vmnet --fixed-range-v4 10.10.0.0/16 --fixed-cidr 10.10.10.0/24 --bridge br200
stack@ubuntu:~/devstack$ nova network-list
+--------------------------------------+-------+--------------+
| ID | Label | Cidr |
+--------------------------------------+-------+--------------+
| 1f22bd46-827e-419f-87a0-5982f9ff03ba | vmnet | 10.10.0.0/16 |
+--------------------------------------+-------+--------------+
stack@ubuntu:~/devstack$ ifconfig -a
br200 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:8 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:648 (648.0 B)eth0 Link encap:Ethernet HWaddr 08:00:27:62:e7:0cinet addr:9.186.50.180 Bcast:9.186.50.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fe62:e70c/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:23025 errors:0 dropped:0 overruns:0 frame:0TX packets:7135 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:2385841 (2.3 MB) TX bytes:2437446 (2.4 MB)eth1 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:16 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:1296 (1.2 KB)lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:65536 Metric:1RX packets:249766 errors:0 dropped:0 overruns:0 frame:0TX packets:249766 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:95949702 (95.9 MB) TX bytes:95949702 (95.9 MB)virbr0 Link encap:Ethernet HWaddr f6:a1:06:b2:9c:b5inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0UP BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)stack@ubuntu:~/devstack$ nova network-show vmnet
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| bridge | br200 |
| bridge_interface | eth1 |
| broadcast | 10.10.255.255 |
| cidr | 10.10.0.0/16 |
| cidr_v6 | - |
| created_at | 2015-04-14T07:10:24.000000 |
| deleted | False |
| deleted_at | - |
| dhcp_server | 10.10.0.1 |
| dhcp_start | 10.10.0.2 |
| dns1 | 8.8.4.4 |
| dns2 | - |
| enable_dhcp | True |
| gateway | 10.10.0.1 |
| gateway_v6 | - |
| host | - |
| id | 1f22bd46-827e-419f-87a0-5982f9ff03ba |
| injected | False |
| label | vmnet |
| mtu | - |
| multi_host | False |
| netmask | 255.255.0.0 |
| netmask_v6 | - |
| priority | - |
| project_id | - |
| rxtx_base | - |
| share_address | False |
| updated_at | - |
| vlan | - |
| vpn_private_address | - |
| vpn_public_address | - |
| vpn_public_port | - |
+---------------------+--------------------------------------+
stack@ubuntu:~/devstack$
stack@ubuntu:~/devstack$ nova boot --flavor 1 --image cirros-0.3.2-x86_64-uec-kernel --security-groups default --key-name vmkey cirrvm
+--------------------------------------+-----------------------------------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| 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 | qFgGo7YwXBr6 |
| config_drive | |
| created | 2015-04-14T08:25:31Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | f4991ea0-9707-4cba-a4c9-af88b51f662f |
| image | cirros-0.3.2-x86_64-uec-kernel (62083f75-e6df-4575-8b7a-75420b9a98cc) |
| key_name | vmkey |
| metadata | {} |
| name | cirrvm |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | bd1b74422d5743c882034edb3dc2813a |
| updated | 2015-04-14T08:25:32Z |
| user_id | 7a026a34c7814dc0b5697dbceef427fc |
+--------------------------------------+-----------------------------------------------------------------------+
stack@ubuntu:~/devstack$ nova list
+--------------------------------------+--------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+--------+------------+-------------+----------+
| f4991ea0-9707-4cba-a4c9-af88b51f662f | cirrvm | BUILD | - | NOSTATE | |
+--------------------------------------+--------+--------+------------+-------------+----------+
stack@ubuntu:~/devstack$ nova list
+--------------------------------------+--------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+--------+------------+-------------+--------------------+
| f4991ea0-9707-4cba-a4c9-af88b51f662f | cirrvm | BUILD | spawning | NOSTATE | private=10.10.10.2 |
+--------------------------------------+--------+--------+------------+-------------+--------------------+
stack@ubuntu:~/devstack$ nova list
+--------------------------------------+--------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+--------+------------+-------------+--------------------+
| f4991ea0-9707-4cba-a4c9-af88b51f662f | cirrvm | ACTIVE | - | Running | private=10.10.10.2 |
+--------------------------------------+--------+--------+------------+-------------+--------------------+stack@ubuntu:~/devstack$ ifconfig -a
br200 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:8 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:648 (648.0 B)eth0 Link encap:Ethernet HWaddr 08:00:27:62:e7:0cinet addr:9.186.50.180 Bcast:9.186.50.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fe62:e70c/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:23884 errors:0 dropped:0 overruns:0 frame:0TX packets:7273 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:2458315 (2.4 MB) TX bytes:2472890 (2.4 MB)eth1 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:16 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:1296 (1.2 KB)lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:65536 Metric:1RX packets:260836 errors:0 dropped:0 overruns:0 frame:0TX packets:260836 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:99330486 (99.3 MB) TX bytes:99330486 (99.3 MB)virbr0 Link encap:Ethernet HWaddr f6:a1:06:b2:9c:b5inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0UP BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)vnet0 Link encap:Ethernet HWaddr fe:16:3e:00:33:c3inet6 addr: fe80::fc16:3eff:fe00:33c3/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:500RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)stack@ubuntu:~/devstack$
stack@ubuntu:~/devstack$ brctl show
bridge name bridge id STP enabled interfaces
br200 8000.080027c663ae no eth1vnet0
virbr0 8000.000000000000 yes
stack@ubuntu:~/devstack$ nova boot --flavor 1 --image cirros-0.3.2-x86_64-uec-kernel --security-groups default --key-name vmkey cirrvm2
+--------------------------------------+-----------------------------------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | - |
| OS-EXT-SRV-ATTR:hypervisor_hostname | - |
| OS-EXT-SRV-ATTR:instance_name | instance-00000002 |
| 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 | kJmYkrE932zJ |
| config_drive | |
| created | 2015-04-14T08:32:56Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | a2b72432-0f1f-44f9-b872-e5c08c2667ad |
| image | cirros-0.3.2-x86_64-uec-kernel (62083f75-e6df-4575-8b7a-75420b9a98cc) |
| key_name | vmkey |
| metadata | {} |
| name | cirrvm2 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | bd1b74422d5743c882034edb3dc2813a |
| updated | 2015-04-14T08:32:56Z |
| user_id | 7a026a34c7814dc0b5697dbceef427fc |
+--------------------------------------+-----------------------------------------------------------------------+
stack@ubuntu:~/devstack$ nova list
+--------------------------------------+---------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+---------+--------+------------+-------------+--------------------+
| f4991ea0-9707-4cba-a4c9-af88b51f662f | cirrvm | ACTIVE | - | Running | private=10.10.10.2 |
| a2b72432-0f1f-44f9-b872-e5c08c2667ad | cirrvm2 | ACTIVE | - | Running | private=10.10.10.3 |
+--------------------------------------+---------+--------+------------+-------------+--------------------+
stack@ubuntu:~/devstack$ ifconfig -a
br200 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:8 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:648 (648.0 B)eth0 Link encap:Ethernet HWaddr 08:00:27:62:e7:0cinet addr:9.186.50.180 Bcast:9.186.50.255 Mask:255.255.255.0inet6 addr: fe80::a00:27ff:fe62:e70c/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:11872 errors:0 dropped:0 overruns:0 frame:0TX packets:7613 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:1568854 (1.5 MB) TX bytes:8413708 (8.4 MB)eth1 Link encap:Ethernet HWaddr 08:00:27:c6:63:aeinet6 addr: fe80::a00:27ff:fec6:63ae/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:16 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:1296 (1.2 KB)lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:65536 Metric:1RX packets:99416 errors:0 dropped:0 overruns:0 frame:0TX packets:99416 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:64092876 (64.0 MB) TX bytes:64092876 (64.0 MB)virbr0 Link encap:Ethernet HWaddr b6:9f:aa:11:8c:ffinet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0UP BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)vnet0 Link encap:Ethernet HWaddr fe:16:3e:58:01:c6inet6 addr: fe80::fc16:3eff:fe58:1c6/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:500RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)vnet1 Link encap:Ethernet HWaddr fe:16:3e:7f:65:10inet6 addr: fe80::fc16:3eff:fe7f:6510/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:500RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)stack@ubuntu:~/devstack$ brctl show
bridge name bridge id STP enabled interfaces
br200 8000.080027c663ae no eth1vnet0vnet1
virbr0 8000.000000000000 yes
默认情况下,会生成网络private,生成命令在stack.sh文件中:
# Create a small network
$NOVA_BIN_DIR/nova-manage --config-file $NM_CONF network create "$PRIVATE_NETWORK_NAME" $FIXED_RANGE 1 $FIXED_NETWORK_SIZE $NETWORK_CREATE_ARGS
可以让生成的instance使用此默认网络,而不用新生成网络vmnet。
生成linux网桥相当于一个网卡,设置IP后外部能访问此网桥。
5 设置vm的IP
登录http://9.186.50.180/,通过控制台进入vm,设置IP。
这篇关于nova-network创建实例之FlatManager的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!