Skip to content
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

New-Server2016VMImage - Error after download image. #104

Closed
markscholman opened this issue Mar 15, 2017 · 13 comments
Closed

New-Server2016VMImage - Error after download image. #104

markscholman opened this issue Mar 15, 2017 · 13 comments

Comments

@markscholman
Copy link

The build of the VHD completes, upload works, then after downloading an error occurred about that 'A parameter cannot be found that matches parameter name 'SubscriptionId'.' We had it working on the same hosts (30+) last week. Now its broken since 2 days.

@JakobGSvendsen
Copy link

I synced the repo yesterday and ran this command without issues. just using:
$ISOPath = "C:\Users\AzureStackAdmin\Downloads\14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO"
New-Server2016VMImage -ISOPath $ISOPath -TenantId $aadTenant -IncludeLatestCU -Net35

@markscholman
Copy link
Author

We use credentials stored in a variable:
$ISOPath = "D:\MAS-CON01\Images\en_windows_server_2016_x64_dvd_9718492.iso"
New-Server2016VMImage -ISOPath $ISOPath -TenantId $aadTenant -IncludeLatestCU -Net35 -AzureStackCredentials $AADAdminCredential
Maybe that's an issue.. but we did 30+ servers using this automation script last week.. and I need to redeploy 30+ servers this Friday again :)

@JakobGSvendsen
Copy link

could also be if the credentials is in multiple Azure ADs, I had a similar issue/error once when deploying an older TP. Is the account you use from another azure ad? or does it only exist in the tenant that you are providing? otherwise you might want to try to use one that only exist in that AD.

@markscholman
Copy link
Author

Its a single AAD that the admin is administrator of, Also all the stuff upfront just works... it creates a storage account, upload image, then download and the subscriptionId error pops up. so don't believe its an issue in using credentials as a variable but a change in the tools script and parameters that are missed now in the new command.

@JakobGSvendsen
Copy link

agree. sounds like it, was just trying to come up with ideas to try :D

@ned1313
Copy link
Contributor

ned1313 commented Mar 15, 2017

The Add-AzureRmGalleryItem Command is missing the -SubscriptionID parameter in version 0.10.6 of the AzureRM.AzureStackAdmin module. I don't know if there was another module providing this cmdlet prior. I should mention that the 0.10.6 version of the module was released yesterday.

@ned1313
Copy link
Contributor

ned1313 commented Mar 15, 2017

Short term workaround is to comment out line #353 in AzureStack.ComputerAdmin.psm1 and add the line Add-AzureRMGalleryItem -GalleryItemUri $galleryItemURI
Then Remove and Load the ComputeAdmin module. Confirmed that this works.

@markscholman
Copy link
Author

Hi Ned, thanks, I have tried that this morning and gave me some other errors that it cannot validate parameter GalleryItemURI.
Used this script:
$ISOPath = "D:\MAS-CON01\Images\en_windows_server_2016_x64_dvd_9718492.iso"
New-Server2016VMImage -ISOPath $ISOPath -TenantId $aadTenant -IncludeLatestCU -Net35 -AzureStackCredentials $AADAdminCredential -ArmEndpoint $AdminArmEndpoint

All variables has values.

@ned1313
Copy link
Contributor

ned1313 commented Mar 15, 2017

That's interesting. I used the Add-VMImage cmdlet rather than the New-Server2016VMImage cmdlet to test. I don't see any major differences, but I can do some more testing with the cmdlet you are referencing.

@MatthewMcGlynn
Copy link
Contributor

Thanks folks - I think I have an idea of the solution. We had some issues with changes that went into the latest AzureStack module. Try using the following when adding the Azure Stack module and let me know if you still see the issue:
Install-Module -Name AzureStack -RequiredVersion 1.2.8 -Scope CurrentUser

I added it to the ReadMe, but it will be a bit longer before it makes it into the official documentation.

@ned1313
Copy link
Contributor

ned1313 commented Mar 16, 2017

Forcing version 1.2.8 of AzureStack does seem to pull down the correct version of the Add-AzureRMGalleryItem cmdlet. I was also able to run the New-Server2016VMImage cmdlet using the workaround I detailed above.

@markscholman
Copy link
Author

Hi Metthew, I can confirm it works again when specifying the version. So I use this now:
Install-Module -Name AzureRM -RequiredVersion 1.2.8 -Force
Install-Module -Name AzureStack -RequiredVersion 1.2.8 -Force

Thanks

@markscholman
Copy link
Author

By specifying the -requiredversion parameter on the AzureStack module will resolve issues regarding -SubscriptionId parameter errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants