|
|
@@ -125,19 +125,16 @@ class GeneralSection extends BaseSection
|
|
|
$this->addField($field);
|
|
|
}
|
|
|
//memory
|
|
|
-
|
|
|
- logModuleCall(
|
|
|
- 'proxmoxCloud',
|
|
|
- __FUNCTION__,
|
|
|
- $vm->isRunning(),
|
|
|
- 'Debug',
|
|
|
- $vm->config()['memory']
|
|
|
- );
|
|
|
-
|
|
|
- $field = new Range('memory', $this->resourceManager->memory()->getMin(), $this->resourceManager->memory()->free());
|
|
|
- $field->addValidator(new NumberValidator($this->resourceManager->memory()->getMin(), $this->resourceManager->memory()->free(),true));
|
|
|
- $field->setDefaultValue($this->configuration()->serverMemory->min);
|
|
|
- $field->setDescription('description');
|
|
|
+ if($vm->isStopped()) {
|
|
|
+ $field = new Range('memory', $this->resourceManager->memory()->getMin(), $this->resourceManager->memory()->free());
|
|
|
+ $field->addValidator(new NumberValidator($this->resourceManager->memory()->getMin(), $this->resourceManager->memory()->free(),true));
|
|
|
+ $field->setDescription('description');
|
|
|
+ } else {
|
|
|
+ $field = new Range('memory', $vm->config()['memory'], $this->resourceManager->memory()->free());
|
|
|
+ $field->addValidator(new NumberValidator($vm->config()['memory'], $this->resourceManager->memory()->free(),true));
|
|
|
+ $field->setDescription('Zur Speicherreduzierung muß die VM heruntergefahren sein!');
|
|
|
+ }
|
|
|
+ $field->setDefaultValue($vm->config()['memory']);
|
|
|
$this->addField($field);
|
|
|
/**
|
|
|
* @deprecated
|