Bookmark this page

Lab: Managing Red Hat OpenStack Platform Networking

In this lab, you will create a tenant network, launch an instance, and view the associated OVN flows for the instance.

Outcomes

You should be able to:

  • Create a tenant network

  • Launch an instance

  • Locate the flows associated with an instance

As the student user on the workstation machine, use the lab command to prepare your system for this exercise.

This command ensures that all resources required for the exercise are present.

[student@workstation ~]$ lab networking-review start

Procedure 3.2. Instructions

  1. As the developer1 user in the production project, create a tenant network named production-network4. Create the production-subnet4 subnet linked to production-network4. Use 192.168.10.0/24 for the subnet range, enable DHCP, and configure a nameserver of 172.25.250.254. Leave all other settings at their default values.

    1. On workstation, open a terminal, then source the /home/student/developer1-production-rc credential file.

      [student@workstation ~]$ source ~/developer1-production-rc
      [student@workstation ~(developer1-production)]$
    2. Use the openstack network create command to create production-network4.

      [student@workstation ~(developer1-production)]$ openstack network create \
      > production-network4 -f json
      ...output omitted...
    3. Create the production-subnet4 subnet, using a subnet range of 192.168.10.0/24.

      [student@workstation ~(developer1-production)]$ openstack subnet create \
      > --subnet-range 192.168.10.0/24 \
      > --dns-nameserver 172.25.250.254 \
      > --network production-network4 production-subnet4 -f json
      {
        "allocation_pools": [
          {
            "start": "192.168.10.2",
            "end": "192.168.10.254"
          }
        ],
        "cidr": "192.168.10.0/24",
        "created_at": "2020-07-19T04:48:20Z",
        "description": "",
        "dns_nameservers": [
          "172.25.250.254"
        ],
        "enable_dhcp": true,
        "gateway_ip": "192.168.10.1",
        "host_routes": [],
        "id": "47c9ae55-ba00-46b0-b0dc-6b3194565009",
        "ip_version": 4,
        "ipv6_address_mode": null,
        "ipv6_ra_mode": null,
        "location": {
          "cloud": "",
          "region_name": "regionOne",
          "zone": null,
          "project": {
            "id": "bc0dcd6db76f435385723a784e7dbdd0",
            "name": "production",
            "domain_id": null,
            "domain_name": "Example"
          }
        },
        "name": "production-subnet4",
        "network_id": "d237edce-12bf-4afc-a2f2-1b1383421db1",
      ...output omitted...
  2. Create an instance named production-server4 using the settings in the following table.

    OptionValue
    Imagerhel8
    flavordefault
    networkproduction-network4
    keypairexample-keypair
    1. Launch an instance named production-server4 using the settings in the table above.

      [student@workstation ~(developer1-production)]$ openstack server create \
      > --image rhel8 \
      > --flavor default \
      > --key-name example-keypair \
      > --nic net-id=production-network4 \
      > --wait production-server4 -f json
      ...output omitted...
        "addresses": "production-network4=192.168.10.8",
        "adminPass": "orkTUcc667uj",
        "config_drive": "",
        "created": "2020-07-19T04:54:22Z",
        "flavor": "default (8ff1eecb-15b4-4f32-bb99-4dec999a78c7)",
        "hostId": "33ba37e44be088ead61e5b71358f4ea612e613933779475e67aa7126",
        "id": "382e851d-7964-4f73-b58b-d8f285c4b1c6",
        "image": "rhel8 (b33fca9a-3c85-40b3-86bf-466eeaccbf6b)",
        "key_name": "example-keypair",
        "name": "production-server4",
        "progress": 0,
        "project_id": "bc0dcd6db76f435385723a784e7dbdd0",
        "properties": "",
        "security_groups": "name='default'",
        "status": "ACTIVE",
      ...output omitted...
  3. Determine the MAC address and compute node of production-server4.

    1. Source the /home/student/operator1-production-rc credential file.

      [student@workstation ~(developer1-production)]$ source ~/operator1-production-rc
      [student@workstation ~(operator1-production)]$
    2. Use the openstack server show command to determine the compute node hosting production-server4.

      [student@workstation ~(operator1-production)]$ openstack server show \
      > production-server4 -f json
      {
        "OS-DCF:diskConfig": "MANUAL",
        "OS-EXT-AZ:availability_zone": "nova",
        "OS-EXT-SRV-ATTR:host": "compute1.overcloud.example.com",
        "OS-EXT-SRV-ATTR:hypervisor_hostname": "compute1.overcloud.example.com",
        "OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
        "OS-EXT-STS:power_state": "Running",
        "OS-EXT-STS:task_state": null,
        "OS-EXT-STS:vm_state": "active",
      ...output omitted...
    3. Use the openstack port list command to determine the MAC address of production-server4.

      [student@workstation ~(operator1-production)]$ openstack port list \
      > --server production-server4 -f json
      [
        {
          "ID": "2f8440ec-7221-48f4-9f84-80b2fa6f232a",
          "Name": "",
          "MAC Address": "fa:16:3e:7b:05:f6",
          "Fixed IP Addresses": [
            {
              "subnet_id": "47c9ae55-ba00-46b0-b0dc-6b3194565009",
              "ip_address": "192.168.10.8"
            }
          ],
          "Status": "ACTIVE"
        }
      ]
  4. Log on to the compute node hosting production-server4, and use the ovs-ofctl dump-flows command to view the flows created specifically for the instance. Locate the first rules that allow DHCP requests (UDP source port 68) and ARP requests.

    1. Log on to the appropriate compute node as heat-admin, then become root.

      [student@workstation ~(operator1-production)]$ ssh heat-admin@compute1
      [heat-admin@compute1 ~]$ sudo -i
      [root@compute1 ~]#
    2. Run the ovs-ofctl dump-flows br-int command, and filter the results by the MAC address of production-server4. Log out when finished.

      [root@compute1 ~]# ovs-ofctl dump-flows br-int \
      > | grep 'fa:16:3e:7b:05:f6'
      ...output omitted...
       cookie=0x652d4f6e, duration=22922.787s, table=9, n_packets=4, n_bytes=1334, idle_age=22878, priority=90,udp,reg14=0x2,metadata=0x7,dl_src=fa:16:3e:7b:05:f6,nw_src=0.0.0.0,
      nw_dst=255.255.255.255,tp_src=68,tp_dst=67 actions=resubmit(,10)
      ...output omitted...
       cookie=0x4d40f324, duration=22922.784s, table=10, n_packets=140, n_bytes=5880, idle_age=667, priority=90,arp,reg14=0x2,metadata=0x7,dl_src=fa:16:3e:7b:05:f6, arp_spa=192.168.10.8,arp_sha=fa:16:3e:7b:05:f6 actions=resubmit(,11)
      ...output omitted...

Evaluation

Grade your work by running the lab command from your workstation machine. Correct any reported failures and rerun the script until successful.

[student@workstation ~]$ lab networking-review grade

Finish

On the workstation machine, use the lab command to complete this exercise. This is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab networking-review finish

This concludes the lab.

Revision: cl110-16.1-4c76154