feat: Enhance vCenter integration with resource pool and folder support
- Added methods to ResourceService for fetching resource pools and updated existing methods to include datacenter filtering. - Modified CreateVirtualMachine to accept folder and resource pool parameters from product data. - Updated various jobs to synchronize resource pools and include them in the provisioning process. - Introduced new ModuleResourcePool model and migration for resource pool management. - Enhanced existing models (ModuleDatastore, ModuleNetwork, Os) to include relationships with vCenter and resource pools. - Added netmask field to IpPool and updated related logic for IP reservation. - Improved error handling and logging in VM creation and IP reservation processes. - Updated API routes to include sync functionality for vCenter.
This commit is contained in:
@@ -102,6 +102,10 @@ class vCenter
|
||||
{
|
||||
return $this->resource->getAllFolder($datacenter);
|
||||
}
|
||||
public function getAllResourcePool($host = '', $datacenter = '')
|
||||
{
|
||||
return $this->resource->getAllResourcePool($host, $datacenter);
|
||||
}
|
||||
public function getAllDataStore($host = '')
|
||||
{
|
||||
return $this->resource->getAllDataStore($host);
|
||||
@@ -110,17 +114,17 @@ class vCenter
|
||||
{
|
||||
return $this->resource->loadDatastore($host_id);
|
||||
}
|
||||
public function loadNetWork($data = [], $host_id = '')
|
||||
public function loadNetWork($data = [], $host_id = '', $datacenter_id = '')
|
||||
{
|
||||
return $this->resource->loadNetWork($host_id);
|
||||
return $this->resource->loadNetWork($host_id, $datacenter_id);
|
||||
}
|
||||
public function getAllNetwork($host = '')
|
||||
public function getAllNetwork($host = '', $datacenter = '')
|
||||
{
|
||||
return $this->resource->getNetwork($host);
|
||||
return $this->resource->getNetwork($host, $datacenter);
|
||||
}
|
||||
public function getNetwork($host = ''): array|bool|string
|
||||
public function getNetwork($host = '', $datacenter = ''): array|bool|string
|
||||
{
|
||||
return $this->resource->getNetwork($host);
|
||||
return $this->resource->getNetwork($host, $datacenter);
|
||||
}
|
||||
|
||||
// ─── Templates ───────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user