ソースを参照

try disable memory downgrade on running VMs

andre 4 年 前
コミット
6ebfe523ba
1 ファイル変更11 行追加1 行削除
  1. 11 1
      app/UI/VmUpdate/Sections/Qemu/GeneralSection.php

+ 11 - 1
app/UI/VmUpdate/Sections/Qemu/GeneralSection.php

@@ -125,16 +125,26 @@ class GeneralSection extends BaseSection
             $this->addField($field);
         }
         //memory
+
+        logModuleCall(
+            'proxmoxCloud',
+            __FUNCTION__,
+            $vm->status(),
+            'Debug',
+            $this->configuration()->serverMemory->min
+        );
+
         if(!$vm->isRunning()) {
             $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');
         } 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->setDefaultValue($vm->config()['memory']);
             $field->setDescription('Zur Speicherreduzierung muß die VM heruntergefahren sein!');
         }
-        $field->setDefaultValue($vm->config()['memory']);
         $this->addField($field);
         /**
          * @deprecated