mattmcspirit / azurestack

Azure Stack Resources
80 stars 41 forks source link

AddSQLServerRP (MSSQL) deployment failed #129

Closed JonParvez closed 3 years ago

JonParvez commented 4 years ago

Hi Matt, I have recently set up Azure Stack on a Dell machine but for some reason, we have to take a new HP machine where I have to set up all the stuffs but after installing the ASDK when I was trying to run your script I was facing an issue. Every time it couldn't complete the SQLServerRP and that's why the App service and other kinds of stuff are failing to deploy.

I was having the below exception which I got from the log file.

New-AzureRmResourceGroupDeployment : 8:39:38 AM - Resource Microsoft.Compute/virtualMachines/extensions 'SqlVM11470/SQLAdapterDeployment' failed with message '{ "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'SQLAdapterDeployment'. Error message: Finished executing command" } ] } }' At D:\ASDKfiles\AzSFiles\databases\SQLServer3\Providers\Deploy-Microsoft-provider.ps1:76 char:21

Hardware The machine meets up the ASDK requirements and it also has 800GB SSD.

Here is the log file. DeploySQLProvider.ps1_20200713-080445.txt

I have also checked that there is a failed extension in this SQL VM which is installed on the process. I have added this image to your clear understanding. (https://github.com/mattmcspirit/azurestack/files/4919302/DeploySQLProvider.ps1_20200713-080445.txt) MicrosoftTeams-image (3)

Please take a look and help me with this issue.

Thanks Parvez

mattmcspirit commented 4 years ago

Hi,

That's not quite right - the SQL Provider has no dependencies or relationships with the App Service installation, so the App Service install is not failing because of that, unless the SQL RP install is locking up the system somehow.

If the SQL RP install fails, it will cause the AddSQLSkuQuota and AddSQLHosting to fail also. There are no other steps that will fail as a result of the SQL RP failing. I'd need to see all your logs to see what is going on if that's what you're seeing.

With regards to your failure above, this isn't my script. My script calls the DeploySQLProvider.ps1 script, written by the SQL RP team. If that's failing at the extension stage, it must be something in your environment that's not quite going right.

My advice would be to clean up the SQL RP Resource Group, and install manually with these steps: https://docs.microsoft.com/en-us/azure-stack/operator/azure-stack-sql-resource-provider-deploy?view=azs-2002

That will at least eliminate anything else causing the issues.

A piece of advice though - the focus for SQL on Azure Stack Hub is going to be either in IaaS, or on Kubernetes, delivered through Azure Hybrid Data Services (https://azure.microsoft.com/en-us/services/azure-arc/hybrid-data-services/) and the focus on the MySQL/SQL RP will go away...so you may want to ignore deploying the MySQL/SQL RPs going forward anyway...

JonParvez commented 4 years ago

Hi Matt, Thanks for your suggestion. We have tried to install manually but the result was the same.

New-AzureRmResourceGroupDeployment : 11:46:19 AM - Resource Microsoft.Compute/virtualMachines/extensions 'SqlVM11470/SQLAdapterDeployment' failed with message '{ "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'SQLAdapterDeployment'. Error message: Finished executing command" } ] } }' At D:\Temp\MSSQLRP\Providers\Deploy-Microsoft-provider.ps1:76 char:21

We are confused because just a few days ago, we have deployed ASDK and app service in another machine but stuck here now. Please suggest something in this regard.

Thanks in advance Jon

mattmcspirit commented 4 years ago

Hi,

I'm afraid with the same issue being found with the manual install, it could be indicative of an issue with the ASDK itself. If other VMs can be successfully deployed from that ServerCore image, then you can rule the image out as being the issue.

You could raise the issue here: https://docs.microsoft.com/en-us/answers/topics/azure-stack-hub.html and see if anyone can help with the SQL RP install.

Did MYSQL install correctly?

Thanks, Matt

JonParvez commented 4 years ago

Hi,

No same issue for MySQL and it also happened for the App Service file server VM. Do you think there is an issue of windows server version?

Thanks Parvez

mattmcspirit commented 4 years ago

Hey - i'd say log into the Azure Stack portal and deploy 2 VMs - one from the Windows Server Core marketplace item, and one from the Windows Server with Desktop Experience, and see if they deploy successfully. If not, there's either an issue with your image, or the compute service. You could also deploy an Ubuntu VM to see if you can deploy a Linux VM successfully.

rfsonders commented 4 years ago

Hello Matt and Jon.

I am experiencing the exact same issue with the VM deployments, starting with the Deploy SQL RP. Identical, starting with the SqlVM11470 Write Deployments | Write VirtualMachines

{ "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VmProvisioningTimeout", "message": "VM 'SqlVM11470' failed to provision with timeout." } ] } }

rfsonders commented 4 years ago

*Update I have tested again, manually creating VMs with the Evaluation ISOs. These machines also fail. The issue resides with the OS evaluation editions from here (2016 or 1019) https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019

rfsonders commented 4 years ago

@JonParvez - did you put together a fix/solve?

securus777 commented 4 years ago

Yeah, I see these same errors on my attempt to use the script. Using an ISO for 2016 that should be the correct version but the 2019 is the eval.

rfsonders commented 4 years ago

I have also attempted with Full, non-eval versions of 2016 and 2019. Same error. Any thoughts?

mattmcspirit commented 4 years ago

Hi all - apologies, I've changed roles, so haven't had bandwidth to fix these issues. However, bear in mind that the focus for SQL on Hub is with Azure Arc enabled Data Services (https://azure.microsoft.com/en-us/services/azure-arc/hybrid-data-services/) and not on the SQL/MySQL RP. I'll see if i can validate running it against 2005 over the next week or so, but I can't guarantee it i'm afraid.

If it fails with the eval ISOs, after the first deployment failure, it may be best to initiate a marketplace download of the official 2016 image, and then re-run and the script should pick up those images and use them. Remove the failing images from the Platform Image Repository also.

rfsonders commented 3 years ago

Hello Matt. I have just tried the AzPoS deployment against a fresh install of the 2008 ASDK. Still using the Eval images to see if there were different results. From reviewing the logs, the Windows update slipstream against the images is where the problem seems to reside. Have you had the cycles to test against your environment?

rfsonders commented 3 years ago

The images continue to fail with a consistent error

FAILED JOB: Job Name: AddServerCore2016Image | Error Message: You cannot call a method on a null-valued expression. FAILED JOB: Job Name: AddServerFull2016Image | Error Message: You cannot call a method on a null-valued expression. FAILED JOB: Job Name: AddServerCore2019Image | Error Message: You cannot call a method on a null-valued expression. FAILED JOB: Job Name: AddServerFull2019Image | Error Message: You cannot call a method on a null-valued expression.

Azure Stack POC Configurator Stage: ServerFull2016Image failed. Updating AzSPoC Progress database You cannot call a method on a null-valued expression..Exception.Message

mattmcspirit commented 3 years ago

Hi Robert,

Someone else also pinged me about this - I suspect the PowerShell modules used in the existing Configurator need updating, as it's encountering some basic issues, for instance, in the AddImage stage, all it's trying to do is:

Write-Host "Logging into Azure Stack"
$ArmEndpoint = "https://adminmanagement.$customDomainSuffix"
Add-AzureRMEnvironment -Name "AzureStackAdmin" -ArmEndpoint "$ArmEndpoint" -ErrorAction Stop
Add-AzureRmAccount -EnvironmentName "AzureStackAdmin" -TenantId $TenantID -Credential $azsCreds -ErrorAction Stop | Out-Null
$sub = Get-AzureRmSubscription | Where-Object { $_.Name -eq "Default Provider Subscription" }
$azureContext = Get-AzureRmSubscription -SubscriptionID $sub.SubscriptionId | Select-AzureRmSubscription
$azsLocation = (Get-AzureRmLocation).DisplayName

I need to update all of these PowerShell commands to use the new Az and validate everything, but unfortunately it's going to take time, and it's time I don't have right now I'm afraid.

rfsonders commented 3 years ago

Hello Matt. Thank you for your response. Attached here is the upgrade plan per the MSFT tooling. It looks like 1,397 line-item references where the parameter was not found. 6,673 that will upgrade just fine with Invoke-AzUpgradeModulePlan

PowerShellUpgradePlan.xlsx

I think this long issue thread deverves a new issue tag.

paracetamol32 commented 3 years ago

Hi, Same error here image

@rfsonders Have you found a workaround ?

rfsonders commented 3 years ago

Hello. We are testing a workaround now. More to come.

mattmcspirit commented 3 years ago

This should now be fixed in the latest release.