Unable to bootstrap juju with maas

Hello!
I try to integrate juju 3.1 and 3.2 with maas 3.3 and 3.4.0~rc2
VM with juju managed by maas

Commands for setup juju

sudo snap install juju --channel 3.2
mkdir -p ~/.local/share

tee maas-cloud.yaml <<EOF
clouds:
  maas-one:
    type: maas
    auth-types: [oauth1]
    endpoint: http://192.168.0.14:5240/MAAS
EOF

juju add-cloud --client -f maas-cloud.yaml maas-one

tee maas-creds.yaml <<EOF
credentials:
  maas-one:
    admin:
      auth-type: oauth1
      maas-oauth: bWK83EVwMLN9yqckf6#########ZXMXPrvypF9qpyzc9nWt
EOF

juju add-credential --client -f maas-creds.yaml maas-one

juju bootstrap --bootstrap-series=jammy --constraints tags=juju maas-one maas-controller --debug

and I got error

22:40:42 INFO  cmd bootstrap.go:187 Launching controller instance(s) on maas-one/default...
22:40:42 DEBUG juju.provider.maas environ.go:685 attempting to acquire node in zone "default"
22:40:42 ERROR juju.cmd.juju.commands bootstrap.go:985 failed to bootstrap model: cannot start bootstrap instance in availability zone "default": failed to acquire node: No available machine matches constraints: [('agent_name', ['fdb19c90-25c7-4981-8039-be46888ac5df']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")
22:40:42 DEBUG juju.cmd.juju.commands bootstrap.go:986 (error details: [{github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run:1084: failed to bootstrap model} {github.com/juju/juju/environs/bootstrap.Bootstrap:738: } {github.com/juju/juju/environs/bootstrap.bootstrapIAAS:590: } {github.com/juju/juju/provider/common.BootstrapInstance:312: cannot start bootstrap instance in availability zone "default"} {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:716: } {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:711: failed to acquire node} {No available machine matches constraints: [('agent_name', ['fdb19c90-25c7-4981-8039-be46888ac5df']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")}])
22:40:42 DEBUG juju.cmd.juju.commands bootstrap.go:1810 cleaning up after failed bootstrap

I try to gether tcp dump with API actions and I see response HTTP/1.1 409 Conflict

maas.log contain this string

2024-01-03T22:40:42.834926+00:00 maas maas.api: [info] Request from user admin to acquire a machine with constraints: [('agent_name', ['fdb19c90-25c7-4981-8039-be46888ac5df']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])]

Please can you say me what I’m doing wrong???

Hi @romul343 ,

What are the available machines in your MAAS env?


Only 2 machines

I guess that would explain

22:40:42 ERROR juju.cmd.juju.commands bootstrap.go:985 failed to bootstrap model: cannot start bootstrap instance in availability zone "default": failed to acquire node: No available machine matches constraints: [('agent_name', ['fdb19c90-25c7-4981-8039-be46888ac5df']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")

as you need another machine

I’m create additional VM for juju but i got the same error

10:25:55 DEBUG juju.provider.maas environ.go:685 attempting to acquire node in zone "default"
10:25:55 ERROR juju.cmd.juju.commands bootstrap.go:985 failed to bootstrap model: cannot start bootstrap instance in availability zone "default": failed to acquire node: No available machine matches constraints: [('agent_name', ['869a27d2-49ce-4ed7-80ae-6afcdf17e726']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")
10:25:55 DEBUG juju.cmd.juju.commands bootstrap.go:986 (error details: [{github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run:1084: failed to bootstrap model} {github.com/juju/juju/environs/bootstrap.Bootstrap:738: } {github.com/juju/juju/environs/bootstrap.bootstrapIAAS:590: } {github.com/juju/juju/provider/common.BootstrapInstance:312: cannot start bootstrap instance in availability zone "default"} {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:716: } {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:711: failed to acquire node} {No available machine matches constraints: [('agent_name', ['869a27d2-49ce-4ed7-80ae-6afcdf17e726']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")}])
10:25:55 DEBUG juju.cmd.juju.commands bootstrap.go:1810 cleaning up after failed bootstrap

If you are running

juju bootstrap --bootstrap-series=jammy --constraints tags=juju maas-one maas-controller --debug

you missed to tag the new machine with the tag “juju”

full debug

$ juju bootstrap --bootstrap-series=jammy --constraints tags=juju maas-one maas-controller --debug
10:25:52 INFO  juju.cmd supercommand.go:56 running juju [3.2.4 3052b293cbab49b1a2f994724d2c90e80954cfe3 gc go1.20.11]
10:25:52 DEBUG juju.cmd supercommand.go:57   args: []string{"/snap/juju/25443/bin/juju", "bootstrap", "--bootstrap-series=jammy", "--constraints", "tags=juju", "maas-one", "maas-controller", "--debug"}
10:25:52 DEBUG juju.cmd.juju.commands bootstrap.go:1409 authenticating with region "" and credential "admin" ()
10:25:52 DEBUG juju.cmd.juju.commands bootstrap.go:1568 provider attrs: map[]
10:25:54 INFO  cmd authkeys.go:113 Adding contents of "/home/ubuntu/.local/share/juju/ssh/juju_id_rsa.pub" to authorized-keys
10:25:54 DEBUG juju.cmd.juju.commands bootstrap.go:1653 preparing controller with config: map[agent-metadata-url: agent-stream:released apt-ftp-proxy: apt-http-proxy: apt-https-proxy: apt-mirror: apt-no-proxy: authorized-keys:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCehhorVQI4RrW4jrXAKclVq+wPfFzIdszI2pNl0Cbkox7S8kfcTzJD1bfp1n2EeYJA1LeX11RSqCK2iUG1EsBPHGp51Nr7z3CzjmfkpggqkjL3qviYgoxcTmWTm85uyHc5PNsQ1WhiEbCOlfqLEqn+XyqdUE3tBycfKK3YgHrH6OQJn8r2nKxv4E+HoXsKWXQJ//kdTLzC3ajxv39+zI279xwC8GxjwY8OPcNguu1/xVZcqA1dHTmgLN2H3k7ZA4DDdTXqZ0s6qr+UIMKeq0JTMgr+RKXIBoIMTdqjB/9WDZxerCI2CUbHOtWmYHNBvYRW9UhPWIHN1f3Tp7zCGpxp2V8Cb/fXNh6LjR6+jyWtuh6ok5wBZvpF5jkx5nTzAINpD6T3Xc56Ebmeuk3+2p26lxQ4mp8MEyUVamV73UaQRwNRFkp5t1mQAgpqF25t3jcgL7rLIQ/Q3CYzPTFudZGIFZNLSGFkqzgRMy4+6UwjD6t3bwaFOaEZNTU/Na/fOt4afmSs3u8iI6P6yMF8u3garlKYIj1BAdc7eJASZg5vB4vme0hVGTdZikRIb3hxGBs1rkkRyru9CYSLj+ebl+Rv9r+AdTHdVErWpJ2s2ad8nr+J3KHMb/fs60FidHGB1nMHmdk9TRB2qrhvXsys5l04zXLKc7vjp5WraKgbZqVS3Q== juju-client-key
 automatically-retry-hooks:true backup-dir: charmhub-url:https://api.charmhub.io cloudinit-userdata: container-image-metadata-url: container-image-stream:released container-inherit-properties: container-networking-method: default-base: default-space: development:false disable-network-management:false disable-telemetry:false egress-subnets: enable-os-refresh-update:true enable-os-upgrade:true fan-config: firewall-mode:instance ftp-proxy: http-proxy: https-proxy: ignore-machine-addresses:false image-metadata-url: image-stream:released juju-ftp-proxy: juju-http-proxy: juju-https-proxy: juju-no-proxy:127.0.0.1,localhost,::1 logforward-enabled:false logging-config: logging-output: lxd-snap-channel:5.0/stable max-action-results-age:336h max-action-results-size:5G max-status-history-age:336h max-status-history-size:5G mode:requires-prompts name:controller net-bond-reconfigure-delay:17 no-proxy:127.0.0.1,localhost,::1 num-container-provision-workers:4 num-provision-workers:16 provisioner-harvest-mode:destroyed proxy-ssh:false resource-tags: saas-ingress-allow:0.0.0.0/0,::/0 secret-backend:auto snap-http-proxy: snap-https-proxy: snap-store-assertions: snap-store-proxy: snap-store-proxy-url: ssh-allow:0.0.0.0/0,::/0 ssl-hostname-verification:true test-mode:false transmit-vendor-metrics:true type:maas update-status-hook-interval:5m uuid:869a27d2-49ce-4ed7-80ae-6afcdf17e726]
10:25:54 DEBUG juju.provider.maas environprovider.go:63 opening model "controller".
10:25:54 INFO  cmd bootstrap.go:956 Creating Juju controller "maas-controller" on maas-one/default
10:25:54 INFO  juju.cmd.juju.commands bootstrap.go:1027 combined bootstrap constraints: tags=juju
10:25:54 DEBUG juju.environs.bootstrap bootstrap.go:326 model "controller" supports application/machine networks: true
10:25:54 DEBUG juju.environs.bootstrap bootstrap.go:328 network management by juju enabled: true
10:25:54 INFO  cmd bootstrap.go:409 Loading image metadata
10:25:54 INFO  cmd bootstrap.go:475 Looking for packaged Juju agent version 3.2.4 for amd64
10:25:54 INFO  juju.environs.bootstrap tools.go:78 looking for bootstrap agent binaries: version=3.2.4
10:25:54 DEBUG juju.environs.tools tools.go:87 finding agent binaries in stream: "released"
10:25:54 DEBUG juju.environs.tools tools.go:89 reading agent binaries with major.minor version 3.2
10:25:54 DEBUG juju.environs.tools tools.go:98 filtering agent binaries by version: 3.2.4
10:25:54 DEBUG juju.environs.tools tools.go:101 filtering agent binaries by os type: ubuntu
10:25:54 DEBUG juju.environs.tools tools.go:104 filtering agent binaries by architecture: amd64
10:25:54 DEBUG juju.environs.tools urls.go:133 trying datasource "keystone catalog"
10:25:54 DEBUG juju.environs.simplestreams simplestreams.go:417 searching for signed metadata in datasource "default simplestreams"
10:25:54 DEBUG juju.environs.simplestreams simplestreams.go:451 looking for data index using path streams/v1/index2.sjson
10:25:55 DEBUG juju.environs.simplestreams simplestreams.go:747 using default candidate for content id "com.ubuntu.juju:released:agents" are {20210329 mirrors:1.0 content-download streams/v1/cpc-mirrors-agents.sjson []}
10:25:55 DEBUG juju.environs.simplestreams simplestreams.go:463 looking for data index using URL https://streams.canonical.com/juju/tools/streams/v1/index2.sjson
10:25:55 DEBUG juju.environs.simplestreams simplestreams.go:486 read metadata index at "https://streams.canonical.com/juju/tools/streams/v1/index2.sjson"
10:25:55 DEBUG juju.environs.simplestreams simplestreams.go:1018 finding products at path "streams/v1/com.ubuntu.juju-released-agents.sjson"
10:25:55 INFO  juju.environs.bootstrap tools.go:80 found 1 packaged agent binaries
10:25:55 INFO  cmd bootstrap.go:488 Located Juju agent version 3.2.4-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/3.2.4/juju-3.2.4-linux-amd64.tgz
10:25:55 INFO  cmd bootstrap.go:586 Starting new instance for initial controller
10:25:55 INFO  cmd bootstrap.go:187 Launching controller instance(s) on maas-one/default...
10:25:55 DEBUG juju.provider.maas environ.go:685 attempting to acquire node in zone "default"
10:25:55 ERROR juju.cmd.juju.commands bootstrap.go:985 failed to bootstrap model: cannot start bootstrap instance in availability zone "default": failed to acquire node: No available machine matches constraints: [('agent_name', ['869a27d2-49ce-4ed7-80ae-6afcdf17e726']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")
10:25:55 DEBUG juju.cmd.juju.commands bootstrap.go:986 (error details: [{github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run:1084: failed to bootstrap model} {github.com/juju/juju/environs/bootstrap.Bootstrap:738: } {github.com/juju/juju/environs/bootstrap.bootstrapIAAS:590: } {github.com/juju/juju/provider/common.BootstrapInstance:312: cannot start bootstrap instance in availability zone "default"} {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:716: } {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:711: failed to acquire node} {No available machine matches constraints: [('agent_name', ['869a27d2-49ce-4ed7-80ae-6afcdf17e726']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")}])
10:25:55 DEBUG juju.cmd.juju.commands bootstrap.go:1810 cleaning up after failed bootstrap
10:25:55 INFO  juju.provider.common destroy.go:21 destroying model "controller"
10:25:55 INFO  juju.provider.common destroy.go:32 destroying instances
10:25:56 INFO  juju.provider.common destroy.go:56 destroying storage
10:25:56 INFO  cmd supercommand.go:535 command finished
ubuntu@juju:~$ juju bootstrap --bootstrap-series=jammy --constraints tags=juju maas-one maas-controller --debug
11:22:53 INFO  juju.cmd supercommand.go:56 running juju [3.2.4 3052b293cbab49b1a2f994724d2c90e80954cfe3 gc go1.20.11]
11:22:53 DEBUG juju.cmd supercommand.go:57   args: []string{"/snap/juju/25443/bin/juju", "bootstrap", "--bootstrap-series=jammy", "--constraints", "tags=juju", "maas-one", "maas-controller", "--debug"}
11:22:53 DEBUG juju.cmd.juju.commands bootstrap.go:1409 authenticating with region "" and credential "admin" ()
11:22:53 DEBUG juju.cmd.juju.commands bootstrap.go:1568 provider attrs: map[]
11:22:53 INFO  cmd authkeys.go:113 Adding contents of "/home/ubuntu/.local/share/juju/ssh/juju_id_rsa.pub" to authorized-keys
11:22:53 DEBUG juju.cmd.juju.commands bootstrap.go:1653 preparing controller with config: map[agent-metadata-url: agent-stream:released apt-ftp-proxy: apt-http-proxy: apt-https-proxy: apt-mirror: apt-no-proxy: authorized-keys:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCehhorVQI4RrW4jrXAKclVq+wPfFzIdszI2pNl0Cbkox7S8kfcTzJD1bfp1n2EeYJA1LeX11RSqCK2iUG1EsBPHGp51Nr7z3CzjmfkpggqkjL3qviYgoxcTmWTm85uyHc5PNsQ1WhiEbCOlfqLEqn+XyqdUE3tBycfKK3YgHrH6OQJn8r2nKxv4E+HoXsKWXQJ//kdTLzC3ajxv39+zI279xwC8GxjwY8OPcNguu1/xVZcqA1dHTmgLN2H3k7ZA4DDdTXqZ0s6qr+UIMKeq0JTMgr+RKXIBoIMTdqjB/9WDZxerCI2CUbHOtWmYHNBvYRW9UhPWIHN1f3Tp7zCGpxp2V8Cb/fXNh6LjR6+jyWtuh6ok5wBZvpF5jkx5nTzAINpD6T3Xc56Ebmeuk3+2p26lxQ4mp8MEyUVamV73UaQRwNRFkp5t1mQAgpqF25t3jcgL7rLIQ/Q3CYzPTFudZGIFZNLSGFkqzgRMy4+6UwjD6t3bwaFOaEZNTU/Na/fOt4afmSs3u8iI6P6yMF8u3garlKYIj1BAdc7eJASZg5vB4vme0hVGTdZikRIb3hxGBs1rkkRyru9CYSLj+ebl+Rv9r+AdTHdVErWpJ2s2ad8nr+J3KHMb/fs60FidHGB1nMHmdk9TRB2qrhvXsys5l04zXLKc7vjp5WraKgbZqVS3Q== juju-client-key
 automatically-retry-hooks:true backup-dir: charmhub-url:https://api.charmhub.io cloudinit-userdata: container-image-metadata-url: container-image-stream:released container-inherit-properties: container-networking-method: default-base: default-space: development:false disable-network-management:false disable-telemetry:false egress-subnets: enable-os-refresh-update:true enable-os-upgrade:true fan-config: firewall-mode:instance ftp-proxy: http-proxy: https-proxy: ignore-machine-addresses:false image-metadata-url: image-stream:released juju-ftp-proxy: juju-http-proxy: juju-https-proxy: juju-no-proxy:127.0.0.1,localhost,::1 logforward-enabled:false logging-config: logging-output: lxd-snap-channel:5.0/stable max-action-results-age:336h max-action-results-size:5G max-status-history-age:336h max-status-history-size:5G mode:requires-prompts name:controller net-bond-reconfigure-delay:17 no-proxy:127.0.0.1,localhost,::1 num-container-provision-workers:4 num-provision-workers:16 provisioner-harvest-mode:destroyed proxy-ssh:false resource-tags: saas-ingress-allow:0.0.0.0/0,::/0 secret-backend:auto snap-http-proxy: snap-https-proxy: snap-store-assertions: snap-store-proxy: snap-store-proxy-url: ssh-allow:0.0.0.0/0,::/0 ssl-hostname-verification:true test-mode:false transmit-vendor-metrics:true type:maas update-status-hook-interval:5m uuid:d289a47e-12a3-4a93-884d-349a618881b7]
11:22:53 DEBUG juju.provider.maas environprovider.go:63 opening model "controller".
11:22:53 INFO  cmd bootstrap.go:956 Creating Juju controller "maas-controller" on maas-one/default
11:22:53 INFO  juju.cmd.juju.commands bootstrap.go:1027 combined bootstrap constraints: tags=juju
11:22:53 DEBUG juju.environs.bootstrap bootstrap.go:326 model "controller" supports application/machine networks: true
11:22:53 DEBUG juju.environs.bootstrap bootstrap.go:328 network management by juju enabled: true
11:22:53 INFO  cmd bootstrap.go:409 Loading image metadata
11:22:53 INFO  cmd bootstrap.go:475 Looking for packaged Juju agent version 3.2.4 for amd64
11:22:53 INFO  juju.environs.bootstrap tools.go:78 looking for bootstrap agent binaries: version=3.2.4
11:22:53 DEBUG juju.environs.tools tools.go:87 finding agent binaries in stream: "released"
11:22:53 DEBUG juju.environs.tools tools.go:89 reading agent binaries with major.minor version 3.2
11:22:53 DEBUG juju.environs.tools tools.go:98 filtering agent binaries by version: 3.2.4
11:22:53 DEBUG juju.environs.tools tools.go:101 filtering agent binaries by os type: ubuntu
11:22:53 DEBUG juju.environs.tools tools.go:104 filtering agent binaries by architecture: amd64
11:22:53 DEBUG juju.environs.tools urls.go:133 trying datasource "keystone catalog"
11:22:53 DEBUG juju.environs.simplestreams simplestreams.go:417 searching for signed metadata in datasource "default simplestreams"
11:22:53 DEBUG juju.environs.simplestreams simplestreams.go:451 looking for data index using path streams/v1/index2.sjson
11:22:53 DEBUG juju.environs.simplestreams simplestreams.go:747 using default candidate for content id "com.ubuntu.juju:released:agents" are {20210329 mirrors:1.0 content-download streams/v1/cpc-mirrors-agents.sjson []}
11:22:54 DEBUG juju.environs.simplestreams simplestreams.go:463 looking for data index using URL https://streams.canonical.com/juju/tools/streams/v1/index2.sjson
11:22:54 DEBUG juju.environs.simplestreams simplestreams.go:486 read metadata index at "https://streams.canonical.com/juju/tools/streams/v1/index2.sjson"
11:22:54 DEBUG juju.environs.simplestreams simplestreams.go:1018 finding products at path "streams/v1/com.ubuntu.juju-released-agents.sjson"
11:22:54 INFO  juju.environs.bootstrap tools.go:80 found 1 packaged agent binaries
11:22:54 INFO  cmd bootstrap.go:488 Located Juju agent version 3.2.4-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/3.2.4/juju-3.2.4-linux-amd64.tgz
11:22:54 INFO  cmd bootstrap.go:586 Starting new instance for initial controller
11:22:54 INFO  cmd bootstrap.go:187 Launching controller instance(s) on maas-one/default...
11:22:54 DEBUG juju.provider.maas environ.go:685 attempting to acquire node in zone "default"
11:22:54 ERROR juju.cmd.juju.commands bootstrap.go:985 failed to bootstrap model: cannot start bootstrap instance in availability zone "default": failed to acquire node: No available machine matches constraints: [('agent_name', ['d289a47e-12a3-4a93-884d-349a618881b7']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")
11:22:54 DEBUG juju.cmd.juju.commands bootstrap.go:986 (error details: [{github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run:1084: failed to bootstrap model} {github.com/juju/juju/environs/bootstrap.Bootstrap:738: } {github.com/juju/juju/environs/bootstrap.bootstrapIAAS:590: } {github.com/juju/juju/provider/common.BootstrapInstance:312: cannot start bootstrap instance in availability zone "default"} {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:716: } {github.com/juju/juju/provider/maas.(*maasEnviron).StartInstance:711: failed to acquire node} {No available machine matches constraints: [('agent_name', ['d289a47e-12a3-4a93-884d-349a618881b7']), ('mem', ['3584']), ('tags', ['juju']), ('zone', ['default'])] (resolved to "mem=3584.0 tags=juju zone=default")}])
11:22:54 DEBUG juju.cmd.juju.commands bootstrap.go:1810 cleaning up after failed bootstrap
11:22:54 INFO  juju.provider.common destroy.go:21 destroying model "controller"
11:22:54 INFO  juju.provider.common destroy.go:32 destroying instances
11:22:54 INFO  juju.provider.common destroy.go:56 destroying storage
11:22:54 INFO  cmd supercommand.go:535 command finished

did you tag the machine “juju-init.maas” with the tag “juju”?

That’s a deployed machine. You need a Ready machine that juju can use

You need a Ready machine that juju can use

That is solution of poblem.
Big thanks and Happy New Year

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.