Routing Configuration in different subnets in openstack

Dear friend in this tutorial we will see routing configuration in different subnets in openstack. We will also see how to update Image in openstack, how to create Network, how to create a flavour and how to create a router for network routing in OpenStack.

We follow these steps to perform network routing configuration in different subnets in openstack.

  1. Qcow2 image upload in openstack.
  2. Flavor creation in openstack.
  3. OVS Network creation in openstack.
  4. Network subnet creation in openstack.
  5. SRIOV Network and port creation in openstack
  6. Instance launch in openstack
  7. Router creation for network routing configuration in openstack.
  8. check network routing between two different subnet.

So lets start step by steps configuration and see Network routing between to two different subnet in openstack.

Qcow2 image upload in openstack.

In this section we will see how to upload image in qcow2 format in openstack library. We can use glance image-create command to upload image in openstack. Like below:-

[[email protected] (overcloudrc) ~]$ glance image-create --name Rhel7Genereic --file "/home/stack/redhat-7.4-ATP-V6.qcow2" --disk-format qcow2 --container-format bare --visibility "private"
 +------------------+----------------------------------------------------------------------------------+
 | Property         | Value                                                                            |
 +------------------+----------------------------------------------------------------------------------+
 | checksum         | ab7378219c69d2efa18c5c2cfb1db843                                                 |
 | container_format | bare                                                                             |
 | created_at       | 2019-08-31T11:24:15Z                                                             |
 | direct_url       | rbd://278d2e51-caef-4627-8677-901e483c2648/images/83f34de1-9da6-4cab-b00c-       |
 |                  | a3641290a0c8/snap                                                                |
 | disk_format      | qcow2                                                                            |
 | id               | 83f34de1-9da6-4cab-b00c-a3641290a0c8                                             |
 | locations        | [{"url": "rbd://278d2e51-caef-4627-8677-901e483c2648/images/83f34de1-9da6-4cab-  |
 |                  | b00c-a3641290a0c8/snap", "metadata": {}}]                                        |
 | min_disk         | 0                                                                                |
 | min_ram          | 0                                                                                |
 | name             | Rhel7Genereic                                                                    |
 | owner            | 4e076fffb06d42f09c5994a0fd781cfd                                                 |
 | protected        | False                                                                            |
 | size             | 2137260032                                                                       |
 | status           | active                                                                           |
 | tags             | []                                                                               |
 | updated_at       | 2019-08-31T11:24:34Z                                                             |
 | virtual_size     | None                                                                             |
 | visibility       | private                                                                          |
 +------------------+----------------------------------------------------------------------------------+
 [[email protected] (overcloudrc) ~]$

We can list down created image with below commands.

[[email protected] (overcloudrc) ~]$ openstack image list
 +--------------------------------------+---------------+--------+
 | ID                                   | Name          | Status |
 +--------------------------------------+---------------+--------+
 | 83f34de1-9da6-4cab-b00c-a3641290a0c8 | Rhel7Genereic | active |
 +--------------------------------------+---------------+--------+
 [[email protected] (overcloudrc) ~]$

Flavor creation in openstack.

Now we will see how to create flavor in openstack. In the flavor we have to define Number of CPU, Memory size and Hard Disk size for our instance.

[[email protected] (overcloudrc) ~]$ nova flavor-create SMALL_1 auto 4096 0 4
 +--------------------------------------+---------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
 | ID                                   | Name    | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | Description |
 +--------------------------------------+---------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
 | bec4a148-1b03-47e1-a793-96a905c22ec4 | SMALL_1 | 4096      | 0    | 0         |      | 4     | 1.0         | True      | -           |
 +--------------------------------------+---------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
 [[email protected] (overcloudrc) ~]$

Check created flavor with below commands.

[[email protected] (overcloudrc) ~]$ openstack flavor list
 +--------------------------------------+---------+------+------+-----------+-------+-----------+
 | ID                                   | Name    |  RAM | Disk | Ephemeral | VCPUs | Is Public |
 +--------------------------------------+---------+------+------+-----------+-------+-----------+
 | bec4a148-1b03-47e1-a793-96a905c22ec4 | SMALL_1 | 4096 |    0 |         0 |     4 | True      |
 +--------------------------------------+---------+------+------+-----------+-------+-----------+
 [[email protected] (overcloudrc) ~]$

OVS Network creation in openstack.

Now I am going to create OVS network with VLAN 10 and network is 10.10.10.0/24 and physnet is 0 where OVS network is mapped.

[[email protected] (overcloudrc) ~]$ neutron net-create Net-10 --provider:network_type vlan --provider:physical_network physnet0 --provider:segmentation_id 10
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Created a new network:
 +---------------------------+--------------------------------------+
 | Field                     | Value                                |
 +---------------------------+--------------------------------------+
 | admin_state_up            | True                                 |
 | availability_zone_hints   |                                      |
 | availability_zones        |                                      |
 | created_at                | 2019-08-31T11:51:04Z                 |
 | description               |                                      |
 | id                        | 61099c91-8ddb-452a-8552-53feb08302fa |
 | ipv4_address_scope        |                                      |
 | ipv6_address_scope        |                                      |
 | is_default                | False                                |
 | l2_adjacency              | True                                 |
 | mtu                       | 1600                                 |
 | name                      | Net-10                               |
 | port_security_enabled     | True                                 |
 | project_id                | 4e076fffb06d42f09c5994a0fd781cfd     |
 | provider:network_type     | vlan                                 |
 | provider:physical_network | physnet0                             |
 | provider:segmentation_id  | 10                                   |
 | qos_policy_id             |                                      |
 | revision_number           | 3                                    |
 | router:external           | False                                |
 | shared                    | False                                |
 | status                    | ACTIVE                               |
 | subnets                   |                                      |
 | tags                      |                                      |
 | tenant_id                 | 4e076fffb06d42f09c5994a0fd781cfd     |
 | updated_at                | 2019-08-31T11:51:04Z                 |
 +---------------------------+--------------------------------------+
 [[email protected] (overcloudrc) ~]$

Openstack network list command can be use to display created network. Like below:-

[[email protected] (overcloudrc) ~]$ openstack network list
 +--------------------------------------+--------+---------+
 | ID                                   | Name   | Subnets |
 +--------------------------------------+--------+---------+
 | 61099c91-8ddb-452a-8552-53feb08302fa | Net-10 |         |
 +--------------------------------------+--------+---------+
 [[email protected] (overcloudrc) ~]$

Network subnet creation in openstack.

After network creation we can create subnet for that network. like below:-

[[email protected] (overcloudrc) ~]$ neutron subnet-create Net-10 10.10.10.0/24  --name Subnet-Net-10 --enable-dhcp --gateway 10.10.10.1 --allocation-pool start=10.10.10.10,end=10.10.10.100
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Created a new subnet:
 +-------------------+-------------------------------------------------+
 | Field             | Value                                           |
 +-------------------+-------------------------------------------------+
 | allocation_pools  | {"start": "10.10.10.10", "end": "10.10.10.100"} |
 | cidr              | 10.10.10.0/24                                   |
 | created_at        | 2019-08-31T11:59:45Z                            |
 | description       |                                                 |
 | dns_nameservers   |                                                 |
 | enable_dhcp       | True                                            |
 | gateway_ip        | 10.10.10.1                                      |
 | host_routes       |                                                 |
 | id                | bd6dea3f-d317-41d4-8b4c-1cd0d8f792cf            |
 | ip_version        | 4                                               |
 | ipv6_address_mode |                                                 |
 | ipv6_ra_mode      |                                                 |
 | name              | Subnet-Net-10                                   |
 | network_id        | 61099c91-8ddb-452a-8552-53feb08302fa            |
 | project_id        | 4e076fffb06d42f09c5994a0fd781cfd                |
 | revision_number   | 0                                               |
 | segment_id        |                                                 |
 | service_types     |                                                 |
 | subnetpool_id     |                                                 |
 | tags              |                                                 |
 | tenant_id         | 4e076fffb06d42f09c5994a0fd781cfd                |
 | updated_at        | 2019-08-31T11:59:45Z                            |
 +-------------------+-------------------------------------------------+
 [[email protected] (overcloudrc) ~]$

Network subnet list can be display using openstack subnet list like below:-

[[email protected] (overcloudrc) ~]$ openstack subnet list
 +--------------------------------------+---------------+--------------------------------------+---------------+
 | ID                                   | Name          | Network                              | Subnet        |
 +--------------------------------------+---------------+--------------------------------------+---------------+
 | bd6dea3f-d317-41d4-8b4c-1cd0d8f792cf | Subnet-Net-10 | 61099c91-8ddb-452a-8552-53feb08302fa | 10.10.10.0/24 |
 +--------------------------------------+---------------+--------------------------------------+---------------+
 [[email protected] (overcloudrc) ~]$

SRIOV Network and port creation in openstack.

Now I am going to create SRIOV network with VLAN 20 and network range is 10.10.20.0/24 and physnet is 1 where SRIOV mapped on physnet 1.

[[email protected] (overcloudrc) ~]$ neutron net-create SRIOV-Net-20 --provider:network_type vlan --provider:physical_network physnet1 --provider:segmentation_id 20
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Created a new network:
 +---------------------------+--------------------------------------+
 | Field                     | Value                                |
 +---------------------------+--------------------------------------+
 | admin_state_up            | True                                 |
 | availability_zone_hints   |                                      |
 | availability_zones        |                                      |
 | created_at                | 2019-08-31T12:06:11Z                 |
 | description               |                                      |
 | id                        | 6d0378a1-c56f-44b4-9234-408e58164911 |
 | ipv4_address_scope        |                                      |
 | ipv6_address_scope        |                                      |
 | is_default                | False                                |
 | l2_adjacency              | True                                 |
 | mtu                       | 1600                                 |
 | name                      | SRIOV-Net-20                         |
 | port_security_enabled     | True                                 |
 | project_id                | 4e076fffb06d42f09c5994a0fd781cfd     |
 | provider:network_type     | vlan                                 |
 | provider:physical_network | physnet1                             |
 | provider:segmentation_id  | 20                                   |
 | qos_policy_id             |                                      |
 | revision_number           | 3                                    |
 | router:external           | False                                |
 | shared                    | False                                |
 | status                    | ACTIVE                               |
 | subnets                   |                                      |
 | tags                      |                                      |
 | tenant_id                 | 4e076fffb06d42f09c5994a0fd781cfd     |
 | updated_at                | 2019-08-31T12:06:12Z                 |
 +---------------------------+--------------------------------------+
 [[email protected] (overcloudrc) ~]$

SRIOV subnet creation.

[[email protected] (overcloudrc) ~]$ neutron subnet-create SRIOV-Net-20 10.10.20.0/24  --name SRIOV-Net-Subnet --enable-dhcp --gateway 10.10.20.1 --allocation-pool start=10.10.20.10,end=10.10.20.100
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Created a new subnet:
 +-------------------+-------------------------------------------------+
 | Field             | Value                                           |
 +-------------------+-------------------------------------------------+
 | allocation_pools  | {"start": "10.10.20.10", "end": "10.10.20.100"} |
 | cidr              | 10.10.20.0/24                                   |
 | created_at        | 2019-08-31T12:09:34Z                            |
 | description       |                                                 |
 | dns_nameservers   |                                                 |
 | enable_dhcp       | True                                            |
 | gateway_ip        | 10.10.20.1                                      |
 | host_routes       |                                                 |
 | id                | 36ea0aee-340f-482d-9dbe-f4a5f29a1143            |
 | ip_version        | 4                                               |
 | ipv6_address_mode |                                                 |
 | ipv6_ra_mode      |                                                 |
 | name              | SRIOV-Net-Subnet                                |
 | network_id        | 6d0378a1-c56f-44b4-9234-408e58164911            |
 | project_id        | 4e076fffb06d42f09c5994a0fd781cfd                |
 | revision_number   | 0                                               |
 | segment_id        |                                                 |
 | service_types     |                                                 |
 | subnetpool_id     |                                                 |
 | tags              |                                                 |
 | tenant_id         | 4e076fffb06d42f09c5994a0fd781cfd                |
 | updated_at        | 2019-08-31T12:09:34Z                            |
 +-------------------+-------------------------------------------------+
 [[email protected] (overcloudrc) ~]$

SRIOV port creation.

[[email protected] (overcloudrc) ~]$ neutron port-create SRIOV-Net-20 --vnic-type  direct --name SRIOV-Net-Port1
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Created a new port:
 +-----------------------+------------------------------------------------------------------------------------+
 | Field                 | Value                                                                              |
 +-----------------------+------------------------------------------------------------------------------------+
 | admin_state_up        | True                                                                               |
 | allowed_address_pairs |                                                                                    |
 | binding:host_id       |                                                                                    |
 | binding:profile       | {}                                                                                 |
 | binding:vif_details   | {}                                                                                 |
 | binding:vif_type      | unbound                                                                            |
 | binding:vnic_type     | direct                                                                             |
 | created_at            | 2019-08-31T12:13:29Z                                                               |
 | description           |                                                                                    |
 | device_id             |                                                                                    |
 | device_owner          |                                                                                    |
 | extra_dhcp_opts       |                                                                                    |
 | fixed_ips             | {"subnet_id": "36ea0aee-340f-482d-9dbe-f4a5f29a1143", "ip_address": "10.10.20.19"} |
 | id                    | 34eb9196-0821-4e5e-b442-307a9a236fe7                                               |
 | ip_allocation         | immediate                                                                          |
 | mac_address           | fa:16:3e:35:27:e8                                                                  |
 | name                  | SRIOV-Net-Port1                                                                    |
 | network_id            | 6d0378a1-c56f-44b4-9234-408e58164911                                               |
 | port_security_enabled | True                                                                               |
 | project_id            | 4e076fffb06d42f09c5994a0fd781cfd                                                   |
 | qos_policy_id         |                                                                                    |
 | revision_number       | 6                                                                                  |
 | security_groups       | 3a02de4b-6dda-4ac9-afcd-5126eacf899f                                               |
 | status                | DOWN                                                                               |
 | tags                  |                                                                                    |
 | tenant_id             | 4e076fffb06d42f09c5994a0fd781cfd                                                   |
 | updated_at            | 2019-08-31T12:13:29Z                                                               |
 +-----------------------+------------------------------------------------------------------------------------+
 [[email protected] (overcloudrc) ~]$

For more network detail you can click here

We can check our dhcp server with below commands where our DHCP IP will assign on our controller node.

[[email protected] (overcloudrc) ~]$ salt "ontrol" cmd.run "sudo ip netns exec qdhcp-6d0378a1-c56f-44b4-9234-408e58164911 ifconfig"
 controller-2:
     lo: flags=73  mtu 65536
             inet 127.0.0.1  netmask 255.0.0.0
             inet6 ::1  prefixlen 128  scopeid 0x10
             loop  txqueuelen 1000  (Local Loopback)
             RX packets 0  bytes 0 (0.0 B)
             RX errors 0  dropped 0  overruns 0  frame 0
             TX packets 0  bytes 0 (0.0 B)
             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 tap1ff6c31c-54: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1600         inet 10.10.20.10  netmask 255.255.255.0  broadcast 10.10.20.255         inet6 fe80::f816:3eff:fe7f:abbc  prefixlen 64  scopeid 0x20<link>         ether fa:16:3e:7f:ab:bc  txqueuelen 1000  (Ethernet)         RX packets 3  bytes 228 (228.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 5  bytes 438 (438.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 controller-0:
     lo: flags=73  mtu 65536
             inet 127.0.0.1  netmask 255.0.0.0
             inet6 ::1  prefixlen 128  scopeid 0x10
             loop  txqueuelen 1000  (Local Loopback)
             RX packets 0  bytes 0 (0.0 B)
             RX errors 0  dropped 0  overruns 0  frame 0
             TX packets 0  bytes 0 (0.0 B)
             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 tap1fa6d387-f3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1600         inet 169.254.169.254  netmask 255.255.0.0  broadcast 169.254.255.255         inet6 fe80::f816:3eff:fe03:b23a  prefixlen 64  scopeid 0x20<link>         ether fa:16:3e:03:b2:3a  txqueuelen 1000  (Ethernet)         RX packets 1  bytes 76 (76.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 5  bytes 438 (438.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 controller-1:
     lo: flags=73  mtu 65536
             inet 127.0.0.1  netmask 255.0.0.0
             inet6 ::1  prefixlen 128  scopeid 0x10
             loop  txqueuelen 1000  (Local Loopback)
             RX packets 0  bytes 0 (0.0 B)
             RX errors 0  dropped 0  overruns 0  frame 0
             TX packets 0  bytes 0 (0.0 B)
             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 tap5b20e1c6-10: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1600         inet 10.10.20.11  netmask 255.255.255.0  broadcast 10.10.20.255         inet6 fe80::f816:3eff:fe9c:22c6  prefixlen 64  scopeid 0x20<link>         ether fa:16:3e:9c:22:c6  txqueuelen 1000  (Ethernet)         RX packets 1  bytes 76 (76.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 5  bytes 438 (438.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 [[email protected] (overcloudrc) ~]$

Now we have complete configuration for VM creation. we can verify of all details like below:-

[[email protected] (overcloudrc) ~]$ openstack network list
 +--------------------------------------+--------------+--------------------------------------+
 | ID                                   | Name         | Subnets                              |
 +--------------------------------------+--------------+--------------------------------------+
 | 61099c91-8ddb-452a-8552-53feb08302fa | Net-10       | bd6dea3f-d317-41d4-8b4c-1cd0d8f792cf |
 | 6d0378a1-c56f-44b4-9234-408e58164911 | SRIOV-Net-20 | 36ea0aee-340f-482d-9dbe-f4a5f29a1143 |
 +--------------------------------------+--------------+--------------------------------------+
 [[email protected] (overcloudrc) ~]$ openstack flavor list
 +--------------------------------------+---------+------+------+-----------+-------+-----------+
 | ID                                   | Name    |  RAM | Disk | Ephemeral | VCPUs | Is Public |
 +--------------------------------------+---------+------+------+-----------+-------+-----------+
 | bec4a148-1b03-47e1-a793-96a905c22ec4 | SMALL_1 | 4096 |    0 |         0 |     4 | True      |
 +--------------------------------------+---------+------+------+-----------+-------+-----------+
 [[email protected] (overcloudrc) ~]$ openstack image list
 +--------------------------------------+---------------+--------+
 | ID                                   | Name          | Status |
 +--------------------------------------+---------------+--------+
 | 83f34de1-9da6-4cab-b00c-a3641290a0c8 | Rhel7Genereic | active |
 +--------------------------------------+---------------+--------+
 [[email protected] (overcloudrc) ~]$

Instance launch in openstack

Now I am going to launch instance with SRIOV direct port network. Like below:-

[[email protected] (overcloudrc) ~]$ nova boot --image Rhel7Genereic --flavor SMALL_1 --nic port-id=34eb9196-0821-4e5e-b442-307a9a236fe7 SRIOV-VM-1
 +--------------------------------------+------------------------------------------------------+
 | Property                             | Value                                                |
 +--------------------------------------+------------------------------------------------------+
 | OS-DCF:diskConfig                    | MANUAL                                               |
 | OS-EXT-AZ:availability_zone          |                                                      |
 | OS-EXT-SRV-ATTR:host                 | -                                                    |
 | OS-EXT-SRV-ATTR:hostname             | sriov-vm-1                                           |
 | OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                    |
 | OS-EXT-SRV-ATTR:instance_name        |                                                      |
 | OS-EXT-SRV-ATTR:kernel_id            |                                                      |
 | OS-EXT-SRV-ATTR:launch_index         | 0                                                    |
 | OS-EXT-SRV-ATTR:ramdisk_id           |                                                      |
 | OS-EXT-SRV-ATTR:reservation_id       | r-v5i7depl                                           |
 | OS-EXT-SRV-ATTR:root_device_name     | -                                                    |
 | OS-EXT-SRV-ATTR:user_data            | -                                                    |
 | 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                            | 8p9utQ6QQEtb                                         |
 | config_drive                         |                                                      |
 | created                              | 2019-08-31T12:27:09Z                                 |
 | description                          | -                                                    |
 | flavor:disk                          | 0                                                    |
 | flavor:ephemeral                     | 0                                                    |
 | flavor:extra_specs                   | {}                                                   |
 | flavor:original_name                 | SMALL_1                                              |
 | flavor:ram                           | 4096                                                 |
 | flavor:swap                          | 0                                                    |
 | flavor:vcpus                         | 4                                                    |
 | hostId                               |                                                      |
 | host_status                          |                                                      |
 | id                                   | 5bc098a3-9052-4ccf-884a-54d09715ebb7                 |
 | image                                | Rhel7Genereic (83f34de1-9da6-4cab-b00c-a3641290a0c8) |
 | key_name                             | -                                                    |
 | locked                               | False                                                |
 | metadata                             | {}                                                   |
 | name                                 | SRIOV-VM-1                                           |
 | os-extended-volumes:volumes_attached | []                                                   |
 | progress                             | 0                                                    |
 | security_groups                      | default                                              |
 | status                               | BUILD                                                |
 | tags                                 | []                                                   |
 | tenant_id                            | 4e076fffb06d42f09c5994a0fd781cfd                     |
 | updated                              | 2019-08-31T12:27:09Z                                 |
 | user_id                              | e87f3016e1be49bab6d76fac683d64b9                     |
 +--------------------------------------+------------------------------------------------------+
 [[email protected] (overcloudrc) ~]$

You can see here, we have successfully launched one VM in compute 0 host

[[email protected] (overcloudrc) ~]$ salt "omput" cmd.run "sudo virsh list"
 sriovperformancecompute-2:
      Id    Name                           State
     ----------------------------------------------------
 sriovperformancecompute-1:
      Id    Name                           State
     ----------------------------------------------------
 sriovperformancecompute-0:
      Id    Name                           State
     ----------------------------------------------------
      2     instance-00000014              running
 [[email protected] (overcloudrc) ~]$

Now I am going to launch OVS instance using OVS network.

[[email protected] (overcloudrc) ~]$ nova boot --image Rhel7Genereic --flavor SMALL_1 --nic net-id=61099c91-8ddb-452a-8552-53feb08302fa OVS-VM-2
 +--------------------------------------+------------------------------------------------------+
 | Property                             | Value                                                |
 +--------------------------------------+------------------------------------------------------+
 | OS-DCF:diskConfig                    | MANUAL                                               |
 | OS-EXT-AZ:availability_zone          |                                                      |
 | OS-EXT-SRV-ATTR:host                 | -                                                    |
 | OS-EXT-SRV-ATTR:hostname             | ovs-vm-2                                             |
 | OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                    |
 | OS-EXT-SRV-ATTR:instance_name        |                                                      |
 | OS-EXT-SRV-ATTR:kernel_id            |                                                      |
 | OS-EXT-SRV-ATTR:launch_index         | 0                                                    |
 | OS-EXT-SRV-ATTR:ramdisk_id           |                                                      |
 | OS-EXT-SRV-ATTR:reservation_id       | r-zb3dbu8m                                           |
 | OS-EXT-SRV-ATTR:root_device_name     | -                                                    |
 | OS-EXT-SRV-ATTR:user_data            | -                                                    |
 | 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                            | ca3Hm6sXhPxm                                         |
 | config_drive                         |                                                      |
 | created                              | 2019-08-31T12:35:35Z                                 |
 | description                          | -                                                    |
 | flavor:disk                          | 0                                                    |
 | flavor:ephemeral                     | 0                                                    |
 | flavor:extra_specs                   | {}                                                   |
 | flavor:original_name                 | SMALL_1                                              |
 | flavor:ram                           | 4096                                                 |
 | flavor:swap                          | 0                                                    |
 | flavor:vcpus                         | 4                                                    |
 | hostId                               |                                                      |
 | host_status                          |                                                      |
 | id                                   | d85be7e0-98d3-4b1b-8349-c103d225e430                 |
 | image                                | Rhel7Genereic (83f34de1-9da6-4cab-b00c-a3641290a0c8) |
 | key_name                             | -                                                    |
 | locked                               | False                                                |
 | metadata                             | {}                                                   |
 | name                                 | OVS-VM-2                                             |
 | os-extended-volumes:volumes_attached | []                                                   |
 | progress                             | 0                                                    |
 | security_groups                      | default                                              |
 | status                               | BUILD                                                |
 | tags                                 | []                                                   |
 | tenant_id                            | 4e076fffb06d42f09c5994a0fd781cfd                     |
 | updated                              | 2019-08-31T12:35:35Z                                 |
 | user_id                              | e87f3016e1be49bab6d76fac683d64b9                     |
 +--------------------------------------+------------------------------------------------------+
 [[email protected] (overcloudrc) ~]$

You can see below we have successfully launched second instance with OVS network on compute host 2

[[email protected] (overcloudrc) ~]$ salt "omput" cmd.run "sudo virsh list"
 sriovperformancecompute-2:
      Id    Name                           State
     ----------------------------------------------------
      3     instance-00000017              running
 sriovperformancecompute-0:
      Id    Name                           State
     ----------------------------------------------------
      2     instance-00000014              running
 sriovperformancecompute-1:
      Id    Name                           State
     ----------------------------------------------------
 [[email protected] (overcloudrc) ~]$

Now you can see in above screen shot we have successfully launched both instances.

Router creation for network routing in openstack.

Now we can create Openstack Virtual router for routing between two different subnet. Like below:-

[[email protected] (overcloudrc) ~]$ neutron router-create router
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Created a new router:
 +-------------------------+--------------------------------------+
 | Field                   | Value                                |
 +-------------------------+--------------------------------------+
 | admin_state_up          | True                                 |
 | availability_zone_hints |                                      |
 | availability_zones      |                                      |
 | created_at              | 2019-08-31T12:41:38Z                 |
 | description             |                                      |
 | external_gateway_info   |                                      |
 | flavor_id               |                                      |
 | ha                      | True                                 |
 | id                      | 8cee8581-afc5-43ff-953c-add3fd1f1db6 |
 | name                    | router                               |
 | project_id              | 4e076fffb06d42f09c5994a0fd781cfd     |
 | revision_number         | 1                                    |
 | routes                  |                                      |
 | status                  | ACTIVE                               |
 | tags                    |                                      |
 | tenant_id               | 4e076fffb06d42f09c5994a0fd781cfd     |
 | updated_at              | 2019-08-31T12:41:38Z                 |
 +-------------------------+--------------------------------------+
 [[email protected] (overcloudrc) ~]$ 

After router creation, we need to be add our both network subnet in router to access both network from both side. Like below:-

[[email protected] (overcloudrc) ~]$ neutron router-interface-add 8cee8581-afc5-43ff-953c-add3fd1f1db6 SRIOV-Net-Subnet
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Added interface edc78a21-c53a-420c-a846-aa2f2dce8ab8 to router 8cee8581-afc5-43ff-953c-add3fd1f1db6.
 [[email protected] (overcloudrc) ~]$ neutron router-interface-add 8cee8581-afc5-43ff-953c-add3fd1f1db6 Subnet-Net-10
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 Added interface 0aaaa722-22fc-47f0-adfe-d28671c80d7c to router 8cee8581-afc5-43ff-953c-add3fd1f1db6.
 [[email protected] (overcloudrc) ~]$

We have successfully added subnet in router. After that we can go to Dashboard and check our network routing is working or not?
Make sure your security profile is updated and ICMP should be allow from all networks then we can see our OVS networ VM will be accessible from SRIOV network.

You can see in above screen shot we are able to access OVS network from SRIOV network.

That’s all, We have successfully configured network routing between two different subnets in openstack.

2 thoughts on “Routing Configuration in different subnets in openstack

  1. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Great work!

Leave a Reply

Your email address will not be published. Required fields are marked *