Multiple Subnets Per Network

Asked by Kobi Laredo

I have configured a flat provider network and subnets that map to our colo network:
quantum net-create net1 \
       --shared \
       --provider:network_type flat \
       --provider:physical_network physnet1 \
       --router:external=True
quantum subnet-create --name subnet10 net1 192.168.10.1/24 \
       --gateway_ip 192.169.10.1 \
       --enable_dhcp=True \
       --host_routes type=dict list=true destination=192.168.0.0/16,nexthop=192.168.10.1 \
       --dns_nameservers list=true 192.168.10.2 \
       --allocation_pools type=dict list=true start=192.168.10.100,end=192.168.10.199
quantum subnet-create --name subnet11 net1 192.168.11.1/24 \
       --gateway_ip 192.169.11.1 \
       --enable_dhcp=True \
       --host_routes type=dict list=true destination=192.168.0.0/16,nexthop=192.168.11.1 \
       --dns_nameservers list=true 192.168.11.2 \
       --allocation_pools type=dict list=true start=192.168.11.100,end=192.168.11.199

My controller node is on the 192.168.10.1/24 subnet --> 192.168.10.3
I have 2 compute nodes:
ComputeNode10 on the 192.168.10.1/24 subnet --> 192.168.10.4
ComputeNode11 on the 192.168.11.1/24 subnet --> 192.168.11.4

The Problem:
when I launch a new VM on ComputeNode10 the VM is able to get network configuration during boot and is accessible on the network(ping, ssh, etc...).
However, when I launch a VM on ComputeNode11, nova is able to schedule and launch the VM on ComputeNode11 but the VM cannot get network configuration during boot and it is not accessible on the network. I can see in horizon that Quantum assigned an IP address from the wrong subnet (192.168.10.1/24 --> 192.168.10.101)

Is it possible to tell quantum/nova to launch a VM on a specific subnet and only assign an IP address from that subnet?

P.S
I did try to create a port with a fixed IP on the 192.168.11.1/24 subnet but got the following error:
quantum --debug port-create --fixed-ip subnet_id=subnet11,ip_address=192.168.11.102 net1
QuantumClientException: Invalid input for operation: IP address 192.168.11.102 is not a valid IP for the defined subnet.
* I tried to create a port on the 192.168.10.1/24 subnet and got the same error

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
yong sheng gong
Solved:
Last query:
Last reply:
Revision history for this message
yong sheng gong (gongysh) said :
#1

nova help boot:
  --nic <net-id=net-uuid,v4-fixed-ip=ip-addr,port-id=port-uuid>
                        Create a NIC on the server. Specify option multiple
                        times to create multiple NICs. net-id: attach NIC to
                        network with this UUID (optional) v4-fixed-ip: IPv4
                        fixed address for NIC (optional). port-id: attach NIC
                        to port with this UUID (optional)

nova boot --image tty --flavor 1 myserver --nic net-id=xxx,v4-fixed-ip=ip

I don't think dashboard implemented this feature.
About the quantum port-create command, it seems you find a bug.

Revision history for this message
yong sheng gong (gongysh) said :
#2

Sorry, I made a mistake:
your command to create a subnet is problematic:
quantum subnet-create --name subnet11 net1 192.168.11.1/24

it should be:
quantum subnet-create --name subnet11 net1 192.168.11.0/24

maybe you can file a bug so that system auto calculates a right CIDR for u from your way 192.168.11.1/24

Revision history for this message
Kobi Laredo (kobilaredo) said :
#3

Thanks for pointing out the CIDR error - it solved my port creation problem - THANK YOU
However, quantum is still unable to inject network configurations into VM's in the 192.168.11.0/24 subnet. Could this be a dhcp-agent issue where the new VM is not able to reach the DHCP agent to get an IP? what could cause this?

Revision history for this message
Kobi Laredo (kobilaredo) said :
#4

Alright, I'm convinced it's a dhcp-agent issue, and here's why:
1) in the VM's syslog I can clearly see that it is unable to discover a DHCP server
2) When I log into the VM (using Horizon's VNC) I'm able to manually add an IP address and a route and after that the machine becomes accessible online.
I wonder if this is a borader "provider network" issue where vm's on compute nodes that are located in a different subnet than the controller who runs dnsmasq are unable to discover the DHCP server using DHCPDISCOVER broadcast.
In the physical network we have IP helpers that direct all DHCPDISCOVER requests into the right subnet and then to the DHCP server.
In this case DHCPDISCOVER broadcasts from subnet 192.168.11.0/24 can't reach the DHCP server on subnet 192.168.11.1/24

I'm not a network expert (far from it), but does it sound right?

Revision history for this message
Best yong sheng gong (gongysh) said :
#5

DHCP request is in a broadcast source IP address. So it is not related to subnets. I think there must be some thing block the broadcast. The switch?

Revision history for this message
Kobi Laredo (kobilaredo) said :
#6

Thanks yong sheng gong, that solved my question.