Skip to content
Nikolay Nikolaev edited this page Mar 26, 2015 · 4 revisions

Test scenarios for OpenStack networking based on "zones". These are suggestions for tests that could be performed manually and/or coded into OpenStack Tempest scenario tests.

Configure neutron server

Enable type zone and mechanism snabb drivers in /etc/neutron/neutron.conf:

[ml2]
type_drivers = local,zone
mechanism_drivers = logger,snabb

[ml2_snabb]
zone_definition_file = /etc/neutron/ml2_zones.txt```

Create the zone definition file /etc/neutron/ml2_zones.txt. This file uses the JSON format and tells Neutron how the physical network is setup:

  • How many 10G NICs each compute host has. (So Neutron can connect a virtual machine to a suitable port.)
  • For each 10G NIC, the appropriate VLAN and subnet to use for each zone. (So that the virtual machine can be assigned a VLAN and IP address that match the physical port.)

The format of the file is:

[
  {
    "host":"HOST NAME",
    "port":"PORT NAME",
    "zone":ZONE NAME,
    "vlan":VLAN NUMBER,
    "subnet":"SUBNET",
    "used":[LIST OF IPs]
  },
....
]

Here is an example /etc/neutron/ml2_zones.txt for one compute host compute01 with two physical ports and zones 1-3 available:

[
  {
    "host":"compute01",
    "port":"port1",
    "zone":1,
    "vlan":101,
    "subnet":"2003:0:1::/64",
    "used":["2003:0:1::1","2003:0:1::2"]
  },
  {
    "host":"compute01",
    "port":"port1",
    "zone":2,
    "vlan":102,
    "subnet":"2003:0:2::/64",
    "used":["2003:0:2::1","2003:0:2::2"]
  },
  {
    "host":"compute01",
    "port":"port1",
    "zone":3,
    "vlan":103,
    "subnet":"2003:0:3::/64",
    "used":["2003:0:3::1","2003:0:3::2"]
  },
  {
    "host":"compute01",
    "port":"port2",
    "zone":1,
    "vlan":201,
    "subnet":"2003:1:1::/64",
    "used":["2003:1:1::1","2003:1:1::2"]
  },
  {
    "host":"compute01",
    "port":"port2",
    "zone":2,
    "vlan":202,
    "subnet":"2003:1:2::/64",
    "used":["2003:1:2::1","2003:1:2::2"]
  },
  {
    "host":"compute01",
    "port":"port2",
    "zone":3,
    "vlan":203,
    "subnet":"2003:1:3::/64",
    "used":["2003:1:3::1","2003:1:3::2"]
  },
]

Create Neutron base networks and subnets

Create a network for each zone that we will use:

neutron net-create 1 --provider:network_type zone --provider:segmentation-id 1
neutron net-create 2 --provider:network_type zone --provider:segmentation-id 2
neutron net-create 3 --provider:network_type zone --provider:segmentation-id 3

Create a subnet for each zone that we can allocate preliminary IP addresses from:

neutron subnet-create --ip-version 6 1 0::0/0 --no-gateway --allocation-pool start=0::10,end=0::ffff:ffff:ffff:ffff
neutron subnet-create --ip-version 6 1 0::0/0 --no-gateway --allocation-pool start=0::10,end=0::ffff:ffff:ffff:ffff
neutron subnet-create --ip-version 6 1 0::0/0 --no-gateway --allocation-pool start=0::10,end=0::ffff:ffff:ffff:ffff

Test scenarios

VM with one NIC

Commands:

# Create a port in zone 1
$ neutron port-create 1
# Boot VM with this port attached
$ nova boot --flavor F --image I --nic port-id=<port-id>

Expected results:

Virtual machine boots successfully.

Port object is updated with the following vif_details attributes (seen with neutron port-show):

Key Value
zone_host Hostname of selected compute host
zone_port Name of selected physical port
zone_ip IP address assigned (matching physical port)
zone_vlan VLAN assigned (matching physical port)

VM with two NICs

Commands:

# Create Neutron ports in two different zones
$ neutron port-create 1
$ neutron port-create 2
# Boot a VM with both ports attached
$ nova boot --flavor F --image I --nic port-id=<first-port-id> --nic port-id=<second-port-id>

Expected results:

Virtual machine boots successfully.

Port objects are updated with vif_details corresponding to the case above.

VM with two high-bandwidth NICs

Commands:

# Create two ports each with 10Gbps bandwidth
$ neutron port-create 1 -binding:profile type=dict zone_gbps=10
$ neutron port-create 2 -binding:profile type=dict zone_gbps=10

# Boot VM with this port attached
$ nova boot --flavor F --image I --nic port-id=<first-port-id> --nic port-id=<second-port-id>

Expected results:

Virtual machine boots successfully.

The ports are assigned to separate physical NICs: Check that port has a different value for vif_details.zone_port.

Two VMs, same zone

Commands:

# Create first VM
$ neutron port-create 1
$ nova boot --flavor F --image I --nic port-id=<port-id from prev command>
# Create second VM
$ neutron port-create 1
$ nova boot --flavor F --image I --nic port-id=<port-id from prev command>

Expected results:

Both VMs boot successfully.

The VMs can ping each other.

Two VMs, different zone

Commands:

# Create first VM
$ neutron port-create 1
$ nova boot --flavor F --image I --nic port-id=<port-id from prev command>
# Create second VM
$ neutron port-create 2
$ nova boot --flavor F --image I --nic port-id=<port-id from prev command>

Expected results:

Both VMs boot successfully.

The VMs cannot ping each other.

Two VMs, bandwidth limited

Two VMs, security group restricted

  • Check that security group is enforced.
  • Check that security group can be changed while VMs running.

Two VMs, L2TPv3 tunnelled

Tunnel to VMs to each other.

Many VMs

Test that booting 50 VMs on the same physical port works.

Network not available

Test that an error occurs when trying to boot a VM on a network that is not available on the physical port (missing zone definition).

Restart database

Restart nova

Restart neutron

Restart snabbswitch