Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
Add new options for migration throttling
Browse files Browse the repository at this point in the history
  • Loading branch information
mzazrivec committed Mar 6, 2019
1 parent 55ee3b8 commit ec17331
Showing 1 changed file with 94 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { reduxForm, Field } from 'redux-form';
import { Form, Button, Spinner } from 'patternfly-react';
import { Form, Button, Spinner, Switch } from 'patternfly-react';
import NumberInput from '../../../common/forms/NumberInput';

export class GeneralSettings extends React.Component {
Expand All @@ -27,10 +27,15 @@ export class GeneralSettings extends React.Component {
return (
<Spinner loading={isFetchingServers || isFetchingSettings} style={{ marginTop: 15 }}>
<div className="migration-settings">
<Form style={{ padding: '0 20px' }}>
<Form className="form-horizontal" style={{ padding: '0 20px' }}>
<div>
<h3>{__('Concurrent Migrations')}</h3>
</div>
<Form.FormGroup>
<Form.ControlLabel>{__('Maximum concurrent migrations per conversion host')}</Form.ControlLabel>
<div style={{ width: 100 }}>
<Form.ControlLabel className="col-md-4">
{__('Maximum concurrent migrations per conversion host')}
</Form.ControlLabel>
<div className="col-md-2">
<Field
id="max_concurrent_tasks_per_host"
name="max_concurrent_tasks_per_host"
Expand All @@ -41,10 +46,94 @@ export class GeneralSettings extends React.Component {
</div>
</Form.FormGroup>
<Form.FormGroup>
<Form.ControlLabel className="col-md-4">
{__('Maximum concurrent migrations per provider')}
</Form.ControlLabel>
<div className="col-md-2">
<Field
id="max_concurrent_tasks_per_provider"
name="max_concurrent_tasks_per_provider"
component={NumberInput}
normalize={NumberInput.normalizeStringToInt}
min={1}
/>
</div>
</Form.FormGroup>
<div style={{ marginTop: '40px' }}>
<h3>{__('Resource Utilization Limits for Migrations')}</h3>
</div>
<Form.FormGroup>
<Form.ControlLabel className="col-md-4">
{__('Limit resources allocated for migrations')}
</Form.ControlLabel>
<div className="col-md-2">
<Switch name="limit_migration_resources" onText={__('Yes')} offText={__('No')} />
</div>
</Form.FormGroup>
<Form.FormGroup>
<Form.ControlLabel className="col-md-4">
{__('Max CPU utilization per conversion host')}
</Form.ControlLabel>
<div className="col-md-2">
<div className="input-group">
<input
type="text"
className="form-control"
name="max_cpu_utilization_per_conversion_host"
id="max_cpu_utilization_per_conversion_host"
/>
<div className="input-group-addon">%</div>
</div>
</div>
</Form.FormGroup>
<Form.FormGroup>
<Form.ControlLabel className="col-md-4">
{__('Max memory utilization per conversion host')}
</Form.ControlLabel>
<div className="col-md-2">
<div className="input-group">
<input
type="text"
className="form-control"
name="max_memory_utilization_per_conversion_host"
id="max_memory_utilization_per_conversion_host"
/>
<div className="input-group-addon">%</div>
</div>
</div>
</Form.FormGroup>
<Form.FormGroup>
<Form.ControlLabel className="col-md-4">{__('Total network throughput')}</Form.ControlLabel>
<div className="col-md-2">
<div className="input-group">
<input
type="text"
className="form-control"
name="total_network_throughput"
id="total_network_throughput"
/>
<div className="input-group-addon">{__('MB/s')}</div>
</div>
</div>
</Form.FormGroup>
<Form.FormGroup>
<Form.ControlLabel className="col-md-4">{__('Total block storage I/O bandwidth')}</Form.ControlLabel>
<div className="col-md-2">
<div className="input-group">
<input
type="text"
className="form-control"
name="total_block_storage_io_bandwidth"
id="total_block_storage_io_bandwidth"
/>
<div className="input-group-addon">{__('kB/s')}</div>
</div>
</div>
</Form.FormGroup>
<Form.FormGroup className="col-md-1 pull-left" style={{ marginTop: '40px' }}>
<Button bsStyle="primary" onClick={this.onApplyClick} disabled={!hasUnsavedChanges || isSavingSettings}>
{__('Apply')}
</Button>
<br />
{isSavingSettings && (
<div style={{ paddingTop: 10 }}>
<Spinner loading size="xs" inline />
Expand Down

0 comments on commit ec17331

Please sign in to comment.