Machine constraint to target a cluster member when deploying to LXD

Bug #1971190 reported by Simon Déziel
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Wishlist
Unassigned

Bug Description

When launching instances on a LXD cluster, one can either let the cluster decide on the instance's placement or request a specific cluster member to be the target. Here is how to do the explicit targeting with `lxc`:

```
lxc launch images:ubuntu/jammy my-lxd-cluster: --target nodeA
```

Having a Juju machine constraint to accomplish the same would be useful.

Simon Déziel (sdeziel)
tags: added: lxd-cloud
Revision history for this message
Stéphane Graber (stgraber) wrote :

Not a constraint but you can use the availability zones to achieve this.

root@juju01:~# juju add-machine zone=cluster05
created machine 3
root@juju01:~# juju status
Model Controller Cloud/Region Version SLA Timestamp
default nsec-default nsec/default 2.9.29 unsupported 17:32:00Z

Machine State DNS Inst id Series AZ Message
3 pending 240.28.0.167 juju-378e3e-3 focal Running

root@cluster01:~# lxc list juju-378e3e-3
+---------------+---------+---------------------+------+-----------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | LOCATION |
+---------------+---------+---------------------+------+-----------+-----------+-----------+
| juju-378e3e-3 | RUNNING | 240.28.0.167 (eth0) | | CONTAINER | 0 | cluster05 |
+---------------+---------+---------------------+------+-----------+-----------+-----------+

Revision history for this message
Stéphane Graber (stgraber) wrote :

To clarify, a `zone=NAME` during `add-machine` works properly, however one cannot use the `zones` contraint. Juju accepts it but then completely disregards it and deploys anywhere.

Revision history for this message
Stéphane Graber (stgraber) wrote :
Download full text (4.5 KiB)

```
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-...

Read more...

tags: added: constraints
Changed in juju:
importance: Undecided → Wishlist
tags: added: feature
Changed in juju:
status: New → Triaged
Revision history for this message
Vitaly Antonenko (anvial) wrote :

This is potentially an interesting constraint for the machine and could be discussed as a feature.

Simon Déziel (sdeziel)
summary: - Machine constrain to target a cluster member when deploying to LXD
+ Machine constraint to target a cluster member when deploying to LXD
description: updated
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.