juju assumes for HW resources

Bug #2032918 reported by Alex Lutay
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Wishlist
Unassigned

Bug Description

Hi,

IS has faced a real issue https://github.com/canonical/mysql-operator/issues/299
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-client/1GB)

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
Revision history for this message
Joseph Phillips (manadart) wrote :

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.

tags: added: canonical-data-platform-eng
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.