Merge pull request #609 from desrosim232/New-HVFarm-additions

Update VMware.HV.Helper.psm1
This commit is contained in:
kamennikolov
2023-04-24 18:43:43 +03:00
committed by GitHub

View File

@@ -2140,6 +2140,16 @@ function New-HVFarm {
.PARAMETER Spec .PARAMETER Spec
Path of the JSON specification file. Path of the JSON specification file.
.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 farms 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 farms from. If the value is not passed or null then first element from global:DefaultHVServers would be considered in-place of hvServer.
@@ -2339,6 +2349,24 @@ function New-HVFarm {
[int] [int]
$diskWriteLatencyThreshold = 0, $diskWriteLatencyThreshold = 0,
#farmSpec.automatedfarmSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ComputeProfile
[Parameter(Mandatory = $false)]
[ValidateRange(1,[Int]::MaxValue)]
[int]
$NumCPU = 4,
#farmSpec.automatedfarmSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ComputeProfile
[Parameter(Mandatory = $false)]
[ValidateRange(1,[Int]::MaxValue)]
[int]
$Ram = 16384,
#farmSpec.automatedfarmSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ComputeProfile
[Parameter(Mandatory = $false)]
[ValidateRange(1,[Int]::MaxValue)]
[int]
$CoresPerSocket = 1,
#farmSpec.automatedfarmSpec.virtualCenter if LINKED_CLONE, INSTANT_CLONE #farmSpec.automatedfarmSpec.virtualCenter if LINKED_CLONE, INSTANT_CLONE
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")] [Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')] [Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
@@ -2499,6 +2527,7 @@ function New-HVFarm {
#farmSpec.automatedfarmSpec.customizationSettings.reusePreExistingAccounts #farmSpec.automatedfarmSpec.customizationSettings.reusePreExistingAccounts
[Parameter(Mandatory = $false,ParameterSetName = 'LINKED_CLONE')] [Parameter(Mandatory = $false,ParameterSetName = 'LINKED_CLONE')]
[Parameter(Mandatory = $false,ParameterSetName = "INSTANT_CLONE")]
[Boolean] [Boolean]
$ReusePreExistingAccounts = $false, $ReusePreExistingAccounts = $false,
@@ -2639,6 +2668,7 @@ function New-HVFarm {
$powerOffScriptParameters = $jsonObject.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.PowerOffScriptParameters $powerOffScriptParameters = $jsonObject.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.PowerOffScriptParameters
$postSynchronizationScriptName = $jsonObject.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.PostSynchronizationScriptName $postSynchronizationScriptName = $jsonObject.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.PostSynchronizationScriptName
$postSynchronizationScriptParameters = $jsonObject.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.PostSynchronizationScriptParameters $postSynchronizationScriptParameters = $jsonObject.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.PostSynchronizationScriptParameters
$reusePreExistingAccounts = $jsonObject.AutomatedFarmSpec.CustomizationSettings.ReusePreExistingAccounts
} }
} elseif ($jsonObject.AutomatedFarmSpec.ProvisioningType -eq "VIEW_COMPOSER") { } elseif ($jsonObject.AutomatedFarmSpec.ProvisioningType -eq "VIEW_COMPOSER") {
$LinkedClone = $true $LinkedClone = $true
@@ -2824,6 +2854,10 @@ function New-HVFarm {
$farmSpecObj.AutomatedFarmSpec.RdsServerNamingSpec = $vmNamingSpec $farmSpecObj.AutomatedFarmSpec.RdsServerNamingSpec = $vmNamingSpec
} }
$farmSpecObj.AutomatedFarmSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ComputeProfile.NumCPU = $NumCPU
$farmSpecObj.AutomatedFarmSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ComputeProfile.Ram = $Ram
$farmSpecObj.AutomatedFarmSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ComputeProfile.CoresPerSocket = $CoresPerSocket
# #
# build the VM LIST # build the VM LIST
# #
@@ -3238,6 +3272,7 @@ function Get-HVFarmCustomizationSetting {
$farmSpecObj.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.powerOffScriptParameters = $powerOffScriptParameters $farmSpecObj.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.powerOffScriptParameters = $powerOffScriptParameters
$farmSpecObj.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.postSynchronizationScriptName = $postSynchronizationScriptName $farmSpecObj.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.postSynchronizationScriptName = $postSynchronizationScriptName
$farmSpecObj.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.postSynchronizationScriptParameters = $postSynchronizationScriptParameters $farmSpecObj.AutomatedFarmSpec.CustomizationSettings.CloneprepCustomizationSettings.postSynchronizationScriptParameters = $postSynchronizationScriptParameters
$farmSpecObj.AutomatedFarmSpec.CustomizationSettings.ReusePreExistingAccounts = $reusePreExistingAccounts
$customObject = $farmSpecObj.AutomatedFarmSpec.CustomizationSettings $customObject = $farmSpecObj.AutomatedFarmSpec.CustomizationSettings
} elseif ($LinkedClone) { } elseif ($LinkedClone) {
$ViewComposerDomainAdministrator_service_helper = New-Object VMware.Hv.ViewComposerDomainAdministratorService $ViewComposerDomainAdministrator_service_helper = New-Object VMware.Hv.ViewComposerDomainAdministratorService
@@ -3301,8 +3336,7 @@ function Get-FarmSpec {
if ($farmType -eq 'AUTOMATED') { if ($farmType -eq 'AUTOMATED') {
$farm_spec_helper.getDataObject().AutomatedFarmSpec.RdsServerNamingSpec.PatternNamingSettings = $farm_helper.getFarmPatternNamingSettingsHelper().getDataObject() $farm_spec_helper.getDataObject().AutomatedFarmSpec.RdsServerNamingSpec.PatternNamingSettings = $farm_helper.getFarmPatternNamingSettingsHelper().getDataObject()
$farm_spec_helper.getDataObject().AutomatedFarmSpec.VirtualCenterProvisioningSettings.VirtualCenterStorageSettings.ViewComposerStorageSettings = $farm_helper.getFarmViewComposerStorageSettingsHelper().getDataObject() $farm_spec_helper.getDataObject().AutomatedFarmSpec.VirtualCenterProvisioningSettings.VirtualCenterStorageSettings.ViewComposerStorageSettings = $farm_helper.getFarmViewComposerStorageSettingsHelper().getDataObject()
$farm_spec_helper.getDataObject().AutomatedFarmSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ComputeProfile = $farm_helper.getFarmComputeProfileSpecHelper().getDataObject()
} }
$farm_spec_helper.getDataObject().Data.Settings = $farm_helper.getFarmSessionSettingsHelper().getDataObject() $farm_spec_helper.getDataObject().Data.Settings = $farm_helper.getFarmSessionSettingsHelper().getDataObject()
$farm_spec_helper.getDataObject().Data.LbSettings = $farm_helper.getRDSHLoadBalancingSettingsHelper().getDataObject() $farm_spec_helper.getDataObject().Data.LbSettings = $farm_helper.getRDSHLoadBalancingSettingsHelper().getDataObject()
@@ -4485,6 +4519,8 @@ function New-HVPool {
$vmFolder = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.VmFolder $vmFolder = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.VmFolder
$hostOrCluster = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.HostOrCluster $hostOrCluster = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.HostOrCluster
$resourcePool = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ResourcePool $resourcePool = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.ResourcePool
$dataStoreList = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterStorageSettings.Datastores $dataStoreList = $jsonObject.AutomatedDesktopSpec.VirtualCenterProvisioningSettings.VirtualCenterStorageSettings.Datastores
foreach ($dtStore in $dataStoreList) { foreach ($dtStore in $dataStoreList) {
$datastores += $dtStore.Datastore $datastores += $dtStore.Datastore