Merge pull request #4 from vmware/master

Updating the fork v2
This commit is contained in:
Kyle Ruddy
2019-09-15 06:34:51 -04:00
committed by GitHub
5 changed files with 176 additions and 20 deletions

View File

@@ -0,0 +1,97 @@
{
"Type": "AUTOMATED",
"Data": {
"Name": "LCFarmJson",
"DisplayName": "FarmJsonTest",
"AccessGroup": "Root",
"Description": "created LC Farm from PS via JSON with NVIDIA GRID VGPU",
"Enabled": null,
"Deleting": false,
"Settings": {
"DisconnectedSessionTimeoutPolicy": "NEVER",
"DisconnectedSessionTimeoutMinutes": 1,
"EmptySessionTimeoutPolicy": "AFTER",
"EmptySessionTimeoutMinutes": 1,
"LogoffAfterTimeout": false
},
"Desktop": null,
"DisplayProtocolSettings": {
"DefaultDisplayProtocol": "PCOIP",
"AllowDisplayProtocolOverride": false,
"EnableHTMLAccess": false,
"EnableCollaboration": false,
"EnableGRIDvGPUs": true,
"VGPUGridProfile": "grid_m10-8a"
},
"ServerErrorThreshold": null,
"MirageConfigurationOverrides": {
"OverrideGlobalSetting": false,
"Enabled": false,
"Url": null
}
},
"AutomatedFarmSpec": {
"ProvisioningType": "VIEW_COMPOSER",
"VirtualCenter": null,
"RdsServerNamingSpec": {
"NamingMethod": "PATTERN",
"PatternNamingSettings": {
"NamingPattern": "LCFarmVMPS",
"MaxNumberOfRDSServers": 1
}
},
"VirtualCenterProvisioningSettings": {
"EnableProvisioning": true,
"StopProvisioningOnError": true,
"MinReadyVMsOnVComposerMaintenance": 0,
"VirtualCenterProvisioningData": {
"ParentVm": "RDSServer",
"Snapshot": "RDS_SNAP1",
"Datacenter": null,
"VmFolder": "Praveen",
"HostOrCluster": "CS-1",
"ResourcePool": "CS-1"
},
"VirtualCenterStorageSettings": {
"Datastores": [
{
"Datastore": "Datastore1",
"StorageOvercommit": "UNBOUNDED"
}
],
"UseVSan": false,
"ViewComposerStorageSettings": {
"UseSeparateDatastoresReplicaAndOSDisks": false,
"ReplicaDiskDatastore": null,
"UseNativeSnapshots": false,
"SpaceReclamationSettings": {
"ReclaimVmDiskSpace": false,
"ReclamationThresholdGB": null,
"BlackoutTimes": null
}
}
},
"VirtualCenterNetworkingSettings": {
"Nics": null
}
},
"VirtualCenterManagedCommonSettings": {
"TransparentPageSharingScope": "VM"
},
"CustomizationSettings": {
"CustomizationType": "SYS_PREP",
"DomainAdministrator": null,
"AdContainer": "CN=Computers",
"ReusePreExistingAccounts": false,
"SysprepCustomizationSettings": {
"CustomizationSpec": "PraveenCust"
}
},
"RdsServerMaxSessionsData": {
"MaxSessionsType": "UNLIMITED",
"MaxSessions": null
}
},
"ManualFarmSpec": null,
"NetBiosName": "adviewdev"
}

View File

@@ -2243,6 +2243,21 @@ function New-HVFarm {
[boolean]
$EnableHTMLAccess = $false,
#farmSpec.data.displayProtocolSettings.EnableCollaboration
[Parameter(Mandatory = $false)]
[boolean]
$EnableCollaboration = $false,
#farmSpec.data.displayProtocolSettings.EnableGRIDvGPUs
[Parameter(Mandatory = $false)]
[boolean]
$EnableGRIDvGPUs = $false,
#farmSpec.data.displayProtocolSettings.VGPUGridProfile
[Parameter(Mandatory = $false)]
[string]
$VGPUGridProfile,
#farmSpec.data.serverErrorThreshold
[Parameter(Mandatory = $false)]
[ValidateRange(0,[Int]::MaxValue)]
@@ -2659,6 +2674,12 @@ function New-HVFarm {
$defaultDisplayProtocol = $jsonObject.Data.DisplayProtocolSettings.DefaultDisplayProtocol
$allowDisplayProtocolOverride = $jsonObject.Data.DisplayProtocolSettings.AllowDisplayProtocolOverride
$enableHTMLAccess = $jsonObject.Data.DisplayProtocolSettings.EnableHTMLAccess
$EnableCollaboration = $jsonObject.Data.DisplayProtocolSettings.EnableCollaboration
if ($null -ne $jsonObject.Data.DisplayProtocolSettings.VGPUGridProfile) {
$EnableGRIDvGPUs = $jsonObject.Data.DisplayProtocolSettings.EnableGRIDvGPUs
$VGPUGridProfile = $jsonObject.Data.DisplayProtocolSettings.VGPUGridProfile
}
}
if ($null -ne $jsonObject.Data.serverErrorThreshold) {
$serverErrorThreshold = $jsonObject.Data.serverErrorThreshold
@@ -2802,6 +2823,11 @@ function New-HVFarm {
$farmData.DisplayProtocolSettings.DefaultDisplayProtocol = $defaultDisplayProtocol
$farmData.DisplayProtocolSettings.AllowDisplayProtocolOverride = $AllowDisplayProtocolOverride
$farmData.DisplayProtocolSettings.EnableHTMLAccess = $enableHTMLAccess
$farmData.DisplayProtocolSettings.EnableCollaboration = $EnableCollaboration
if($VGPUGridProfile -ne $false){
$farmData.DisplayProtocolSettings.EnableGRIDvGPUs = $EnableGRIDvGPUs
$farmData.DisplayProtocolSettings.VGPUGridProfile = $VGPUGridProfile
}
}
if ($farmData.MirageConfigurationOverrides){
$farmData.MirageConfigurationOverrides.OverrideGlobalSetting = $overrideGlobalSetting

View File

@@ -33,8 +33,8 @@ Function Connect-VMCVIServer {
Organization: VMware
Blog: http://vmware.com/go/powercli
Twitter: @powercli
===========================================================================
===========================================================================
.SYNOPSIS
Cmdlet to connect to your VMC vCenter Server
.DESCRIPTION
@@ -47,17 +47,25 @@ Function Connect-VMCVIServer {
Param (
[Parameter(Mandatory=$true)]$Org,
[Parameter(Mandatory=$true)]$Sddc,
[switch]$Autologin
[switch]$Autologin,
[switch]$UseManagementIP
)
If (-Not $global:DefaultVMCServers) { Write-error "No VMC Connection found, please use the Connect-VMC to connect" } Else {
$creds = Get-VMCSDDCDefaultCredential -Org $Org -Sddc $Sddc
Write-Host "Connecting to VMC vCenter Server" $creds.vc_public_ip
Connect-VIServer -Server $creds.vc_public_ip -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC"
Write-Host "Connecting to VMC CIS Endpoint" $creds.vc_public_ip
Connect-CisServer -Server $creds.vc_public_ip -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC"
If($UseManagementIP){
$Server = $creds.vc_management_ip
}Else{
$Server = $creds.vc_public_ip
}
Write-Host "Connecting to VMC vCenter Server" $Server
Connect-VIServer -Server $Server -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC"
Write-Host "Connecting to VMC CIS Endpoint" $Server
Connect-CisServer -Server $Server -User $creds.cloud_username -Password $creds.cloud_password | Add-Member -MemberType Noteproperty -Name Location -Value "VMC"
}
}
Function Get-VMCOrg {
<#
.NOTES