Adding existing subnets to space fails

Bug #1749272 reported by Dmitriy Kropivnitskiy
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Unassigned

Bug Description

Adding an existing subnet to a space fails with "subnet already exists" error on AWS.

Steps to replicate:

1. Create a new subnet in a VPC (lets say subnet-1234)
2. Bootstrap a controller with `juju bootstrap aws/us-west-2 controller --config vpc-id="myvpc" --to="subnet=subnet-1234" --config vpc-id-force=true`
3. Once the bootstrap completes, create a space `juju add-space public`
4. Add the subnet to the space `juju add-subnet subnet-1234 public`

This results in an error `ERROR cannot add subnet: adding subnet "subnet-1234": subnet "subnet-1234" already exists`

Expected results:

I should be able to add existing subnets to spaces I create, otherwise there is no way for me to use juju in an existing infrastructure.

Workarounds:

1. I can start a controller in an existing subnet and then create new subnets for juju to use. If the subnet doesn't exist during the bootstrap process, I am able to add it to a space.

2. It seems that if I destroy the default model created by the bootstrap process, it deletes all the spaces and subnets, so then I can define a new model and add subnets and spaces to it.

While the second workaround solves my problem, it seems awkward and redundant to have to delete the default model. If bootstrap creates the default model, you would expect it to be fully usable.

References:

Here are the posts I created about the issue on stackoverflow and askubuntu

https://stackoverflow.com/questions/48712196/juju-add-subnet-command-fails-to-move-existing-subnet-into-a-space

https://askubuntu.com/questions/1004656/juju-add-subnet-command-fails-to-move-existing-subnet-into-a-space

Here is the blog post about deploying k8s cluster into an existing infrastructure that I was following when I discovered this issue

https://insights.ubuntu.com/2017/02/08/automate-the-deployment-of-kubernetes-in-existing-aws-infrastructure/

description: updated
John A Meinel (jameinel)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Dmitriy Kropivnitskiy (nigde) wrote :

After some more experimentation, it turns out that even after destroying the default model and creating a new one it is impossible to add existing subnets using add-subnet. It is possible though to add subnets as part of the add-space command. So, there are two workarounds.

1. Create your model or bootstrap your controller before you create subnets.
2. Add subnets to the space as the argument to add-space command

This is inconvenient for obvious reasons, in the first workaround you cannot use existing subnets and in the second workaround you have to be very sure which subnets you want to add to which space, since there is no way to change that later and there is no way to remove defined spaces.

Revision history for this message
Anastasia (anastasia-macmood) wrote :

"juju-core" is a project where we track Juju 1.x issues and suggestions. "juju" is the project for Juju 2.x. Re-targeting this report for visibility.

Changed in juju:
status: New → Triaged
importance: Undecided → High
no longer affects: juju-core
Revision history for this message
Xav Paice (xavpaice) wrote :

you can now use `juju move-to-space` to move subnets between spaces.

Changed in juju:
status: Triaged → 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.