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

相关文章

【Python编程】Linux创建虚拟环境并配置与notebook相连接

1.创建 使用 venv 创建虚拟环境。例如,在当前目录下创建一个名为 myenv 的虚拟环境: python3 -m venv myenv 2.激活 激活虚拟环境使其成为当前终端会话的活动环境。运行: source myenv/bin/activate 3.与notebook连接 在虚拟环境中,使用 pip 安装 Jupyter 和 ipykernel: pip instal

poj 2349 Arctic Network uva 10369(prim or kruscal最小生成树)

题目很麻烦,因为不熟悉最小生成树的算法调试了好久。 感觉网上的题目解释都没说得很清楚,不适合新手。自己写一个。 题意:给你点的坐标,然后两点间可以有两种方式来通信:第一种是卫星通信,第二种是无线电通信。 卫星通信:任何两个有卫星频道的点间都可以直接建立连接,与点间的距离无关; 无线电通信:两个点之间的距离不能超过D,无线电收发器的功率越大,D越大,越昂贵。 计算无线电收发器D

【机器学习】高斯过程的基本概念和应用领域以及在python中的实例

引言 高斯过程(Gaussian Process,简称GP)是一种概率模型,用于描述一组随机变量的联合概率分布,其中任何一个有限维度的子集都具有高斯分布 文章目录 引言一、高斯过程1.1 基本定义1.1.1 随机过程1.1.2 高斯分布 1.2 高斯过程的特性1.2.1 联合高斯性1.2.2 均值函数1.2.3 协方差函数(或核函数) 1.3 核函数1.4 高斯过程回归(Gauss

在cscode中通过maven创建java项目

在cscode中创建java项目 可以通过博客完成maven的导入 建立maven项目 使用快捷键 Ctrl + Shift + P 建立一个 Maven 项目 1 Ctrl + Shift + P 打开输入框2 输入 "> java create"3 选择 maven4 选择 No Archetype5 输入 域名6 输入项目名称7 建立一个文件目录存放项目,文件名一般为项目名8 确定

Java 创建图形用户界面(GUI)入门指南(Swing库 JFrame 类)概述

概述 基本概念 Java Swing 的架构 Java Swing 是一个为 Java 设计的 GUI 工具包,是 JAVA 基础类的一部分,基于 Java AWT 构建,提供了一系列轻量级、可定制的图形用户界面(GUI)组件。 与 AWT 相比,Swing 提供了许多比 AWT 更好的屏幕显示元素,更加灵活和可定制,具有更好的跨平台性能。 组件和容器 Java Swing 提供了许多

顺序表之创建,判满,插入,输出

文章目录 🍊自我介绍🍊创建一个空的顺序表,为结构体在堆区分配空间🍊插入数据🍊输出数据🍊判断顺序表是否满了,满了返回值1,否则返回0🍊main函数 你的点赞评论就是对博主最大的鼓励 当然喜欢的小伙伴可以:点赞+关注+评论+收藏(一键四连)哦~ 🍊自我介绍   Hello,大家好,我是小珑也要变强(也是小珑),我是易编程·终身成长社群的一名“创始团队·嘉宾”

C++操作符重载实例(独立函数)

C++操作符重载实例,我们把坐标值CVector的加法进行重载,计算c3=c1+c2时,也就是计算x3=x1+x2,y3=y1+y2,今天我们以独立函数的方式重载操作符+(加号),以下是C++代码: c1802.cpp源代码: D:\YcjWork\CppTour>vim c1802.cpp #include <iostream>using namespace std;/*** 以独立函数

实例:如何统计当前主机的连接状态和连接数

统计当前主机的连接状态和连接数 在 Linux 中,可使用 ss 命令来查看主机的网络连接状态。以下是统计当前主机连接状态和连接主机数量的具体操作。 1. 统计当前主机的连接状态 使用 ss 命令结合 grep、cut、sort 和 uniq 命令来统计当前主机的 TCP 连接状态。 ss -nta | grep -v '^State' | cut -d " " -f 1 | sort |

Maven创建项目中的groupId, artifactId, 和 version的意思

文章目录 groupIdartifactIdversionname groupId 定义:groupId 是 Maven 项目坐标的第一个部分,它通常表示项目的组织或公司的域名反转写法。例如,如果你为公司 example.com 开发软件,groupId 可能是 com.example。作用:groupId 被用来组织和分组相关的 Maven artifacts,这样可以避免

批处理以当前时间为文件名创建文件

批处理以当前时间为文件名创建文件 批处理创建空文件 有时候,需要创建以当前时间命名的文件,手动输入当然可以,但是有更省心的方法吗? 假设我是 windows 操作系统,打开命令行。 输入以下命令试试: echo %date:~0,4%_%date:~5,2%_%date:~8,2%_%time:~0,2%_%time:~3,2%_%time:~6,2% 输出类似: 2019_06