Comment 3 for bug 1971190

Revision history for this message
Stéphane Graber (stgraber) wrote : Re: Machine constrain to target a cluster member when deploying to LXD

```
root@juju01:~# juju deploy lxd -n 3 --config mode=cluster --constraints zones=cluster03,cluster03,cluster03
Located charm "lxd" in charm-hub, revision 168
Deploying "lxd" from charm-hub charm "lxd", revision 168 in channel stable on focal
```

```
controller-0: 18:25:56 INFO juju.worker.provisioner provisioning in zones: [cluster01 cluster02 cluster03 cluster04 cluster05 cluster06]
controller-0: 18:25:56 INFO juju.worker.provisioner found machine pending provisioning id:11, details:11
controller-0: 18:25:57 INFO juju.worker.provisioner provisioning in zones: [cluster01 cluster02 cluster03 cluster04 cluster05 cluster06]
controller-0: 18:25:57 INFO juju.worker.provisioner found machine pending provisioning id:12, details:12
controller-0: 18:25:57 INFO juju.worker.provisioner trying machine 11 StartInstance in availability zone cluster03
controller-0: 18:25:58 INFO juju.worker.provisioner provisioning in zones: [cluster01 cluster02 cluster03 cluster04 cluster05 cluster06]
controller-0: 18:25:58 INFO juju.worker.provisioner found machine pending provisioning id:13, details:13
controller-0: 18:25:58 INFO juju.worker.provisioner trying machine 12 StartInstance in availability zone cluster03
controller-0: 18:25:58 INFO juju.worker.provisioner trying machine 13 StartInstance in availability zone cluster03
controller-0: 18:26:06 INFO juju.worker.provisioner started machine 11 as instance juju-378e3e-11 with hardware "arch=amd64 cores=0 mem=0M", network config [], volumes [], volume attachments map[], subnets to zones [], lxd profiles []
controller-0: 18:26:07 INFO juju.worker.provisioner started machine 12 as instance juju-378e3e-12 with hardware "arch=amd64 cores=0 mem=0M", network config [], volumes [], volume attachments map[], subnets to zones [], lxd profiles []
controller-0: 18:26:08 INFO juju.worker.instancemutater.environ no changes necessary to machine-12 lxd profiles ([default juju-default])
controller-0: 18:26:08 INFO juju.worker.instancemutater.environ no changes necessary to machine-11 lxd profiles ([default juju-default])
controller-0: 18:26:09 INFO juju.worker.instancepoller machine "11" (instance ID "juju-378e3e-11") instance status changed from {"running" "Container started"} to {"running" "Running"}
controller-0: 18:26:09 INFO juju.worker.instancepoller machine "11" (instance ID "juju-378e3e-11") has new addresses: [local-fan:240.12.0.139@alpha]
controller-0: 18:26:09 INFO juju.worker.instancepoller machine "12" (instance ID "juju-378e3e-12") instance status changed from {"running" "Container started"} to {"running" "Running"}
controller-0: 18:26:10 INFO juju.worker.instancepoller machine "12" (instance ID "juju-378e3e-12") has new addresses: [local-fan:240.17.0.11@alpha]
controller-0: 18:26:38 INFO juju.worker.provisioner started machine 13 as instance juju-378e3e-13 with hardware "arch=amd64 cores=0 mem=0M", network config [], volumes [], volume attachments map[], subnets to zones [], lxd profiles []
controller-0: 18:26:43 INFO juju.worker.instancemutater.environ no changes necessary to machine-13 lxd profiles ([default juju-default])
controller-0: 18:26:46 INFO juju.worker.instancepoller machine "13" (instance ID "juju-378e3e-13") instance status changed from {"running" "Container started"} to {"running" "Running"}
controller-0: 18:26:47 INFO juju.worker.instancepoller machine "13" (instance ID "juju-378e3e-13") has new addresses: [local-fan:240.29.0.80@alpha]
```

```
root@cluster01:~# lxc list juju-378e3e-1
+----------------+---------+---------------------+------+-----------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | LOCATION |
+----------------+---------+---------------------+------+-----------+-----------+-----------+
| juju-378e3e-11 | RUNNING | 240.12.0.139 (eth0) | | CONTAINER | 0 | cluster03 |
+----------------+---------+---------------------+------+-----------+-----------+-----------+
| juju-378e3e-12 | RUNNING | 240.17.0.11 (eth0) | | CONTAINER | 0 | cluster04 |
+----------------+---------+---------------------+------+-----------+-----------+-----------+
| juju-378e3e-13 | RUNNING | 240.29.0.80 (eth0) | | CONTAINER | 0 | cluster06 |
+----------------+---------+---------------------+------+-----------+-----------+-----------+
```

So with zones= we can see that Juju understands the zones= and does attempt to throw things at cluster03 but then when making the LXD call, it appears to be missing the UseTarget() call needed to actually target the correct machines.
```