juju assumes for HW resources
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Hi,
IS has faced a real issue https:/
due to differed assumes between charm developers and charm users.
TL:DR
- Data believes: "Entire unit RAM is for MySQL => 75% RAM used in my.cnf"
- IS deployed mysql VM charm and subordinated into +3 charms they need
- OOM killed mysqld due to no RAM left (as subordinates need RAM too)
Proposal: improve "juju assumes" to declare expected resources for the charm there.
In this case Juju can block deployment if HW constraints doesn't match.
Example 1:
mysql charm assumes:
> assumes:
> - memory = 4Gb
Juju user experience:
> juju deploy mysql --constrains mem=2GB
> Error: not enough memory to run `mysql` (minimum 4GB)
Example 2.1:
mysql charm assumes:
> assumes:
> - memory = 4Gb
landscape-client charm assumes:
> assumes:
> - memory = 1Gb
Juju user experience:
> juju deploy mysql --constrains mem=4GB
> juju deploy landscape-client # subordinated charm!
> juju relate mysql landscape-client
> Error: not enough memory to subordinate into `mysql` (minimum 5GB = mysql/4GB + landscape-
Having the charm resource expectations can help Juju to prevent out-of-resources issues.
P.S. Another option for example 2 above is to reconfigure MySQL (decrease memory usage on subordination):
Example 2.2:
mysql charm assumes:
> assumes:
> - memory = 4Gb
landscape-client charm assumes:
> assumes:
> - memory = 1Gb
Juju user experience:
> juju deploy mysql --constrains mem=4GB # MySQL uses 75% = 3GB
> juju deploy landscape-client # subordinated charm!
> juju relate mysql landscape-client
> # juju informs mysql about landscape-client resources expectations.
> # mysql charm is automatically reconfigured to use 2,25GB (75% of 4GB-1GB)
Tnx!
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
tags: | added: canonical-data-platform-eng |
The approach suggested here is not one that we will institute. Having the charm author prescribe assumptions that pre-empt usage of the charm in-theatre is not something we want.
We understand the issue and will discuss avenues to address it.
As it stands, constraints should be understood to affect *machine* selection. As such those applied to the primary unit should anticipate what subordinates will accompany it.