Bootstrap juju controller to openstack/base connected openstack cloud fails with address not found error

So for the MicroStack use case I confirmed this bug.

Yes, correct.

@paulrusu
@joakimnyman

Solved, TL;DR: use region name ā€œmicrostackā€.

I faced the same problem and was able to solve it.
At least to the point where I could start provisioning the juju controller, itā€™s still running, so I canā€™t confirm that it creates a working controller yet, but at least it didnā€™t fail at auth stage.

If youā€™ve used microstack snap to install openstack (like me) and now you want to use juju to bootstrap something (I want to bootstrap kubernetes for example), then you should use region ā€œmicrostackā€.
If you try to use any other region name for juju cloud config, credential config, simplestreams metadata, etc. - it wonā€™t work.
I figured it out by running openstack endpoint list and note the region column.

Hereā€™s what worked for me.

Create juju controller flavour, 4GB, 4 vCPUs:

openstack flavor create juju-controller --ram 4096 --disk 20 --vcpus 4

Download and import Ubuntu Focal Fossa image to Glance:

wget https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
openstack image create Ubuntu-Focal-Fossa \
  --public \
  --disk-format=qcow2 \
  --container-format=bare \
  --property os_distro='ubuntu' \
  --file=focal-server-cloudimg-amd64.img

export IMAGE=$(openstack image list -f value -c ID --name Ubuntu-Focal-Fossa)

Initialize juju local openstack cloud.
Note the region name below is ā€œmicrostackā€, thatā€™s the key to solution:

source /var/snap/microstack/common/etc/microstack.rc

tee openstack-cloud.yaml > /dev/null << EOL
clouds:
  openstack:
    type: openstack
    auth-types: [userpass]
    regions:
      microstack:
        endpoint: '${OS_AUTH_URL}/v3'
EOL

juju add-cloud --client openstack openstack-cloud.yaml

Add juju credentials to local openstack cloud.
Note once again that the region name below is microstack:

tee openstack-credentials.yaml > /dev/null << EOL
credentials:
  openstack:
    default-region: microstack
    admin:
      auth-type: userpass
      domain-name: ""
      project-domain-name: default
      tenant-id: ""
      tenant-name: admin
      user-domain-name: default
      username: admin
      password: ${OS_PASSWORD}
      version: "3"
EOL

juju add-credential --client openstack -f openstack-credentials.yaml
juju set-default-credential openstack admin

Configure simplestreams and generate juju image metadata files.
And here once again, the region parameter (-r) should be microstack:

mkdir simplestreams
juju metadata generate-image -d ~/simplestreams -i $IMAGE -s focal -r microstack -u ${OS_AUTH_URL}/v3

Initialize the juju controller.
Important note here is to define use-floating-ip=true, otherwise juju wonā€™t be able to connect to your VM in private network.

juju bootstrap --debug \
    --config network=private \
    --config external-network=public \
    --config use-floating-ip=true \
    --config use-default-secgroup=true \
    --bootstrap-series=focal \
    --bootstrap-constraints instance-type=juju-controller \
    --metadata-source $HOME/simplestreams/ \
    openstack openstack

I hope that helps!

By the way Iā€™m creating a fully automatic single script solution for home lab single node kubernetes cluster on ubuntu microstack: https://gist.github.com/meetmatt/da9e7364dec04a43465e20c430fb58df
Will publish part 2 with the actual juju k8s provisioning soon, stay tuned.

Best regards,
Iurii

Hi thanks for this writeup. If there is anything that should be improved in the MicroStack documentation please leave a comment in the user forum by hitting the link at the bottom of that page.