|
|
@@ -93,9 +93,24 @@ class GeneralSection extends BaseSection
|
|
|
}
|
|
|
//vcpus
|
|
|
if($this->configuration()->isPermissionVcpus() || $this->configuration()->isCalculateSocketsAndCores()){
|
|
|
- $field = new Range('vcpus',$this->resourceManager->vcpus()->getMin(), $this->resourceManager->vcpus()->free());
|
|
|
- $field->addValidator(new NumberValidator($this->resourceManager->vcpus()->getMin(), $this->resourceManager->vcpus()->free(),true));
|
|
|
- $field->setDescription('description');
|
|
|
+
|
|
|
+ logModuleCall(
|
|
|
+ 'proxmoxCloud',
|
|
|
+ __FUNCTION__,
|
|
|
+ $vm->config(),
|
|
|
+ 'Debug',
|
|
|
+ $this->configuration()
|
|
|
+ );
|
|
|
+
|
|
|
+ if(!$vm->isRunning()) {
|
|
|
+ $field = new Range('vcpus',$this->resourceManager->vcpus()->getMin(), $this->resourceManager->vcpus()->free());
|
|
|
+ $field->addValidator(new NumberValidator($this->resourceManager->vcpus()->getMin(), $this->resourceManager->vcpus()->free(),true));
|
|
|
+ $field->setDescription('description');
|
|
|
+ } else {
|
|
|
+ $field = new Range('vcpus',$this->resourceManager->vcpus()->getMin(), $this->resourceManager->vcpus()->free());
|
|
|
+ $field->addValidator(new NumberValidator($this->resourceManager->vcpus()->getMin(), $this->resourceManager->vcpus()->free(),true));
|
|
|
+ $field->setDescription('description');
|
|
|
+ }
|
|
|
$this->addField($field);
|
|
|
}
|
|
|
//cpu priority
|