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

相关文章

MySQL分表自动化创建的实现方案

《MySQL分表自动化创建的实现方案》在数据库应用场景中,随着数据量的不断增长,单表存储数据可能会面临性能瓶颈,例如查询、插入、更新等操作的效率会逐渐降低,分表是一种有效的优化策略,它将数据分散存储在... 目录一、项目目的二、实现过程(一)mysql 事件调度器结合存储过程方式1. 开启事件调度器2. 创

mysql外键创建不成功/失效如何处理

《mysql外键创建不成功/失效如何处理》文章介绍了在MySQL5.5.40版本中,创建带有外键约束的`stu`和`grade`表时遇到的问题,发现`grade`表的`id`字段没有随着`studen... 当前mysql版本:SELECT VERSION();结果为:5.5.40。在复习mysql外键约

java图像识别工具类(ImageRecognitionUtils)使用实例详解

《java图像识别工具类(ImageRecognitionUtils)使用实例详解》:本文主要介绍如何在Java中使用OpenCV进行图像识别,包括图像加载、预处理、分类、人脸检测和特征提取等步骤... 目录前言1. 图像识别的背景与作用2. 设计目标3. 项目依赖4. 设计与实现 ImageRecogni

Window Server创建2台服务器的故障转移群集的图文教程

《WindowServer创建2台服务器的故障转移群集的图文教程》本文主要介绍了在WindowsServer系统上创建一个包含两台成员服务器的故障转移群集,文中通过图文示例介绍的非常详细,对大家的... 目录一、 准备条件二、在ServerB安装故障转移群集三、在ServerC安装故障转移群集,操作与Ser

Window Server2016 AD域的创建的方法步骤

《WindowServer2016AD域的创建的方法步骤》本文主要介绍了WindowServer2016AD域的创建的方法步骤,文中通过图文介绍的非常详细,对大家的学习或者工作具有一定的参考学习价... 目录一、准备条件二、在ServerA服务器中常见AD域管理器:三、创建AD域,域地址为“test.ly”

Java操作ElasticSearch的实例详解

《Java操作ElasticSearch的实例详解》Elasticsearch是一个分布式的搜索和分析引擎,广泛用于全文搜索、日志分析等场景,本文将介绍如何在Java应用中使用Elastics... 目录简介环境准备1. 安装 Elasticsearch2. 添加依赖连接 Elasticsearch1. 创

使用C#代码计算数学表达式实例

《使用C#代码计算数学表达式实例》这段文字主要讲述了如何使用C#语言来计算数学表达式,该程序通过使用Dictionary保存变量,定义了运算符优先级,并实现了EvaluateExpression方法来... 目录C#代码计算数学表达式该方法很长,因此我将分段描述下面的代码片段显示了下一步以下代码显示该方法如

Python在固定文件夹批量创建固定后缀的文件(方法详解)

《Python在固定文件夹批量创建固定后缀的文件(方法详解)》文章讲述了如何使用Python批量创建后缀为.md的文件夹,生成100个,代码中需要修改的路径、前缀和后缀名,并提供了注意事项和代码示例,... 目录1. python需求的任务2. Python代码的实现3. 代码修改的位置4. 运行结果5.

使用IntelliJ IDEA创建简单的Java Web项目完整步骤

《使用IntelliJIDEA创建简单的JavaWeb项目完整步骤》:本文主要介绍如何使用IntelliJIDEA创建一个简单的JavaWeb项目,实现登录、注册和查看用户列表功能,使用Se... 目录前置准备项目功能实现步骤1. 创建项目2. 配置 Tomcat3. 项目文件结构4. 创建数据库和表5.

使用SpringBoot创建一个RESTful API的详细步骤

《使用SpringBoot创建一个RESTfulAPI的详细步骤》使用Java的SpringBoot创建RESTfulAPI可以满足多种开发场景,它提供了快速开发、易于配置、可扩展、可维护的优点,尤... 目录一、创建 Spring Boot 项目二、创建控制器类(Controller Class)三、运行