-
Notifications
You must be signed in to change notification settings - Fork 45
Public TSG (2601): SBE Update fails with "Cannot validate argument on parameter 'DeployADLess'" #240
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
Open
YiyangZhao215
wants to merge
2
commits into
Azure:main
Choose a base branch
from
YiyangZhao215:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Public TSG (2601): SBE Update fails with "Cannot validate argument on parameter 'DeployADLess'" #240
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ate/SBE-Update-Fails-with-Cannot-Validate-Argument-on-Parameter-DeployADLess.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||
| # SBE Update Fails with "Cannot validate argument on parameter 'DeployADLess'" | ||||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| If a cluster was initially deployed (or brownfield-upgraded) with versions earlier than 2408, then after updating it to 2601, subsequent SBE update may fail with the error "Cannot validate argument on parameter 'DeployADLess'". | ||||||
|
|
||||||
| ## Symptoms | ||||||
|
|
||||||
| For a cluster on 2601, SBE update fails with the message (any partner OEM may be impacted): | ||||||
|
|
||||||
| ``` | ||||||
| Cannot validate argument on parameter 'DeployADLess'. | ||||||
| The argument "[DEPLOYADLESS]" does not belong to the set "true,false," specified by the ValidateSet attribute. | ||||||
| Supply an argument that is in the set and then try the command again. | ||||||
| at TestHardwarePluginUsed, C:\NugetStore\Microsoft.AzureStack.Role.SBE.10.2601.1002.2027\content\Classes\SBE\SBE.psm1: line 766, | ||||||
| ``` | ||||||
|
|
||||||
| ## Root Cause | ||||||
|
|
||||||
| DeployADLess parameter entry was introduced in version 2408, but is only applicable to clusters deployed on this version or later. For earlier clusters, update process did not insert the entry to CloudParameters. | ||||||
|
|
||||||
| 2601 introduced some new SBE scripts that depends on the value of this parameter. In the absence of the parameter, the value becomes the placeholder literal string '[DEPLOYADLESS]'. This value is unexpected by the script and thus fails the update. | ||||||
|
|
||||||
|
|
||||||
| ## Resolution | ||||||
|
|
||||||
| The following script may be run from any host node. After running the script, resume update. | ||||||
|
|
||||||
| ```Powershell | ||||||
| $ErrorActionPreference = "Stop" | ||||||
| Import-Module -Name ECEClient -Verbose:$false -DisableNameChecking -ErrorAction SilentlyContinue | ||||||
|
|
||||||
| $eceClient = Create-ECEClusterServiceClient | ||||||
| $eceParamsXml = [XML]($eceClient.GetCloudParameters().GetAwaiter().GetResult().CloudDefinitionAsXmlString) | ||||||
|
|
||||||
| # Only add if we cannot get the parameter. | ||||||
| if (-not ($eceParamsXml.SelectSingleNode("//Category[@Name='Domain']//Parameter[@Name='DeployADLess']"))) | ||||||
| { | ||||||
| # Add the DeployADLess parameter | ||||||
| Write-Output "Adding DeployADLess parameter to CloudParameters." | ||||||
| $parametersUpdateDefinition = New-Object Microsoft.AzureStack.Solution.Deploy.EnterpriseCloudEngine.Controllers.Models.CloudParametersUpdateDescription | ||||||
| $parametersUpdateDefinition.Type = "AddElement" | ||||||
| $parametersUpdateDefinition.BaseElementXPath = "//Category[@Name='Domain']" | ||||||
| $parametersUpdateDefinition.UpdateXml = @" | ||||||
| <Parameter Name="DeployADLess" Type="bool" Value="false" AllowedValues="" Reference="[{DEPLOYADLESS}]" /> | ||||||
| "@ | ||||||
| $null = $eceClient.UpdateCloudParameters($parametersUpdateDefinition).GetAwaiter().GetResult() | ||||||
| Write-Output "Validating add DeployADLess parameter" | ||||||
| $null = $ececlient.InvalidateCloudDefinitionCache().GetAwaiter().GetResult() | ||||||
|
||||||
| $null = $ececlient.InvalidateCloudDefinitionCache().GetAwaiter().GetResult() | |
| $null = $eceClient.InvalidateCloudDefinitionCache().GetAwaiter().GetResult() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the sentence "2601 introduced some new SBE scripts that depends on the value of this parameter.", the subject is plural ("scripts"), so the verb should also be plural ("depend") for correct grammar and clearer reading.