|
|
@@ -56,14 +56,19 @@ class ChangePackage extends AddonController
|
|
|
$this->networkService = new NetworkService();
|
|
|
|
|
|
$this->ressource = new ResourceManager();
|
|
|
- logModuleCall(
|
|
|
- 'proxmoxCloud',
|
|
|
- __FUNCTION__,
|
|
|
- $this->ressource->vcpus(),
|
|
|
- 'Debug',
|
|
|
- $params
|
|
|
- );
|
|
|
-
|
|
|
+ if($this->ressource->vcpus()->getUsed() > $params['configoptions']['vcpus']){
|
|
|
+ throw new \Exception('vCPUs wurden unterbucht');
|
|
|
+ }
|
|
|
+ if($this->ressource->memory()->getUsed() > $params['configoptions']['Memory Limit']){
|
|
|
+ throw new \Exception('Memory wurde unterbucht');
|
|
|
+ }
|
|
|
+ if($this->ressource->disk()->getUsed() > $params['configoptions']['Storage Limit']){
|
|
|
+ throw new \Exception('Storage wurde unterbucht');
|
|
|
+ }
|
|
|
+ if($this->ressource->ipv4()->getUsed() > $params['configoptions']['IP Addresses Limit']){
|
|
|
+ throw new \Exception('IPv4 wurden unterbucht');
|
|
|
+ }
|
|
|
+ $this->resourceGuard()->backupLimit();
|
|
|
//Bandwith limit
|
|
|
$this->saveUsageLimit();
|
|
|
//Assing ip
|