Merge pull request #613 from desrosim232/Start-HVFarm-additions

Start hv farm additions
This commit is contained in:
kamennikolov
2023-06-27 16:57:28 +03:00
committed by GitHub

View File

@@ -6569,6 +6569,16 @@ function Start-HVFarm {
How frequently to repeat maintenance, expressed as a multiple of the maintenance period. e.g. Every 2 weeks. How frequently to repeat maintenance, expressed as a multiple of the maintenance period. e.g. Every 2 weeks.
This property has a default value of 1. This property has values 1-100. This property has a default value of 1. This property has values 1-100.
.PARAMETER NumCPU
Number of CPU of the Vm Instances
.PARAMETER Ram
Ram of the Vm Instances
Units in MB for Ram parameter
.PARAMETER CoresPerSocket
CoresPerSocket of the Vm Instances
.PARAMETER HvServer .PARAMETER HvServer
Reference to Horizon View Server to query the data from. If the value is not passed or null then first element from global:DefaultHVServers would be considered in-place of hvServer. Reference to Horizon View Server to query the data from. If the value is not passed or null then first element from global:DefaultHVServers would be considered in-place of hvServer.
@@ -6673,6 +6683,21 @@ function Start-HVFarm {
[ValidateRange(1, 100)] [ValidateRange(1, 100)]
[int]$EveryInt = 1, [int]$EveryInt = 1,
[Parameter(Mandatory = $false)]
[ValidateRange(1,[Int]::MaxValue)]
[int]
$NumCPU = 4,
[Parameter(Mandatory = $false)]
[ValidateRange(1,[Int]::MaxValue)]
[int]
$Ram = 16384,
[Parameter(Mandatory = $false)]
[ValidateRange(1,[Int]::MaxValue)]
[int]
$CoresPerSocket = 1,
[Parameter(Mandatory = $false)] [Parameter(Mandatory = $false)]
$HvServer = $null $HvServer = $null
) )
@@ -6820,6 +6845,13 @@ function Start-HVFarm {
break break
} }
} }
#set ComputeProfile in a SCHEDULEMAINTENANCE
$spec.ComputeProfile = New-Object VMware.Hv.FarmComputeProfileSpec
$spec.ComputeProfile.NumCPU = $NumCPU
$spec.ComputeProfile.Ram = $Ram
$spec.ComputeProfile.CoresPerSocket = $CoresPerSocket
# call scheduleMaintenance service on farm # call scheduleMaintenance service on farm
if (!$confirmFlag -OR $pscmdlet.ShouldProcess($farmList.$item)) { if (!$confirmFlag -OR $pscmdlet.ShouldProcess($farmList.$item)) {
$farm_service_helper.Farm_ScheduleMaintenance($services, $item, $spec) $farm_service_helper.Farm_ScheduleMaintenance($services, $item, $spec)