[pve-devel] [PATCH manager] ceph: pool edit: set target ratio to 0 when the value is unset

Fiona Ebner f.ebner at proxmox.com
Wed Mar 6 16:08:46 CET 2024


Am 06.03.24 um 15:14 schrieb Maximiliano Sandoval:
> If the pool has a target_size_ratio set it might be desirable to unset
> its value, e.g. if set by mistake on .mgr.
> 
> Currently unsetting the value won't do anything in the web UI. With this
> patch it is set to zero, which the API correctly understands and unsets
> it.
> 
> one can verify the value set using
> 
>     $ ceph osd pool get <POOL_NAME> target_size_ratio
> 
> after setting the valut to 0 through the API it will output
> 
>     Error ENOENT: option 'target_size_ratio' is not set on pool 'cephfs-test_data'
> 
> Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
> ---
>  www/manager6/ceph/Pool.js | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
> index c61d4f71..224f3cea 100644
> --- a/www/manager6/ceph/Pool.js
> +++ b/www/manager6/ceph/Pool.js
> @@ -226,7 +226,11 @@ Ext.define('PVE.CephPoolInputPanel', {
>      onGetValues: function(values) {
>  	Object.keys(values || {}).forEach(function(name) {
>  	    if (values[name] === '') {
> -		delete values[name];
> +		if (name === 'target_size_ratio') {
> +		    values[name] = 0;
> +		} else {
> +		    delete values[name];
> +		}
>  	    }
>  	});
>  

It might be cleaner to just use
emptyValue: 0,
in the field declaration like is already done for the "Target Size"
field. And the same issue is also present for the "Min. # of PGs" field,
right?




More information about the pve-devel mailing list