mattmcspirit / azurestack

Azure Stack Resources
80 stars 41 forks source link

1906 Offline ZIP file packaging #93

Closed mclgoerg closed 5 years ago

mclgoerg commented 5 years ago

Hi Matt,

Describe the issue I am not sure if the mistake might be on my side. I have downloaded the 1906 offline installation files three times and each time it failed shortly after the "Packaging files into a single ZIP file" step. The download of all other files was without problems, so I think that a connectivity problem can be excluded.

Send the logs

VERBOSE: Performing the operation "Unblock-File" on target "D:\Install\ASDK_Install\ASDKPostDeployment1906\ConfigASDKfiles\ASDK\SqlLocalDB\SqlLocalDB.msi".
VERBOSE: Performing the operation "Unblock-File" on target "D:\Install\ASDK_Install\ASDKPostDeployment1906\ConfigASDKfiles\ASDK\templates\FileServerTemplate.json".
VERBOSE: Performing the operation "Unblock-File" on target "D:\Install\ASDK_Install\ASDKPostDeployment1906\ConfigASDKfiles\ASDK\templates\mySqlHostingTemplate.json".
VERBOSE: Performing the operation "Unblock-File" on target "D:\Install\ASDK_Install\ASDKPostDeployment1906\ConfigASDKfiles\ASDK\templates\sqlHostingTemplate.json".
VERBOSE: [09:56]::[CREATE ZIP]:: Packaging files into a single ZIP file
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT * FROM Win32_LogicalDisk WHERE DeviceId='D:','queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: Operation 'Query CimInstances' complete.
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT * FROM Win32_LogicalDisk WHERE DeviceId='D:','queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: Operation 'Query CimInstances' complete.
VERBOSE: Cannot download link 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409', retrying for '2' more times.
VERBOSE: Cannot download link 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409', retrying for '1' more times.
VERBOSE: Cannot download link 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409', retrying for '0' more times.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2' for '2' more times
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2' for '1' more times
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2' for '0' more times
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Total package yield:'0' for the specified package '7Zip4PowerShell'.
VERBOSE: [09:56]::[CREATE ZIP]:: No match was found for the specified search criteria and module name '7Zip4PowerShell'. Try Get-PSRepository to see all available registered module repositories..Exception.Message
Handles NPM(K) PM(K) WS(K) CPU(s)   Id SI ProcessName
------- ------ ----- ----- ------   -- -- -----------
     28      3   544  1556   0,05 7140  4 appservice 

VERBOSE: [09:56]::[CREATE ZIP]:: No match was found for the specified search criteria and module name '7Zip4PowerShell'. Try Get-PSRepository to see all available registered module repositories..Exception.Message
Handles NPM(K) PM(K) WS(K) CPU(s)   Id SI ProcessName
------- ------ ----- ----- ------   -- -- -----------
     28      3   544  1556   0,05 7140  4 appservice 

PS D:\Install\> Get-PSRepository

Name                      InstallationPolicy   SourceLocation                                                                                                                                                                                                    
----                      ------------------   --------------                                                                                                                                                                                                    
PSGallery                 Trusted              https://www.powershellgallery.com/api/v2  

Thank you in advance, Marcel

mattmcspirit commented 5 years ago

Did it fix itself? I’ll run this a little later and check on my side. I’m likely to publish 1906.1 later today with some minor fixes and improvements.

Thanks! Matt

mclgoerg commented 5 years ago

I guess it was an issue on my part. I tried downloading the offline package from a different host and now it works fine. I will download 1906.1 as soon as it's available :)

Thanks Marcel

mattmcspirit commented 5 years ago

Great - I'm glad it's working. Final test run for 1906.1 is running now, then I'll publish it in a few hours, assuming no issues.

Thanks! Matt

mclgoerg commented 5 years ago

Sounds awesome! :)

mattmcspirit commented 5 years ago

Published - i'm going to re-test the offline deployment later, but i'm hopeful all will work fine.

Most users use the AAD/Online model, so that's the one I test most :)

Thanks! Matt

mclgoerg commented 5 years ago

I have started the download and the creation of the offline ZIP. Redeployment of ASDK's will take some time. I will keep you up to date.

Thanks Marcel

mattmcspirit commented 5 years ago

Same here - just starting a redeployment of the ASDK now. Hopefully should be fine!

mclgoerg commented 5 years ago

Hey Matt,

sadly both offline deployments failed with the same error. I found one bug in a script file \Scripts\UploadScripts.ps1 Line 112:

foreach ($s in (Get-AzureRmSubscription | Where-Object Where-Object { $_.Name -eq '*ADMIN OFFLINE SCRIPTS' } )) {

It should be:

foreach ($s in (Get-AzureRmSubscription | Where-Object { $_.Name -eq '*ADMIN OFFLINE SCRIPTS' } )) {

After I fixed this and deleted the *ADMIN OFFLINE SCRIPTS user subscription I still get the error-message in the UploadScripts file:

VERBOSE: Exporting function 'New-PSSwaggerClientTracingInternal'.
VERBOSE: Exporting function 'Register-PSSwaggerClientTracingInternal'.
VERBOSE: Exporting function 'Unregister-PSSwaggerClientTracingInternal'.
VERBOSE: Performing operation ListAllWithHttpMessagesAsync on $SubscriptionsAdminClient.
VERBOSE: Operation completed successfully.
VERBOSE: Flattening paged results.
VERBOSE: Performing operation GetWithHttpMessagesAsync on $SubscriptionsAdminClient.
VERBOSE: Operation failed.
VERBOSE: Performing operation create on $SubscriptionsAdminClient.
VERBOSE: Operation completed successfully.
Creating resource group for storing scripts
VERBOSE: 10:34:04 AM - Created resource group 'azurestack-offlinescripts' in location '*******'
Creating storage account for storing scripts
PS>TerminatingError(New-AzureRmStorageAccount): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The specified subscription wasn't found."
ASDK Configurator Stage: UploadScripts failed. Updating ConfigASDK Progress database
The specified subscription wasn't found..Exception.Message

I am not sure if it's because of the failed operation in the beginning of the above log:

VERBOSE: Performing operation GetWithHttpMessagesAsync on $SubscriptionsAdminClient.
VERBOSE: Operation failed.

Do you have any ideas?

Thanks! Marcel

mattmcspirit commented 5 years ago

Thanks for this! I kicked off my zip install last night, so when I check it this morning it will probably have failed at the same place, so I’ll fix it this morning and let you know what to do to fix yours.

Stay tuned!

mattmcspirit commented 5 years ago

This should now be fixed - if you want to download the UploadScripts.ps1 and DeployVM.ps1 files, and replace your existing ones on your ASDK Host.

https://github.com/mattmcspirit/azurestack/blob/master/deployment/powershell/DeployVM.ps1 https://github.com/mattmcspirit/azurestack/blob/master/deployment/powershell/UploadScripts.ps1

Before you rerun, log into the tenant portal (portal.local.azurestack.external), go to "subscriptions", and if it exists, delete the *ADMIN OFFLINE SCRIPTS subscription, and wait a few minutes. Refresh the portal, and check if it's gone, then proceed.

Then you should be able to rerun the script.

Let me know if that works!

mclgoerg commented 5 years ago

Hi Matt, thanks for your quick update :)

I've deleted the subscription (Remove-AzSUserSubscription -SubscriptionId) and swapped the two files. Right now it went past the critical "UploadScripts"-step :)

I will keep you updated about the deployment status.

*Edit: My second ASDK works aswell :)

mclgoerg commented 5 years ago

Both deployments have been successfully completed. Thanks a lot for your quick help! :)

Marcel

mattmcspirit commented 5 years ago

My pleasure! I'm going to run another test just to 100% confirm a complete run-through - thanks for your help!

mclgoerg commented 5 years ago

I also have an ASDK on which I will test the installation in the next few days. If there are problems, I will contact you here :). Thank you for your work and the quick updates to the new version!

mattmcspirit commented 5 years ago

You may find that the App Service install fails - this is due to the fact that the App Service File Server now uses Server Core instead of Server Full. The Server Core stage usually finishes quicker than the Server Full stage, so the App Service File Server stage can also start and finish sooner. However, I didn't have any checks in place to ensure that the Server Full image stage completes before the Deploy App Service stage starts. I've now fixed this, but just need to test.

In other words, if you encounter a failure, wait until the Server Full 2016 image stage has completed, then rerun :)

Thanks! Matt

mclgoerg commented 5 years ago

Hey Matt, just a quick update: Today I tried the new 1906_02-release. The Deploy App Service stage did indeed fail. I am not sure if it's exactly the issue you were talking about earlier. The process cannot access the file 'C:\Users\azurestackadmin\AppData\Roaming\Windows Azure Powershell\AzureRmContextSettings.json' because it is being used by another process..Exception.Message

I did a rerun and the the installation finished :)

Marcel

mattmcspirit commented 5 years ago

Thanks for this - i've seen this same error, and it's related to the multiple subscription logins across all the parallel jobs. I handled it before, when everything was being deployed into the Admin space, but I moved some deployments into the tenant space, thus need to log in there too. I'll look into that error and get it fixed.

Thanks!