- 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.
34 lines
651 B
PHP
34 lines
651 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ModuleDatastore extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'module_datastore';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'datastore',
|
|
'type',
|
|
'space',
|
|
'module_host_id',
|
|
'vcenter_id',
|
|
'status'
|
|
];
|
|
|
|
public function host()
|
|
{
|
|
return $this->belongsTo(\App\Models\ModuleHost::class,'module_host_id','id');
|
|
}
|
|
|
|
public function vcenter()
|
|
{
|
|
return $this->belongsTo(\App\Models\vCenter::class, 'vcenter_id', 'id');
|
|
}
|
|
}
|