Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-HVFarm fails when $maxSessionsType is set to "LIMITED" as it is incorrectly being set in line 2786 #400

Closed
kchoudhury opened this issue Dec 7, 2020 · 2 comments

Comments

@kchoudhury
Copy link

For vmware.hv.helper module , the function New-HVFarm is incorrectly setting the $maxSessionsType for the $farmspecobject due to which if you pass the $maxSessionsType parameter value to LIMITED the api request sent is incorrect and sets the $maxsession value instead of $maxSessionsType:

Problem lies in line number 2786 -

$farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessionsType = $maxSessionsType
        if ($maxSessionsType -eq "LIMITED") {
            $farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessionsType = $maxSessions
        }

Correct code should be to set MaxSessions in this condition as given below:

$farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessionsType = $maxSessionsType
        if ($maxSessionsType -eq "LIMITED") {
            $farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessions = $maxSessions
        }
bitszor added a commit to bitszor/PowerCLI-Example-Scripts that referenced this issue Feb 4, 2021
@bitszor
Copy link
Contributor

bitszor commented Feb 4, 2021

Can confirm the fix in the original issue will allow farms to be provisioned with max sessions set to limited after above pull request is merged.

dmilov added a commit that referenced this issue Feb 17, 2021
Fix issue #400 - New-HVFarm fails when maxSessionsType is LIMITED
@kamennikolov
Copy link
Contributor

Fixed by #412

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants