11Title: Constraints
22
3+
34# Constraints
45
56Constraints allow you to choose the hardware (or virtual hardware)
@@ -14,6 +15,7 @@ For more granularity, it is also possible to add a machine with specific
1415constraints (` juju add-machine ` ) and then specify that machine when deploying
1516applications ([ see the documentation on ` juju deploy ` ] ( ./charms-deploying.html ) ).
1617
18+
1719## What constraints can be used?
1820
1921There is a full list of the constraints used
@@ -74,7 +76,7 @@ juju deploy mariadb --constraints mem=4G cpu-cores=
7476
7577In the event that a constraint cannot be met, the unit will not be deployed.
7678
77- !!!Note: Constraints work on an "or better" basis: If you ask for 4 CPUs, you
79+ !!! Note: Constraints work on an "or better" basis: If you ask for 4 CPUs, you
7880may get 8, but you won't get 2
7981
8082
@@ -121,6 +123,7 @@ juju set-model-constraints mem=
121123Model-related constraints can also be overridden at the application and machine
122124level.
123125
126+
124127## Setting constraints for an application
125128
126129Usually, constraints for an application are set at deploy time, by passing the
@@ -153,6 +156,7 @@ juju get-constraints mariadb
153156juju get-constraints database1
154157```
155158
159+
156160## Adding a machine with constraints
157161
158162The ` juju add-machine ` command also accepts the '--constraints' flag, which can
@@ -168,4 +172,3 @@ Will provision a machine that is connected to both the 'storage' and 'db'
168172network spaces. You can subsequently deploy applications to this machine using
169173the '--to' placement switch -
170174[ see the documentation on deploying charms] ( ./charms-deploying.html )
171-
0 commit comments