diff --git a/src/StackHCI/Az.StackHCI.psd1 b/src/StackHCI/Az.StackHCI.psd1 index cd6ba45945cf..fc89b5d91a43 100644 --- a/src/StackHCI/Az.StackHCI.psd1 +++ b/src/StackHCI/Az.StackHCI.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 26/07/2023 +# Generated on: 8/10/2023 # @{ @@ -121,10 +121,7 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = '* Updated to api-version 2023-03-01. -* Cmdlets added: - - Invoke-AzStackHciExtendClusterSoftwareAssuranceBenefit : Enable Software Assurance for a cluster - - Invoke-AzStackHciConsentAndInstallDefaultExtensions : Consent to installing default extensions on the cluster' + # ReleaseNotes = '' # Prerelease string of this module # Prerelease = '' diff --git a/src/StackHCI/ChangeLog.md b/src/StackHCI/ChangeLog.md index 4ab35416ee4a..6a2dc1bc5b25 100644 --- a/src/StackHCI/ChangeLog.md +++ b/src/StackHCI/ChangeLog.md @@ -18,6 +18,8 @@ - Additional information about change #1 --> ## Upcoming Release +* Used the correct version of cloud management service in `Register-AzStackHCI` cmdlet. +* Fixed the bugs in `Register-AzStackHCI` and `Enable-AzStackHCIAttestation` cmdlets. ## Version 2.1.0 * Updated to api-version 2023-03-01. diff --git a/src/StackHCI/StackHCI.sln b/src/StackHCI/StackHCI.sln index e944ce232dea..8e218889e92e 100644 --- a/src/StackHCI/StackHCI.sln +++ b/src/StackHCI/StackHCI.sln @@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{8A7D2120-D3BC-4AC5-93B5-16B181D599BB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{D466C08E-3491-448D-8F76-BA8D63FA7709}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{AF264BDC-FF9A-4957-9D39-4059C8D934FA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{02CD2AE8-FAED-4EA8-BB11-6710E0F3BD87}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{488E8910-0127-40FD-9D24-30DC0E2F3B83}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{4064BC27-A748-485F-8C62-63B6411F39DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{B348CF6C-6897-4575-B8B1-4B05431D308C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{A1FE2345-DC0F-45D3-A6CF-52A0BEE3206B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{D3D92132-CABC-4A2F-A054-6C8993540C26}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{63E0A0F4-D774-4353-8AD8-579910BA9540}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{772ADD26-34CD-4172-98AC-AC65A32EE07D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{4C6AE826-76D0-4938-B453-9F9F7095EF00}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.StackHCI", "Az.StackHCI.csproj", "{1E9D1CC5-C46E-49EB-A55A-9402EE48875F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.StackHCI", "Az.StackHCI.csproj", "{731FEF52-D365-4660-9836-728080F231A5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -26,33 +26,33 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8A7D2120-D3BC-4AC5-93B5-16B181D599BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A7D2120-D3BC-4AC5-93B5-16B181D599BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A7D2120-D3BC-4AC5-93B5-16B181D599BB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A7D2120-D3BC-4AC5-93B5-16B181D599BB}.Release|Any CPU.Build.0 = Release|Any CPU - {AF264BDC-FF9A-4957-9D39-4059C8D934FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF264BDC-FF9A-4957-9D39-4059C8D934FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF264BDC-FF9A-4957-9D39-4059C8D934FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF264BDC-FF9A-4957-9D39-4059C8D934FA}.Release|Any CPU.Build.0 = Release|Any CPU - {488E8910-0127-40FD-9D24-30DC0E2F3B83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {488E8910-0127-40FD-9D24-30DC0E2F3B83}.Debug|Any CPU.Build.0 = Debug|Any CPU - {488E8910-0127-40FD-9D24-30DC0E2F3B83}.Release|Any CPU.ActiveCfg = Release|Any CPU - {488E8910-0127-40FD-9D24-30DC0E2F3B83}.Release|Any CPU.Build.0 = Release|Any CPU - {B348CF6C-6897-4575-B8B1-4B05431D308C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B348CF6C-6897-4575-B8B1-4B05431D308C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B348CF6C-6897-4575-B8B1-4B05431D308C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B348CF6C-6897-4575-B8B1-4B05431D308C}.Release|Any CPU.Build.0 = Release|Any CPU - {D3D92132-CABC-4A2F-A054-6C8993540C26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3D92132-CABC-4A2F-A054-6C8993540C26}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3D92132-CABC-4A2F-A054-6C8993540C26}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3D92132-CABC-4A2F-A054-6C8993540C26}.Release|Any CPU.Build.0 = Release|Any CPU - {772ADD26-34CD-4172-98AC-AC65A32EE07D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {772ADD26-34CD-4172-98AC-AC65A32EE07D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {772ADD26-34CD-4172-98AC-AC65A32EE07D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {772ADD26-34CD-4172-98AC-AC65A32EE07D}.Release|Any CPU.Build.0 = Release|Any CPU - {1E9D1CC5-C46E-49EB-A55A-9402EE48875F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E9D1CC5-C46E-49EB-A55A-9402EE48875F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E9D1CC5-C46E-49EB-A55A-9402EE48875F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E9D1CC5-C46E-49EB-A55A-9402EE48875F}.Release|Any CPU.Build.0 = Release|Any CPU + {D466C08E-3491-448D-8F76-BA8D63FA7709}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D466C08E-3491-448D-8F76-BA8D63FA7709}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D466C08E-3491-448D-8F76-BA8D63FA7709}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D466C08E-3491-448D-8F76-BA8D63FA7709}.Release|Any CPU.Build.0 = Release|Any CPU + {02CD2AE8-FAED-4EA8-BB11-6710E0F3BD87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02CD2AE8-FAED-4EA8-BB11-6710E0F3BD87}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02CD2AE8-FAED-4EA8-BB11-6710E0F3BD87}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02CD2AE8-FAED-4EA8-BB11-6710E0F3BD87}.Release|Any CPU.Build.0 = Release|Any CPU + {4064BC27-A748-485F-8C62-63B6411F39DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4064BC27-A748-485F-8C62-63B6411F39DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4064BC27-A748-485F-8C62-63B6411F39DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4064BC27-A748-485F-8C62-63B6411F39DA}.Release|Any CPU.Build.0 = Release|Any CPU + {A1FE2345-DC0F-45D3-A6CF-52A0BEE3206B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1FE2345-DC0F-45D3-A6CF-52A0BEE3206B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1FE2345-DC0F-45D3-A6CF-52A0BEE3206B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1FE2345-DC0F-45D3-A6CF-52A0BEE3206B}.Release|Any CPU.Build.0 = Release|Any CPU + {63E0A0F4-D774-4353-8AD8-579910BA9540}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {63E0A0F4-D774-4353-8AD8-579910BA9540}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63E0A0F4-D774-4353-8AD8-579910BA9540}.Release|Any CPU.ActiveCfg = Release|Any CPU + {63E0A0F4-D774-4353-8AD8-579910BA9540}.Release|Any CPU.Build.0 = Release|Any CPU + {4C6AE826-76D0-4938-B453-9F9F7095EF00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C6AE826-76D0-4938-B453-9F9F7095EF00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C6AE826-76D0-4938-B453-9F9F7095EF00}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C6AE826-76D0-4938-B453-9F9F7095EF00}.Release|Any CPU.Build.0 = Release|Any CPU + {731FEF52-D365-4660-9836-728080F231A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {731FEF52-D365-4660-9836-728080F231A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {731FEF52-D365-4660-9836-728080F231A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {731FEF52-D365-4660-9836-728080F231A5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/StackHCI/custom/stackhci.ps1 b/src/StackHCI/custom/stackhci.ps1 index 055e3a392df7..142c0f9ae32e 100644 --- a/src/StackHCI/custom/stackhci.ps1 +++ b/src/StackHCI/custom/stackhci.ps1 @@ -240,6 +240,7 @@ $ArcSettingsDisableInProgressState = "DisableInProgress" # Cluster Agent Service Names $ClusterAgentServiceName = "HciClusterAgentSvc" +$CloudManagementInfraServiceName = "AszCloudMgmtSvc" $ClusterAgentGroupName = "Cloud Management" $AzAccountsModuleMinVersion="2.11.2" @@ -2701,14 +2702,18 @@ param( # Check if OS version is 22H2 or newer $osVersionDetectoid = { $displayVersion = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").DisplayVersion; $buildNumber = (Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber; New-Object -TypeName PSObject -Property @{'DisplayVersion'=$displayVersion; 'BuildNumber'=$buildNumber} } $cloudManagementDetectoid = { $cloudManagementSvc = Get-Item -Path ("{0}\System32\azshci\{1}.exe" -f $env:SystemRoot, $Using:ClusterAgentServiceName) -ErrorAction SilentlyContinue; $cloudManagementSvc -ne $null } + $cloudManagementInfraDetectoid = { $cloudManagementInfraSvc = Get-Item -Path ("{0}\System32\azshci\cloudmanagement\{1}.exe" -f $env:SystemRoot, $Using:CloudManagementInfraServiceName) -ErrorAction SilentlyContinue; $cloudManagementInfraSvc -ne $null } - $osVersionInfo = Invoke-Command -Session $clusterNodeSession -ScriptBlock $osVersionDetectoid - $cloudManagementCapable = Invoke-Command -Session $clusterNodeSession -ScriptBlock $cloudManagementDetectoid + $osVersionInfo = Invoke-Command -Session $clusterNodeSession -ScriptBlock $osVersionDetectoid + $cloudManagementCapable = Invoke-Command -Session $clusterNodeSession -ScriptBlock $cloudManagementDetectoid + $cloudManagementInfraCapable = Invoke-Command -Session $clusterNodeSession -ScriptBlock $cloudManagementInfraDetectoid Write-VerboseLog ("Display Version: {0}, Build Number: {1}, Cloud Management capable: {2}" -f $osVersionInfo.DisplayVersion, $osVersionInfo.BuildNumber, $cloudManagementCapable) $isCloudManagementSupported = ([Int]::Parse($osVersionInfo.BuildNumber) -ge $22H2BuildNumber) -and ($cloudManagementCapable -eq $true) + $isCloudManagementInfraSupported = ([Int]::Parse($osVersionInfo.BuildNumber) -ge $23H2BuildNumber) -and ($cloudManagementInfraCapable -eq $true) $isDefaultExtensionSupported = ([Int]::Parse($osVersionInfo.BuildNumber) -ge $23H2BuildNumber) Write-VerboseLog ("Cloud Management supported: {0}" -f $isCloudManagementSupported) + Write-VerboseLog ("Cloud Management Infra supported: {0}" -f $isCloudManagementInfraSupported) Write-VerboseLog ("Installing Mandatory extensions supported: {0}" -f $isDefaultExtensionSupported) if(($isDefaultExtensionSupported) -and (($null -eq $arcres) -or ($null -eq $arcres.Properties.DefaultExtensions.ConsentTime))) @@ -3091,27 +3096,40 @@ param( } $isCloudManagementFeatureEnabled = $false - if ($isCloudManagementSupported -eq $true) + $isEitherVersionOfCloudManagementSupported = $isCloudManagementSupported -OR $isCloudManagementInfraSupported + if ($isEitherVersionOfCloudManagementSupported -eq $true) { $cloudManagementFeatureDetectoid = { $null -ne (Get-AzureStackHCI).NextSync } $isCloudManagementFeatureEnabled = Invoke-Command -Session $clusterNodeSession -ScriptBlock $cloudManagementFeatureDetectoid -ErrorAction Ignore Write-VerboseLog ("Cloud Management supported: {0}" -f $isCloudManagementSupported) + Write-VerboseLog ("Cloud Management Infra supported: {0}" -f $isCloudManagementInfraSupported) Write-VerboseLog ("Cloud Management enabled: {0}" -f $isCloudManagementFeatureEnabled) } - if ($isCloudManagementSupported -eq $true -AND $isCloudManagementFeatureEnabled -eq $true) + if ($isEitherVersionOfCloudManagementSupported -eq $true -AND $isCloudManagementFeatureEnabled -eq $true) { Write-Progress -Id $MainProgressBarId -activity $RegisterProgressActivityName -status $ConfiguringCloudManagementMessage -percentcomplete 91 Write-Progress -Id $SecondaryProgressBarId -activity $SetupCloudManagementActivityName -status $ConfiguringCloudManagementMessage -percentcomplete 10 Write-VerboseLog ("$ConfiguringCloudManagementMessage") - + + # Decide what service to use for cloud management and turn off old service if Infra is supported + if($isCloudManagementInfraSupported) + { + $cloudManagementServiceName = $CloudManagementInfraServiceName + } + else + { + $cloudManagementServiceName = $ClusterAgentServiceName + } + Write-VerboseLog ("Using Cloud Management Service Name: $($cloudManagementServiceName)") + # Start Cluster Agent Servce as Clustered Role - $service = Invoke-Command -Session $clusterNodeSession -ScriptBlock { Get-Service -Name $using:ClusterAgentServiceName -ErrorAction Ignore } - + $service = Invoke-Command -Session $clusterNodeSession -ScriptBlock { Get-Service -Name $using:cloudManagementServiceName -ErrorAction Ignore } + $serviceError = $null if ($null -eq $service) { - $serviceError = "{0} service doesn't exist." -f $ClusterAgentServiceName + $serviceError = "{0} service doesn't exist." -f $cloudManagementServiceName Write-ErrorLog -Message $serviceError -ErrorAction Continue Write-NodeEventLog -Message $serviceError -EventID 9119 -IsManagementNode $IsManagementNode -credentials $Credential -ComputerName $ComputerName -Level Warning } @@ -3133,6 +3151,12 @@ param( { Write-Progress -Id $SecondaryProgressBarId -activity $SetupCloudManagementActivityName -status $ConfiguringCloudManagementClusterSvc -percentcomplete 40 Write-VerboseLog ("Cloud Management cluster group: $($group | Format-List | Out-String)") + + $svcResourcesToRemove = Invoke-Command -Session $clusterNodeSession -ScriptBlock { Get-ClusterGroup -Name $using:ClusterAgentGroupName | Get-ClusterResource -ErrorAction Ignore | Where-Object {$_.Name -ne $using:displayName} } + if($null -ne $svcResourcesToRemove){ + Write-VerboseLog ("Removing unnecessary cluster resources: $($svcResourcesToRemove | Format-List | Out-String)") + Invoke-Command -Session $clusterNodeSession -ScriptBlock { Remove-ClusterResource -Name $using:svcResourcesToRemove.Name -ErrorAction Ignore -Force} + } $svcResource = Invoke-Command -Session $clusterNodeSession -ScriptBlock { Get-ClusterGroup -Name $using:ClusterAgentGroupName | Get-ClusterResource -ErrorAction Ignore | Where-Object {$_.Name -eq $using:displayName} } if ($null -eq $svcResource) @@ -3146,13 +3170,13 @@ param( { Write-Progress -Id $SecondaryProgressBarId -activity $SetupCloudManagementActivityName -status $ConfiguringCloudManagementClusterSvc -percentcomplete 80 Write-VerboseLog ("Cloud Management cluster resource: $($svcResource | Format-List | Out-String)") - Write-VerboseLog ("Setting cluster resource parameter ServiceName = $ClusterAgentServiceName") - Invoke-Command -Session $clusterNodeSession -ScriptBlock { Get-ClusterGroup -Name $using:ClusterAgentGroupName | Get-ClusterResource -ErrorAction Ignore | Where-Object {$_.Name -eq $using:displayName} | Set-ClusterParameter -Name ServiceName -Value $using:ClusterAgentServiceName -ErrorAction Ignore} + Write-VerboseLog ("Setting cluster resource parameter ServiceName = $cloudManagementServiceName") + Invoke-Command -Session $clusterNodeSession -ScriptBlock { Get-ClusterGroup -Name $using:ClusterAgentGroupName | Get-ClusterResource -ErrorAction Ignore | Where-Object {$_.Name -eq $using:displayName} | Set-ClusterParameter -Name ServiceName -Value $using:cloudManagementServiceName -ErrorAction Ignore} $group = Invoke-Command -Session $clusterNodeSession -ScriptBlock { Get-ClusterGroup -Name $using:ClusterAgentGroupName -ErrorAction Ignore } } else { - $serviceError = "Failed to create cluster resource {0} in group {1}." -f $ClusterAgentServiceName, $ClusterAgentGroupName + $serviceError = "Failed to create cluster resource {0} in group {1}." -f $cloudManagementServiceName, $ClusterAgentGroupName Write-ErrorLog -Message $serviceError -ErrorAction Continue Write-NodeEventLog -Message $serviceError -EventID 9120 -IsManagementNode $IsManagementNode -credentials $Credential -ComputerName $ComputerName -Level Warning } @@ -4647,7 +4671,7 @@ param( { $IsManagementNode = $True } - + $percentComplete = 1 Write-Progress -Id $MainProgressBarId -activity $EnableAzsHciImdsActivity -status $FetchingRegistrationState -percentcomplete $percentComplete @@ -4681,11 +4705,16 @@ param( $percentComplete = 5 Write-Progress -Id $MainProgressBarId -activity $EnableAzsHciImdsActivity -status $DiscoveringClusterNodes -percentcomplete $percentComplete - $ClusterName = Invoke-Command @SessionParams -ScriptBlock { (Get-Cluster).Name } - $ClusterNodes = Invoke-Command @SessionParams -ScriptBlock { Get-ClusterNode } + $ClusterName, $ClusterNodes, $ClusterNodeStateUp = Invoke-Command @SessionParams -ScriptBlock { + $name = (Get-Cluster).Name + $nodes = Get-ClusterNode + $nodeStateUp = [Microsoft.FailoverClusters.PowerShell.ClusterNodeState]::Up + + return $name, $nodes, $nodeStateUp + } # Validate Cluster nodes are online - if (($ClusterNodes | Where {$_.State -ne [Microsoft.FailoverClusters.PowerShell.ClusterNodeState]::Up} | Measure-Object).Count -ne 0) + if (($ClusterNodes | Where {$_.State -ne $ClusterNodeStateUp.Value} | Measure-Object).Count -ne 0) { throw $AllClusterNodesAreNotOnline } @@ -5563,8 +5592,12 @@ function Install-AzStackHCIRemoteSupport{ param() Setup-Logging -LogFilePrefix "AzStackHCIRemoteSupportInstall" -DebugEnabled ($DebugPreference -ne "SilentlyContinue") - if(Assert-IsObservabilityStackPresent){ - Write-InfoLog("Install-AzStackHCIRemoteSupport is not available.") + + $agentInstallType = (Get-ItemProperty -Path "HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" -ErrorAction SilentlyContinue).InstallType + $observabilityStackPresent = Assert-IsObservabilityStackPresent + + if($observabilityStackPresent -or ($agentInstallType -eq "ArcExtension")){ + Write-InfoLog("Install-AzStackHCIRemoteSupport is not available. Observability Stack Present: <$observabilityStackPresent>. Agent install type: <$agentInstallType>") } else{ Install-DeployModule -ModuleName "Microsoft.AzureStack.Deployment.RemoteSupport" @@ -5590,8 +5623,11 @@ function Remove-AzStackHCIRemoteSupport{ param() Setup-Logging -LogFilePrefix "AzStackHCIRemoteSupportRemove" -DebugEnabled ($DebugPreference -ne "SilentlyContinue") - if(Assert-IsObservabilityStackPresent){ - Write-InfoLog("Remove-AzStackHCIRemoteSupport is not available.") + $agentInstallType = (Get-ItemProperty -Path "HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" -ErrorAction SilentlyContinue).InstallType + $observabilityStackPresent = Assert-IsObservabilityStackPresent + + if($observabilityStackPresent -or ($agentInstallType -eq "ArcExtension")){ + Write-InfoLog("Remove-AzStackHCIRemoteSupport is not available. Observability Stack Present: <$observabilityStackPresent>. Agent install type: <$agentInstallType>") } else{ Install-DeployModule -ModuleName "Microsoft.AzureStack.Deployment.RemoteSupport" @@ -5659,7 +5695,10 @@ function Enable-AzStackHCIRemoteSupport{ } } - if(Assert-IsObservabilityStackPresent){ + $agentInstallType = (Get-ItemProperty -Path "HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" -ErrorAction SilentlyContinue).InstallType + $observabilityStackPresent = Assert-IsObservabilityStackPresent + + if($observabilityStackPresent -or ($agentInstallType -eq "ArcExtension")){ Import-Module DiagnosticsInitializer -Force Enable-RemoteSupport -AccessLevel $AccessLevel -ExpireInMinutes $ExpireInMinutes -SasCredential $SasCredential -AgreeToRemoteSupportConsent:$AgreeToRemoteSupportConsent } @@ -5687,7 +5726,10 @@ function Disable-AzStackHCIRemoteSupport{ [CmdletBinding(SupportsShouldProcess)] [OutputType([Boolean])] param() - if(Assert-IsObservabilityStackPresent){ + $agentInstallType = (Get-ItemProperty -Path "HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" -ErrorAction SilentlyContinue).InstallType + $observabilityStackPresent = Assert-IsObservabilityStackPresent + + if($observabilityStackPresent -or ($agentInstallType -eq "ArcExtension")){ Import-Module DiagnosticsInitializer -Force Disable-RemoteSupport } @@ -5729,7 +5771,10 @@ function Get-AzStackHCIRemoteSupportAccess{ $IncludeExpired ) - if(Assert-IsObservabilityStackPresent){ + $agentInstallType = (Get-ItemProperty -Path "HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" -ErrorAction SilentlyContinue).InstallType + $observabilityStackPresent = Assert-IsObservabilityStackPresent + + if($observabilityStackPresent -or ($agentInstallType -eq "ArcExtension")){ Import-Module DiagnosticsInitializer -Force Get-RemoteSupportAccess -IncludeExpired:$IncludeExpired } @@ -5820,7 +5865,10 @@ function Get-AzStackHCIRemoteSupportSessionHistory{ $FromDate = (Get-Date).AddDays(-7) ) - if(Assert-IsObservabilityStackPresent){ + $agentInstallType = (Get-ItemProperty -Path "HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" -ErrorAction SilentlyContinue).InstallType + $observabilityStackPresent = Assert-IsObservabilityStackPresent + + if($observabilityStackPresent -or ($agentInstallType -eq "ArcExtension")){ Import-Module DiagnosticsInitializer -Force Get-RemoteSupportSessionHistory -SessionId $SessionId -FromDate $FromDate -IncludeSessionTranscript:$IncludeSessionTranscript } diff --git a/src/StackHCI/generate-info.json b/src/StackHCI/generate-info.json index f786bee0a8b5..af496b1daf40 100644 --- a/src/StackHCI/generate-info.json +++ b/src/StackHCI/generate-info.json @@ -1,8 +1,8 @@ { - "swagger_commit": "23d88533ddfde4d1565a897fe95d42fb0d9333e5", + "swagger_commit": "d3edca94ae4ddb854e88142cba6a7337ef1a5eed", "node": "v14.15.5", "autorest": "`-- (empty)", - "autorest_core": "3.9.6", + "autorest_core": "3.9.7", "autorest_modelerfour": "4.15.414", "autorest_powershell": "3.0.505" }