Add new fields to the networks table

Adds a migration to add mtu, dhcp_server, enable_dhcp, and
share_address to the networks table. The field for dhcp_server defaults
to gateway, since gateway is currently used to determine the
dhcp_server value. The value for mtu and share address is determined by
a flag, so copy the value from the flag into the table during the
migration.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I8278fb125e6e478b519c875eca9ebbf778d88d74
Adds network fields to object

Adds mtu, dhcp_server, enable_dhcp, and share_address to network
objects and provide data migration on save.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I318791a9d7f53534b3383221cdfb7dfe63dd116b
Set reasonable defaults for new network values

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Ic9c60071480abc5fced04dab5fc79ea44db1e10d
Determine shared ip from table instead of flag

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Id7c6620704fef504d23cb42c5218251fa9e2dba7
Use mtu setting from table instead of flag

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Ia401eb95ce8c81d104e59b0348e3474655b9a992
Allow dhcp_server to be set from new field

Now that dhcp_server and gateway can be different, update dnsmasq
to hand out the gateway if we have a single ip address and they
don't match.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Id040ce1fb0f889418815568ff6c80402b69bf09e
Only use dhcp if enable_dhcp is set on the network

Also removes an unused call to init_host if there is no network
to setup. The signature of this call was wrong so clearly it was
not being used.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I33c86b1500f9a69081b4c6ecbe79151f10f69cea
Properly handle snatting for external gateways

Previously, snatting for netowrks with external gateways had to be
handled by manually setting:
 * public_interface = ''
 * force_snat_range = snat_range
Whereas networks with a gateway managed by nova needed:
 * public_interface = eth0
 * force_snat_range = None or ['0.0.0.0/0']

In order to support both simultaneously, we calcualate whether the
gateway is external, and use the force_snat_range and skip interface
if it is an external gateway. Otherwise, we use the setting for public
interface and 0.0.0.0/0. This allows external and internal gateways
to co-exist.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: Id5ec66946c3a82841a6dd2d019404e822cdafe64
Support reserving ips at network create time

It is horribly inefficient to create a network and reserve a large
swath of ips, so allow the network creator to specify which ips
he wants to be available in the network by specifying allowed_start
and allowed_end.

Something like:

network-create foo --cidr 10.0.0.0/24 --allowed-start 10.0.0.5 \
    --allowed-end 10.0.0.250

would ensure that 10.0.0.0-10.0.0.4 and 10.0.0.254-10.0.0.255 are
marked reserved so instances would be assigned addresses from the
middle of the range.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I5427e1a2d202658d374292559fc7054f2fa51124
Add api extension for new network fields.

This uses the existing api extension to implement the actual control
of the fields, but the check is based on a new dummy extension
called os-extended-networks.

Api sample tests added for new extension.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I577fe5f6560be50106f345a42a826e97d5e7d64c