1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

F #6057: Add I/O limit options to backup DS (#2456)

(cherry picked from commit 6c42dfed9ea860303b3bab04bac862cb1c4a85a7)
This commit is contained in:
Frederick Borges 2023-01-24 11:20:20 +01:00 committed by Tino Vázquez
parent 2c4922afa4
commit 65f34251dc
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 135 additions and 0 deletions

View File

@ -291,8 +291,16 @@ define(function(require) {
var restic_bwlimit = $('#restic_bwlimit', dialog).val();
var restic_compression = $('#restic_compression', dialog).val();
var restic_connections = $('#restic_connections', dialog).val();
var restic_max_riops = $('#restic_max_riops', dialog).val();
var restic_max_wiops = $('#restic_max_wiops', dialog).val();
var restic_cpu_quota = $('#restic_cpu_quota', dialog).val();
var rsync_host = $('#rsync_host', dialog).val();
var rsync_user = $('#rsync_user', dialog).val();
var rsync_ionice = $('#rsync_ionice', dialog).val();
var rsync_nice = $('#rsync_nice', dialog).val();
var rsync_max_riops = $('#rsync_max_riops', dialog).val();
var rsync_max_wiops = $('#rsync_max_wiops', dialog).val();
var rsync_cpu_quota = $('#rsync_cpu_quota', dialog).val();
var ds_obj = {
"datastore" : {
@ -405,12 +413,36 @@ define(function(require) {
if (restic_connections)
ds_obj.datastore.restic_connections = restic_connections;
if (restic_max_riops)
ds_obj.datastore.restic_max_riops = restic_max_riops
if (restic_max_wiops)
ds_obj.datastore.restic_max_wiops = restic_max_wiops;
if (restic_cpu_quota)
ds_obj.datastore.restic_cpu_quota = restic_cpu_quota;
if (rsync_host)
ds_obj.datastore.rsync_host = rsync_host;
if (rsync_user)
ds_obj.datastore.rsync_user = rsync_user;
if (rsync_ionice)
ds_obj.datastore.rsync_ionice = rsync_ionice;
if (rsync_nice)
ds_obj.datastore.rsync_nice = rsync_nice;
if (rsync_max_riops)
ds_obj.datastore.rsync_max_riops = rsync_max_riops
if (rsync_max_wiops)
ds_obj.datastore.rsync_max_wiops = rsync_max_wiops;
if (rsync_cpu_quota)
ds_obj.datastore.rsync_cpu_quota = rsync_cpu_quota;
Sunstone.runAction("Datastore.create", ds_obj);
return false;
}
@ -467,8 +499,16 @@ define(function(require) {
$('label[for="restic_bwlimit"]', dialog).parent().hide();
$('label[for="restic_compression"]', dialog).parent().hide();
$('label[for="restic_connections"]', dialog).parent().hide();
$('label[for="restic_max_riops"]', dialog).parent().hide();
$('label[for="restic_max_wiops"]', dialog).parent().hide();
$('label[for="restic_cpu_quota"]', dialog).parent().hide();
$('label[for="rsync_host"]', dialog).parent().hide();
$('label[for="rsync_user"]', dialog).parent().hide();
$('label[for="rsync_ionice"]', dialog).parent().hide();
$('label[for="rsync_nice"]', dialog).parent().hide();
$('label[for="rsync_max_riops"]', dialog).parent().hide();
$('label[for="rsync_max_wiops"]', dialog).parent().hide();
$('label[for="rsync_cpu_quota"]', dialog).parent().hide();
$('input[name="ds_tab_custom_ds_mad"]', dialog).parent().hide();
$('input[name="ds_tab_custom_tm_mad"]', dialog).parent().hide();
@ -506,8 +546,16 @@ define(function(require) {
$('label[for="restic_bwlimit"]', dialog).parent().show();
$('label[for="restic_compression"]', dialog).parent().show();
$('label[for="restic_connections"]', dialog).parent().show();
$('label[for="restic_max_riops"]', dialog).parent().show();
$('label[for="restic_max_wiops"]', dialog).parent().show();
$('label[for="restic_cpu_quota"]', dialog).parent().show();
$('label[for="rsync_host"]', dialog).parent().show();
$('label[for="rsync_user"]', dialog).parent().show();
$('label[for="rsync_ionice"]', dialog).parent().show();
$('label[for="rsync_nice"]', dialog).parent().show();
$('label[for="rsync_max_riops"]', dialog).parent().show();
$('label[for="rsync_max_wiops"]', dialog).parent().show();
$('label[for="rsync_cpu_quota"]', dialog).parent().show();
$('input[name="ds_tab_custom_ds_mad"]', dialog).parent().show();
$('input[name="ds_tab_custom_tm_mad"]', dialog).parent().show();
@ -624,6 +672,9 @@ define(function(require) {
$('label[for="restic_bwlimit"]', dialog).parent().fadeIn();
$('label[for="restic_compression"]', dialog).parent().fadeIn();
$('label[for="restic_connections"]', dialog).parent().fadeIn();
$('label[for="restic_max_riops"]', dialog).parent().fadeIn();
$('label[for="restic_max_wiops"]', dialog).parent().fadeIn();
$('label[for="restic_cpu_quota"]', dialog).parent().fadeIn();
}
function _selectRsync(dialog) {
@ -637,6 +688,11 @@ define(function(require) {
$('label[for="vcenter_cluster"],div#vcenter_cluster_wrapper', dialog).parent().hide();
$('label[for="rsync_host"]', dialog).parent().fadeIn();
$('label[for="rsync_user"]', dialog).parent().fadeIn();
$('label[for="rsync_ionice"]', dialog).parent().fadeIn();
$('label[for="rsync_nice"]', dialog).parent().fadeIn();
$('label[for="rsync_max_riops"]', dialog).parent().fadeIn();
$('label[for="rsync_max_wiops"]', dialog).parent().fadeIn();
$('label[for="rsync_cpu_quota"]', dialog).parent().fadeIn();
}
function _selectCustom(dialog) {

View File

@ -325,6 +325,36 @@
<input type="number" name="restic_connections" id="restic_connections"/>
</div>
<div class="medium-6 columns">
<label for="restic_max_riops">
{{tr "Max Read IOPS"}}
<span class="tip">
{{tr "Run backups in a systemd slice, limiting the max number of read iops"}}
</span>
</label>
<input type="number" name="restic_max_riops" id="restic_max_riops"/>
</div>
<div class="medium-6 columns">
<label for="restic_max_wiops">
{{tr "Max Write IOPS"}}
<span class="tip">
{{tr "Run backups in a systemd slice, limiting the max number of write iops"}}
</span>
</label>
<input type="number" name="restic_max_wiops" id="restic_max_wiops"/>
</div>
<div class="medium-6 columns">
<label for="restic_cpu_quota">
{{tr "CPU Quota"}}
<span class="tip">
{{tr "Run backups in a systemd slice with a given cpu quota (percentage). Use > 100 for using several CPUs"}}
</span>
</label>
<input type="number" name="restic_cpu_quota" id="restic_cpu_quota"/>
</div>
<!-- RSYNC ATTRIBUTES -->
<div class="medium-6 columns">
<label for="rsync_host">
@ -340,6 +370,55 @@
<input type="text" name="rsync_user" id="rsync_user"/>
</div>
<div class="medium-6 columns">
<label for="rsync_ionice">
{{tr "Backup I/O Priority"}}
<span class="tip">
{{tr "Run restic operations under a given ionice priority using the best-effort I/O scheduler"}}
</span>
</label>
<input type="number" name="rsync_ionice" id="rsync_ionice" min="0" max="7" />
</div>
<div class="medium-6 columns">
<label for="rsync_nice">
{{tr "Backup CPU Priority"}}
<span class="tip">
{{tr "Run restic operations with a given scheduler priority (nice)"}}
</span>
</label>
<input type="number" name="rsync_nice" id="rsync_nice" min="1" max="19" />
</div>
<div class="medium-6 columns">
<label for="rsync_max_riops">
{{tr "Max Read IOPS"}}
<span class="tip">
{{tr "Run backups in a systemd slice, limiting the max number of read iops"}}
</span>
</label>
<input type="number" name="rsync_max_riops" id="rsync_max_riops"/>
</div>
<div class="medium-6 columns">
<label for="rsync_max_wiops">
{{tr "Max Write IOPS"}}
<span class="tip">
{{tr "Run backups in a systemd slice, limiting the max number of write iops"}}
</span>
</label>
<input type="number" name="rsync_max_wiops" id="rsync_max_wiops"/>
</div>
<div class="medium-6 columns">
<label for="rsync_cpu_quota">
{{tr "CPU Quota"}}
<span class="tip">
{{tr "Run backups in a systemd slice with a given cpu quota (percentage). Use > 100 for using several CPUs"}}
</span>
</label>
<input type="number" name="rsync_cpu_quota" id="rsync_cpu_quota"/>
</div>
</div>
<div class="ceph_advanced">
{{#advancedSection (tr "Advanced options") }}