Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description for adjust_by_ram #1081

Merged
merged 5 commits into from
Mar 11, 2024
Merged

Conversation

ancorgs
Copy link
Member

@ancorgs ancorgs commented Mar 7, 2024

Problem

In Agama a volume can have automatic sizes based on one or several of the following reasons:

  • Snapshots
  • Fallbacks from other volumes (eg. "/" max size can exist or not based on the existence of "/home")
  • Size of the RAM

The three are already implemented and working. But the third one lacks the corresponding explanations.

No information icon in the "auto" label Incomplete sentence in the form
by_ram enlarge

Solution

This pull request introduces the missing messages, so now the proper information is displayed both in the table of volumes and in the form.

The "auto" label The form
ram-table ram-form

The message is "as good as it gets" for the time being. The plan is to add the size of the RAM to it, but for that we need to improve the Agama API as reflected at
https://trello.com/c/suiA6MzZ/354-agama-api-for-system-information-like-ram-size

Additionally, this pull request enables adjust_by_ram for swap at the Tumbleweed product, to raise awareness and get feedback.

About the approach

We can already foresee people asking "where is my 'Enlarge to RAM Size for Suspend' checkbox"? So let's explain how the approach has changed. That approach, not only for swap but for so-called volumes in general, is explained in the section "Automatic Size Limits" of the document describing the storage UI.

In the traditional YaST storage proposal users has no direct way to specify the size of the partitions/LVs being created. The product specifies the size limits. If those limits cannot be known beforehand because they depend on other factors, the product configuration specify those factors. All that is explained at the YaST configuration document, which details the usage of fallback_for_*, snapshots_size, snapshots_percentage and adjust_by_ram.

Since users cannot adjust the sizes directly, the mentioned checkbox "Enlarge to RAM Size for Suspend" was introduced as a way to influence them. But to be honest, it has been controversial from the beginning since determining the proper size for the swap partition is an extremely complex topic.

It's also worth noticing that swap is not the only volume that could use that setting. Some products may adapt the size of other file-systems based on the RAM size. For example, defining a bigger partition for "/" or "/var" in order to allocate the kernel dumps generated by kdump.

As explained in the document mentioned above: "so far the adaptation consists in ensuring all the sizes are, at least, as big as the RAM. In the future, an extra adjust_by_ram_mode option could be added to allow other approaches".

In Agama the philosophy of volumes is different in general. Users can always adapt any size limit if they know what they are doing. The product still provide sensible defaults (fixed or automatic) but the users can always tweak those sizes. The case of "enlarge to RAM size" fits quite well in that new philosophy. Users don't need to know the technical details about how swap and RAM sizes correlate (and suspend-to-ram is NOT the only reason, the topic goes way further). They can just trust the automatic proposal that will be good enough for most people or adjust the size limits if they know what they are doing.

If needed, we can extend the possibilities for the product in the future (for example, a configuration option to only observe RAM in case of physical machine, using fixed size limits for virtual machines).

Testing

Tested manually (see screenshots).

@coveralls
Copy link

coveralls commented Mar 8, 2024

Coverage Status

coverage: 74.145% (-0.02%) from 74.167%
when pulling 133076d on ancorgs:adjust_by_ram_hint
into 49dfd5b on openSUSE:master.

@ancorgs ancorgs changed the title [WIP] Description for adjust_by_ram Description for adjust_by_ram Mar 8, 2024
@ancorgs ancorgs marked this pull request as ready for review March 8, 2024 16:29
Copy link
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ancorgs ancorgs merged commit 704b693 into openSUSE:master Mar 11, 2024
4 checks passed
ancorgs added a commit that referenced this pull request Mar 18, 2024
#1097)

## Problem

As part of #1081, we enabled at the Tumbleweed configuration the
parameter `adjust_by_ram` for the outline of the swap volume.

But the feature is not really implemented yet because we have not
defined all the details of how we want it to work and how distribute the
logic between Agama itself and yast2-storage-ng (more details at this
[non-public Trello
card](https://trello.com/c/cki2gJ3b/366-agama-dynamic-sizes-based-on-ram)).
`AdjustByRam` was added to the definition of the outlines only as a
preliminary step, but we never went further and at this point in time
the user cannot actually adjust the size if "auto" is not wanted.

## Solution

Revert commit 9f537c6 until we
implement the feature in a more final (at least complete) way.
ancorgs added a commit that referenced this pull request Mar 22, 2024
…ust_by_ram (#1111)

## Problem

In Agama a volume can have automatic sizes based on one or several of
the following reasons:

- Snapshots
- Fallbacks from other volumes (eg. "/" max size can exist or not based
on the existence of "/home")
- Size of the RAM

But the third one was not working because it was impossible to set the
sizes manually for volumes with the property `adjust_by_ram` in their
corresponding outline.

## Solution

This sets the new YaST setting `ignore_adjust_by_ram` if the user has
decided to manually enforce sizes. So now it's possible to honor the
automatic size or to use custom sizes instead.

Using the automatic size

| The table | The form |
|-|-|
|
![table-auto](https://github.com/openSUSE/agama/assets/3638289/4f7d2b6f-b728-4d47-aca4-8321301e822a)
|
![form-auto](https://github.com/openSUSE/agama/assets/3638289/eb072fd2-011f-4eb8-8c02-1a218053254b)
|

Forcing manual sizes

| The table | The form |
|-|-|
|
![table-man](https://github.com/openSUSE/agama/assets/3638289/a25510fa-b4fd-40f4-bc4c-c096995a6c57)
|
![form-man](https://github.com/openSUSE/agama/assets/3638289/59994396-3627-4dac-b18b-5aa63ce0dbcc)
|



To get some background on how this functionality compares to the
traditional YaST checkbox "Enlarge to RAM Size for Suspend", see the
dedicated section at the description of
#1081.

Additionally, this pull request enables `adjust_by_ram` for swap at the
Tumbleweed product, to raise awareness and get feedback.

## Testing

- Added a new unit test
- Tested manually (see screenshots above)

## Dependencies

Needs yast/yast-storage-ng#1376 at
yast2-storage-ng, which implies the corresponding rpm dependency has
been updated.
@imobachgs imobachgs mentioned this pull request May 17, 2024
imobachgs added a commit that referenced this pull request May 17, 2024
Prepare for releasing Agama 8. It includes the following pull requests:

* #884
* #886
* #914
* #918
* #956
* #957
* #958
* #959
* #960
* #961
* #962
* #963
* #964
* #965
* #966
* #969
* #970
* #976
* #977
* #978
* #979
* #980
* #981
* #983
* #984
* #985
* #986
* #988
* #991
* #992
* #995
* #996
* #997
* #999
* #1003
* #1004
* #1006
* #1007
* #1008
* #1009
* #1010
* #1011
* #1012
* #1014
* #1015
* #1016
* #1017
* #1020
* #1022
* #1023
* #1024
* #1025
* #1027
* #1028
* #1029
* #1030
* #1031
* #1032
* #1033
* #1034
* #1035
* #1036
* #1038
* #1039
* #1041
* #1042
* #1043
* #1045
* #1046
* #1047
* #1048
* #1052
* #1054
* #1056
* #1057
* #1060
* #1061
* #1062
* #1063
* #1064
* #1066
* #1067
* #1068
* #1069
* #1071
* #1072
* #1073
* #1074
* #1075
* #1079
* #1080
* #1081
* #1082
* #1085
* #1086
* #1087
* #1088
* #1089
* #1090
* #1091
* #1092
* #1093
* #1094
* #1095
* #1096
* #1097
* #1098
* #1099
* #1100
* #1102
* #1103
* #1104
* #1105
* #1106
* #1109
* #1110
* #1111
* #1112
* #1114
* #1116
* #1117
* #1118
* #1119
* #1120
* #1121
* #1122
* #1123
* #1125
* #1126
* #1127
* #1128
* #1129
* #1130
* #1131
* #1132
* #1133
* #1134
* #1135
* #1136
* #1138
* #1139
* #1140
* #1141
* #1142
* #1143
* #1144
* #1145
* #1146
* #1147
* #1148
* #1149
* #1151
* #1152
* #1153
* #1154
* #1155
* #1156
* #1157
* #1158
* #1160
* #1161
* #1162
* #1163
* #1164
* #1165
* #1166
* #1167
* #1168
* #1169
* #1170
* #1171
* #1172
* #1173
* #1174
* #1175
* #1177
* #1178
* #1180
* #1181
* #1182
* #1183
* #1184
* #1185
* #1187
* #1188
* #1189
* #1190
* #1191
* #1192
* #1193
* #1194
* #1195
* #1196
* #1198
* #1199
* #1200
* #1201
* #1203
* #1204
* #1205
* #1206
* #1207
* #1208
* #1209
* #1210
* #1211
* #1212
* #1213
* #1214
* #1215
* #1216
* #1217
* #1219
* #1220
* #1221
* #1222
* #1223
* #1224
* #1225
* #1226
* #1227
* #1229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants