Skip to content

Instantly share code, notes, and snippets.

@hoonetorg
Created August 27, 2016 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoonetorg/73a3f254737dc0d965a0cc48b26d6582 to your computer and use it in GitHub Desktop.
Save hoonetorg/73a3f254737dc0d965a0cc48b26d6582 to your computer and use it in GitHub Desktop.
######### !!!!!!!!!! with bridge_mappings
[root@os1 ~]# cat /etc/neutron/plugins/ml2/linuxbridge_agent.ini |grep mapping
# mapping physical network names to the agent's node-specific physical network
# listed in network_vlan_ranges on the server should have mappings to
#physical_interface_mappings = provider:bond0.2
#bridge_mappings =
bridge_mappings = provider:brextern
[root@os1 ~]# neutron agent-list
+--------------------------------------+--------------------+--------------------+-------------------+-------+----------------+---------------------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+--------------------------------------+--------------------+--------------------+-------------------+-------+----------------+---------------------------+
| 0f8d60df-a66d-471e-90f6-e0dd2ea63fa8 | L3 agent | os3.os.example.org | nova | :-) | True | neutron-l3-agent |
| 39a5e322-ad63-4063-9cae-9742e9a6640b | DHCP agent | os2.os.example.org | nova | :-) | True | neutron-dhcp-agent |
| 3adf87f2-55c0-46e0-8d5a-e7aaae630882 | Linux bridge agent | os4.os.example.org | | :-) | True | neutron-linuxbridge-agent |
| 4108902f-e17d-4da3-a6ec-52ffe4014510 | L3 agent | os2.os.example.org | nova | :-) | True | neutron-l3-agent |
| 438a5b66-3bd0-4fc5-a6b1-378a237ba05a | Metadata agent | os3.os.example.org | | :-) | True | neutron-metadata-agent |
| 55d005be-7c96-4925-b65f-c2245fe36d0b | Linux bridge agent | os1.os.example.org | | :-) | True | neutron-linuxbridge-agent |
| 68bc28e7-53c5-455c-a856-254c559085eb | Metadata agent | os2.os.example.org | | :-) | True | neutron-metadata-agent |
| 6dc464c3-ae95-4952-b4d1-2e00a77d6a27 | DHCP agent | os1.os.example.org | nova | :-) | True | neutron-dhcp-agent |
| 8340796b-60f1-45f5-9277-632a69949e2c | Linux bridge agent | os2.os.example.org | | :-) | True | neutron-linuxbridge-agent |
| 8bcdc710-9f37-4029-ab5d-0d90eadc4b92 | L3 agent | os1.os.example.org | nova | :-) | True | neutron-l3-agent |
| 8c642a23-90d3-482a-aaf8-8ca896419c90 | Metadata agent | os1.os.example.org | | :-) | True | neutron-metadata-agent |
| 8f9acb0c-a379-4bbb-b65f-74437ec73bed | Linux bridge agent | os3.os.example.org | | :-) | True | neutron-linuxbridge-agent |
| 95a7337b-455f-4ba4-85dc-010697be6796 | DHCP agent | os3.os.example.org | nova | :-) | True | neutron-dhcp-agent |
+--------------------------------------+--------------------+--------------------+-------------------+-------+----------------+---------------------------+
[root@os1 ~]# neutron ext-list
+---------------------------+-----------------------------------------------+
| alias | name |
+---------------------------+-----------------------------------------------+
| default-subnetpools | Default Subnetpools |
| network-ip-availability | Network IP Availability |
| network_availability_zone | Network Availability Zone |
| auto-allocated-topology | Auto Allocated Topology Services |
| ext-gw-mode | Neutron L3 Configurable external gateway mode |
| binding | Port Binding |
| agent | agent |
| subnet_allocation | Subnet Allocation |
| l3_agent_scheduler | L3 Agent Scheduler |
| tag | Tag support |
| external-net | Neutron external network |
| net-mtu | Network MTU |
| availability_zone | Availability Zone |
| quotas | Quota management support |
| l3-ha | HA Router extension |
| provider | Provider Network |
| multi-provider | Multi Provider Network |
| address-scope | Address scope |
| extraroute | Neutron Extra Route |
| timestamp_core | Time Stamp Fields addition for core resources |
| router | Neutron L3 Router |
| extra_dhcp_opt | Neutron Extra DHCP opts |
| dns-integration | DNS Integration |
| security-group | security-group |
| dhcp_agent_scheduler | DHCP Agent Scheduler |
| router_availability_zone | Router Availability Zone |
| rbac-policies | RBAC Policies |
| standard-attr-description | standard-attr-description |
| port-security | Port Security |
| allowed-address-pairs | Allowed Address Pairs |
| dvr | Distributed Virtual Router |
+---------------------------+-----------------------------------------------+
[root@os1 ~]# neutron net-create --shared --provider:physical_network provider --provider:network_type flat provider
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2016-08-25T22:34:33 |
| description | |
| id | a6d728dd-e5ef-4377-b8e3-4ee57b671fec |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1500 |
| name | provider |
| port_security_enabled | True |
| provider:network_type | flat |
| provider:physical_network | provider |
| provider:segmentation_id | |
| router:external | False |
| shared | True |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 6b79b205449c4510ab7b450aaa0eca9d |
| updated_at | 2016-08-25T22:34:33 |
+---------------------------+--------------------------------------+
[root@os1 ~]# neutron subnet-create --name provider --allocation-pool start=192.168.236.11,end=192.168.236.39 --dns-nameserver 8.8.4.4 --gateway 192.168.236.254 provider 192.168.236.0/24
Created a new subnet:
+-------------------+------------------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------------------+
| allocation_pools | {"start": "192.168.236.11", "end": "192.168.236.39"} |
| cidr | 192.168.236.0/24 |
| created_at | 2016-08-25T22:35:10 |
| description | |
| dns_nameservers | 8.8.4.4 |
| enable_dhcp | True |
| gateway_ip | 192.168.236.254 |
| host_routes | |
| id | f9f289eb-b890-4b3e-9659-fb41bb48a4df |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | provider |
| network_id | a6d728dd-e5ef-4377-b8e3-4ee57b671fec |
| subnetpool_id | |
| tenant_id | 6b79b205449c4510ab7b450aaa0eca9d |
| updated_at | 2016-08-25T22:35:10 |
+-------------------+------------------------------------------------------+
[root@os1 ~]# openstack server create --nic net-id=a6d728dd-e5ef-4377-b8e3-4ee57b671fec --security-group default --flavor m1.tiny --image "Cirros 0.3.4" providervm
+--------------------------------------+-----------------------------------------------------+
| Field | Value |
+--------------------------------------+-----------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000024 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | None |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| adminPass | blubblub |
| config_drive | |
| created | 2016-08-25T22:36:24Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | ffd5fbe0-e008-4ea0-ae82-ed4488894258 |
| image | Cirros 0.3.4 (3c98d640-66fe-4c8a-8d46-63d42b056c18) |
| key_name | None |
| name | providervm |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| project_id | 6b79b205449c4510ab7b450aaa0eca9d |
| properties | |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| updated | 2016-08-25T22:36:24Z |
| user_id | 01287aff03034568a7fd6cb809d44d9e |
+--------------------------------------+-----------------------------------------------------+
[root@os1 ~]#
You have new mail in /var/spool/mail/root
[root@os1 ~]# brctl show
bridge name bridge id STP enabled interfaces
brextern 8000.3e25bc172ffe no bond0.2
tap3ad35652-44
brosclu 8000.80ee73976bfd no bond0.33
brosman 8000.80ee73976bfd no bond0
brosmon 8000.80ee73976bfd no bond0.34
brososd 8000.80ee73976bfd no bond0.35
brostun 8000.80ee73976bfd no bond0.32
You have new mail in /var/spool/mail/root
[root@os1 ~]# ip netns
qdhcp-a6d728dd-e5ef-4377-b8e3-4ee57b671fec (id: 0)
[root@os1 ~]# ip netns exec qdhcp-a6d728dd-e5ef-4377-b8e3-4ee57b671fec ip a l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ns-3ad35652-44@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether fa:16:3e:60:00:84 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.236.12/24 brd 192.168.236.255 scope global ns-3ad35652-44
valid_lft forever preferred_lft forever
inet 169.254.169.254/16 brd 169.254.255.255 scope global ns-3ad35652-44
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fe60:84/64 scope link
valid_lft forever preferred_lft forever
[root@os1 ~]# ip netns exec qdhcp-a6d728dd-e5ef-4377-b8e3-4ee57b671fec ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ns-3ad35652-44@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether fa:16:3e:60:00:84 brd ff:ff:ff:ff:ff:ff link-netnsid 0
[root@os1 ~]#
[root@os1 ~]# openstack server list
+--------------------------------------+------------+--------+-------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+------------+--------+-------------------------+
| ffd5fbe0-e008-4ea0-ae82-ed4488894258 | providervm | ACTIVE | provider=192.168.236.14 |
+--------------------------------------+------------+--------+-------------------------+
[root@os1 ~]# ping 192.168.236.14
PING 192.168.236.14 (192.168.236.14) 56(84) bytes of data.
^C
--- 192.168.236.14 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
[root@os1 ~]# openstack server show providervm
+--------------------------------------+----------------------------------------------------------+
| Field | Value |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | os4.os.example.org |
| OS-EXT-SRV-ATTR:hypervisor_hostname | os4.os.example.org |
| OS-EXT-SRV-ATTR:instance_name | instance-00000024 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2016-08-25T22:36:33.000000 |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | provider=192.168.236.14 |
| config_drive | |
| created | 2016-08-25T22:36:24Z |
| flavor | m1.tiny (1) |
| hostId | bcc8f4129037523e97e580543a3d4dd8e906792f3b7058df5fc5fefc |
| id | ffd5fbe0-e008-4ea0-ae82-ed4488894258 |
| image | Cirros 0.3.4 (3c98d640-66fe-4c8a-8d46-63d42b056c18) |
| key_name | None |
| name | providervm |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| project_id | 6b79b205449c4510ab7b450aaa0eca9d |
| properties | |
| security_groups | [{u'name': u'default'}] |
| status | ACTIVE |
| updated | 2016-08-25T22:36:33Z |
| user_id | 01287aff03034568a7fd6cb809d44d9e |
+--------------------------------------+----------------------------------------------------------+
######## on compute node where providervm runs
[root@os4 ~]# brctl show
bridge name bridge id STP enabled interfaces
brextern 8000.80ee73976c45 no bond0.2
brosclu 8000.80ee73976c45 no bond0.33
brosman 8000.80ee73976c45 no bond0
brosmon 8000.80ee73976c45 no bond0.34
brososd 8000.80ee73976c45 no bond0.35
brostun 8000.80ee73976c45 no bond0.32
brqa6d728dd-e5 8000.fe163eea8455 no tap3971e182-5e
[root@os4 ~]# virsh dumpxml instance-00000024
<domain type='kvm' id='6'>
<name>instance-00000024</name>
<uuid>ffd5fbe0-e008-4ea0-ae82-ed4488894258</uuid>
<metadata>
<nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
<nova:package version="13.1.0-1.el7"/>
<nova:name>providervm</nova:name>
<nova:creationTime>2016-08-25 22:36:28</nova:creationTime>
<nova:flavor name="m1.tiny">
<nova:memory>512</nova:memory>
<nova:disk>1</nova:disk>
<nova:swap>0</nova:swap>
<nova:ephemeral>0</nova:ephemeral>
<nova:vcpus>1</nova:vcpus>
</nova:flavor>
<nova:owner>
<nova:user uuid="01287aff03034568a7fd6cb809d44d9e">admin</nova:user>
<nova:project uuid="6b79b205449c4510ab7b450aaa0eca9d">admin</nova:project>
</nova:owner>
<nova:root type="image" uuid="3c98d640-66fe-4c8a-8d46-63d42b056c18"/>
</nova:instance>
</metadata>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static'>1</vcpu>
<cputune>
<shares>1024</shares>
</cputune>
<resource>
<partition>/machine</partition>
</resource>
<sysinfo type='smbios'>
<system>
<entry name='manufacturer'>Fedora Project</entry>
<entry name='product'>OpenStack Nova</entry>
<entry name='version'>13.1.0-1.el7</entry>
<entry name='serial'>b60db9ab-1d1e-4805-bfba-f6b838e23983</entry>
<entry name='uuid'>ffd5fbe0-e008-4ea0-ae82-ed4488894258</entry>
<entry name='family'>Virtual Machine</entry>
</system>
</sysinfo>
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.2.0'>hvm</type>
<boot dev='hd'/>
<smbios mode='sysinfo'/>
</os>
<features>
<acpi/>
<apic/>
</features>
<cpu mode='host-passthrough'>
<topology sockets='1' cores='1' threads='1'/>
</cpu>
<clock offset='utc'>
<timer name='pit' tickpolicy='delay'/>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='network' device='disk'>
<driver name='qemu' type='raw' cache='writeback' discard='unmap'/>
<auth username='cinder'>
<secret type='ceph' uuid='2e4e3d73-52ee-42d1-b776-efcbb58cd423'/>
</auth>
<source protocol='rbd' name='vms/ffd5fbe0-e008-4ea0-ae82-ed4488894258_disk'>
<host name='192.168.234.111' port='6789'/>
<host name='192.168.234.112' port='6789'/>
<host name='192.168.234.113' port='6789'/>
</source>
<backingStore/>
<target dev='sda' bus='scsi'/>
<alias name='scsi0-0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='virtio-scsi'>
<alias name='scsi0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</controller>
<controller type='usb' index='0'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='virtio-serial' index='0'>
<alias name='virtio-serial0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<interface type='bridge'>
<mac address='fa:16:3e:ea:84:55'/>
<source bridge='brqa6d728dd-e5'/>
<target dev='tap3971e182-5e'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='file'>
<source path='/var/lib/nova/instances/ffd5fbe0-e008-4ea0-ae82-ed4488894258/console.log'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<serial type='pty'>
<source path='/dev/pts/1'/>
<target port='1'/>
<alias name='serial1'/>
</serial>
<console type='file'>
<source path='/var/lib/nova/instances/ffd5fbe0-e008-4ea0-ae82-ed4488894258/console.log'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/org.qemu.guest_agent.0.instance-00000024.sock'/>
<target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
<alias name='channel0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<input type='tablet' bus='usb'>
<alias name='input0'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes' listen='192.168.233.114' keymap='en-us'>
<listen type='address' address='192.168.233.114'/>
</graphics>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<stats period='10'/>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='selinux' relabel='yes'>
<label>system_u:system_r:svirt_t:s0:c537,c956</label>
<imagelabel>system_u:object_r:svirt_image_t:s0:c537,c956</imagelabel>
</seclabel>
</domain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment