nova-network创建实例之FlatManager

2024-06-20 19:58

本文主要是介绍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的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1079104

相关文章

C# WinForms存储过程操作数据库的实例讲解

《C#WinForms存储过程操作数据库的实例讲解》:本文主要介绍C#WinForms存储过程操作数据库的实例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、存储过程基础二、C# 调用流程1. 数据库连接配置2. 执行存储过程(增删改)3. 查询数据三、事务处

springboot security验证码的登录实例

《springbootsecurity验证码的登录实例》:本文主要介绍springbootsecurity验证码的登录实例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录前言代码示例引入依赖定义验证码生成器定义获取验证码及认证接口测试获取验证码登录总结前言在spring

idea中创建新类时自动添加注释的实现

《idea中创建新类时自动添加注释的实现》在每次使用idea创建一个新类时,过了一段时间发现看不懂这个类是用来干嘛的,为了解决这个问题,我们可以设置在创建一个新类时自动添加注释,帮助我们理解这个类的用... 目录前言:详细操作:步骤一:点击上方的 文件(File),点击&nbmyHIgsp;设置(Setti

tomcat多实例部署的项目实践

《tomcat多实例部署的项目实践》Tomcat多实例是指在一台设备上运行多个Tomcat服务,这些Tomcat相互独立,本文主要介绍了tomcat多实例部署的项目实践,具有一定的参考价值,感兴趣的可... 目录1.创建项目目录,测试文China编程件2js.创建实例的安装目录3.准备实例的配置文件4.编辑实例的

python+opencv处理颜色之将目标颜色转换实例代码

《python+opencv处理颜色之将目标颜色转换实例代码》OpenCV是一个的跨平台计算机视觉库,可以运行在Linux、Windows和MacOS操作系统上,:本文主要介绍python+ope... 目录下面是代码+ 效果 + 解释转HSV: 关于颜色总是要转HSV的掩膜再标注总结 目标:将红色的部分滤

Spring 中使用反射创建 Bean 实例的几种方式

《Spring中使用反射创建Bean实例的几种方式》文章介绍了在Spring框架中如何使用反射来创建Bean实例,包括使用Class.newInstance()、Constructor.newI... 目录1. 使用 Class.newInstance() (仅限无参构造函数):2. 使用 Construc

C#原型模式之如何通过克隆对象来优化创建过程

《C#原型模式之如何通过克隆对象来优化创建过程》原型模式是一种创建型设计模式,通过克隆现有对象来创建新对象,避免重复的创建成本和复杂的初始化过程,它适用于对象创建过程复杂、需要大量相似对象或避免重复初... 目录什么是原型模式?原型模式的工作原理C#中如何实现原型模式?1. 定义原型接口2. 实现原型接口3

MyBatis-Plus中Service接口的lambdaUpdate用法及实例分析

《MyBatis-Plus中Service接口的lambdaUpdate用法及实例分析》本文将详细讲解MyBatis-Plus中的lambdaUpdate用法,并提供丰富的案例来帮助读者更好地理解和应... 目录深入探索MyBATis-Plus中Service接口的lambdaUpdate用法及示例案例背景

MyBatis-Plus中静态工具Db的多种用法及实例分析

《MyBatis-Plus中静态工具Db的多种用法及实例分析》本文将详细讲解MyBatis-Plus中静态工具Db的各种用法,并结合具体案例进行演示和说明,具有很好的参考价值,希望对大家有所帮助,如有... 目录MyBATis-Plus中静态工具Db的多种用法及实例案例背景使用静态工具Db进行数据库操作插入

Python中conda虚拟环境创建及使用小结

《Python中conda虚拟环境创建及使用小结》本文主要介绍了Python中conda虚拟环境创建及使用小结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录0.前言1.Miniconda安装2.conda本地基本操作3.创建conda虚拟环境4.激活c