Subnets are not associated with VPCs when using AWS

Bug #1699930 reported by Michael Fraenkel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Witold Krecicki
2.2
Fix Released
High
Witold Krecicki

Bug Description

When I attempted to bootstrap juju on AWS, it failed with the following:

ERROR fetching hosted model spaces: adding subnet "10.0.1.0/24": subnet "10.0.1.0/24" already exists
2017-06-22 18:01:20 DEBUG cmd supercommand.go:459 error stack:
github.com/juju/juju/state/subnets.go:225: subnet "10.0.1.0/24" already exists
github.com/juju/juju/state/subnets.go:238:
github.com/juju/juju/state/subnets.go:238: adding subnet "10.0.1.0/24"
github.com/juju/juju/state/spacesdiscovery.go:78:
github.com/juju/juju/state/spacesdiscovery.go:51:
github.com/juju/juju/agent/agentbootstrap/bootstrap.go:221: fetching hosted model spaces
github.com/juju/juju/cmd/jujud/agent/agent.go:102:
2017-06-22 18:01:20 DEBUG juju.cmd.jujud main.go:186 jujud complete, code 0, err <nil>
14:01:21 ERROR juju.cmd.juju.commands bootstrap.go:499 failed to bootstrap model: subprocess encountered error code 1

My account has 4 VPCs and 17 subnets across them. The subnet failure above is owned by one of the other VPCs (not the default one).
I added some debug code,
2017-06-22 18:01:20 INFO XXX subnets.go:209 AddSubnet state.SubnetInfo{ProviderId:"subnet-9c429dfb", ProviderNetworkId:"", CIDR:"10.0.1.0/24", VLANTag:0, AvailabilityZone:"us-east-1a", SpaceName:""}

The ProviderNetworkId is "". The comment states that

// ProviderNetworkId holds the provider id of the network
// containing this subnet, for example VPC id for EC2.

Something is amiss.

Revision history for this message
Michael Fraenkel (mfraenkel) wrote :

I added some debug and it becomes more obvious what the issue is.
Like I stated, I have 4 VPCs, there are subnets across them that have identical CIDR ranges. The list of subnets to add are coming from mutiple VPCs. When they are added, a duplicate is detected because only the CIDR is taken into consideration.
Here are the subnets being added, I have set the NetworkId to be the VPC id.

AddSubnet() state.SubnetInfo{ProviderId:"subnet-9c429dfb", ProviderNetworkId:"vpc-327dc555", CIDR:"10.0.1.0/24", VLANTag:0, AvailabilityZone:"us-west-2b", SpaceName:""}
AddSubnet() state.SubnetInfo{ProviderId:"subnet-2bb24773", ProviderNetworkId:"vpc-c29f1da6", CIDR:"10.0.1.0/24", VLANTag:0, AvailabilityZone:"us-west-2c", SpaceName:""}

Subnet() &state.subnetDoc{DocID:"45cb8652-b8ea-4daf-8edd-68aa5b87e4ce:10.0.1.0/24", ModelUUID:"45cb8652-b8ea-4daf-8edd-68aa5b87e4ce", Life:0, ProviderId:"subnet-9c429dfb", ProviderNetworkId:"vpc-327dc555", CIDR:"10.0.1.0/24", VLANTag:0, AvailabilityZone:"us-west-2b", IsPublic:false, SpaceName:""}

Witold Krecicki (wpk)
Changed in juju:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Witold Krecicki (wpk)
Revision history for this message
John A Meinel (jameinel) wrote :
Changed in juju:
milestone: none → 2.3-alpha1
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.