Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.23k stars 3.83k forks source link

Az.StackHCI Register-AzStackHCI ignores custom resource group for Arc initialization #16477

Open jaromirk opened 2 years ago

jaromirk commented 2 years ago

Description

When custom resource group is specified in Register-AzureStackHCI parameter, it will likely result in error registering arc agent.

Register-AzStackHCI -Region $Region -SubscriptionID $subscriptionID -ComputerName  $ClusterName -GraphAccessToken $graphToken -ArmAccessToken $armToken -AccountId $id -ResourceName $ClusterName -ResourceGroupName $ResourceGroupName

powershell36

image

Issue script & Debug output

AgentConnectedStatus: Disconnected, GCServiceStatus: , ExtServiceStatus: , HimdsServiceStatus:
DEBUG: powershell.exe Error: 0 :
DEBUG: Arc agent process failed to onboard machine. Process Output: time="2021-11-23T05:37:24-08:00" level=info msg="Loading AgentConfig file from: C:\\ProgramData\\AzureConnectedMachineAgent\\Config\\agentconfig.json"
time="2021-11-23T05:37:24-08:00" level=info msg="Onboarding Machine. It usually takes a few minutes to complete. Sometimes it may take longer depending on network and server load status."
time="2021-11-23T05:37:24-08:00" level=info msg="Check network connectivity to all endpoints..."
time="2021-11-23T05:37:25-08:00" level=info msg="All endpoints are available... continue onboarding"
time="2021-11-23T05:37:26-08:00" level=error msg="Failed to AzcmagentConnect ARM resource" Error="RequestCorrelationId:1c588474-df27-4cab-8440-619bd912f65e Message: Resource group 'AzSHCI-CLuster-08e3c1d9-b8f6-4af6-8186-69904d49ea76-Arc-Infra-RG' could not be found. Code: ResourceGroupNotFound httpStatusCode:404 "
time="2021-11-23T05:37:26-08:00" level=info msg="Exit Code:  AZCM0042: Failed To Create Resource"
time="2021-11-23T05:37:26-08:00" level=fatal msg="RequestCorrelationId:1c588474-df27-4cab-8440-619bd912f65e Message: Resource group 'AzSHCI-CLuster-08e3c1d9-b8f6-4af6-8186-69904d49ea76-Arc-Infra-RG' could not be found. Code: ResourceGroupNotFound httpStatusCode:404 "
Enable-AzureStackHCIArcIntegration : Failed to enable Azure Stack HCI integration with Azure Arc on node AZSHCI1.
At line:41 char:2
+  Enable-AzureStackHCIArcIntegration -AgentInstallerWebLink $AgentInst ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (:String) [Enable-AzureStackHCIArcIntegration], Exception
    + FullyQualifiedErrorId :
AzsHciError,Microsoft.AzureStack.HCI.Billing.Management.PowerShell.EnableAzureStackHCIArcIntegration
Enable-AzureStackHCIArcIntegration : Failed to enable Azure Stack HCI integration with Azure Arc on node AZSHCI1.
At line:41 char:2
+  Enable-AzureStackHCIArcIntegration -AgentInstallerWebLink $AgentInst ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (:String) [Enable-AzureStackHCIArcIntegration], Exception
    + FullyQualifiedErrorId : AzsHciError,Microsoft.AzureStack.HCI.Billing.Management.PowerShell.EnableAzureStackHCIAr
   cIntegration

DEBUG: Exception in EnableAzureStackHCIArcIntegration: System.Exception: Failed to enable Azure Stack HCI integration with Azure Arc on node AZSHCI1.
   at Microsoft.AzureStack.HCI.Billing.Management.PowerShell.EnableAzureStackHCIArcIntegration.ProcessRecord()
**********************
Windows PowerShell transcript end
End time: 20211123053733

Environment data

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.20348.320                                                                           
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.20348.320                                                                          
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1

Module versions

ModuleType Version    Name                                ExportedCommands                                             
---------- -------    ----                                ----------------                                             
Script     0.10.0     Az.StackHCI                         {Add-AzStackHCIVMAttestation, Disable-AzStackHCIAttestatio...

Error output

No response

dingmeng-xue commented 2 years ago

Thank you for your reporting. Tagging and routing to the team member best able to assist.

lucabovo commented 1 year ago

Hi, I'm having the same issue?

Any thoughts? Thanks, Luca Bovo - beanTech

DarrylvanderPeijl commented 1 year ago

@BethanyZhou @LucasYao93 @wyunchi-ms @SaurabhSharma-MSFT @PramodValavala-MSFT

It's almost 1,5 year and this issue still exists...

VERBOSE: Registering Clustered Scheduled task for Arc Installation WARNING: Some clustered nodes couldn't be Arc-enabled right now. This can happen if some of the nodes are down. We'll automatically try again in an hour. In the meantime, you can use Get-AzureStackHCIArcIntegration to check status on each node. WARNING: Some clustered nodes couldn't be Arc-enabled right now. This can happen if some of the nodes are down. We'll automatically try again in an hour. In the meantime, you can use Get-AzureStackHCIArcIntegration to check status on each node. VERBOSE: Exception occurred in registering nodes to Arc For Servers. ErrorMessage : Unable to find type [ErrorDetail]. VERBOSE: Unable to find type [ErrorDetail].

Can you please re-add this issue into the process?

bniranjanbhat commented 1 year ago

Hi @DarrylvanderPeijl this issue is now fixed since version Az.StackHCI 1.4.3

Can you please retry this scenarion and let us know if you still see this error ?