Skip to content

Marketplace item generation executable download does not handle disconnected environments #313

Open

Description

@MatthewMcGlynn
No description provided.

Activity

  1. MatthewMcGlynn commented on Aug 23, 2017

    @MatthewMcGlynn
    ContributorAuthor

    A new parameter is needed to ingest the marketplace item packager from a local path

  2. dfencegit commented on Apr 7, 2018

    @dfencegit

    Hi

    I tweaked the code in AzureStack.ComputeAdmin.psm1 to allow you to specify a pre-downloaded Marketplace Item generator package so that you can do an offline install, give it a try.

    137a138,140

        [Parameter()]
        [string] $MarketPlaceZipPath = '',
    

    300c303
    < $GalleryItem = CreateGalleryItem -publisher $publisher -offer $offer -sku $sku -version $version -osType $osType -title $title -description $description

        $GalleryItem = CreateGalleryItem -publisher $publisher -offer $offer -sku $sku -version $version -osType $osType -title $title -description $description -MarketPlaceZipPath "$MarketPlaceZipPath"
    

    473c476,479
    < [bool] $Net35 = $true

        [bool] $Net35 = $true,
    
        [Parameter()]
        [string] $MarketPlaceZipPath
    

    660c666
    < Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Core Eval" -description $description -CreateGalleryItem $CreateGalleryItem

                    Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Core Eval" -description $description -CreateGalleryItem $CreateGalleryItem -MarketPlaceZipPath "$MarketPlaceZipPath"
    

    694c700
    < Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Eval" -description $description -CreateGalleryItem $CreateGalleryItem

                    Add-AzsVMImage -sku $sku -osDiskLocalPath $ImagePath @PublishArguments -title "Windows Server 2016 Datacenter Eval" -description $description -CreateGalleryItem $CreateGalleryItem -MarketPlaceZipPath "$MarketPlaceZipPath"
    

    732c738,740
    < [string] $Description

        [string] $Description,
    
        [string] $MarketPlaceZipPath = ''
    

    742,752c750,764
    <
    < $maxAttempts = 5
    < for ($retryAttempts = 1; $retryAttempts -le $maxAttempts; $retryAttempts++) {
    < try {
    < Write-Verbose -Message "Downloading Azure Stack Marketplace Item Generator Attempt $retryAttempts" -Verbose
    < Invoke-WebRequest -Uri http://www.aka.ms/azurestackmarketplaceitem -OutFile "$workdir\MarketplaceItem.zip"
    < break
    < }
    < catch {
    < if ($retryAttempts -ge $maxAttempts) {
    < Write-Error "Failed to download Azure Stack Marketplace Item Generator" -ErrorAction Stop

    # Check if we were provided with the MarketPlace Item Generator File
    if ( $MarketPlaceZipPath = '' )
    {
        $maxAttempts = 5
        for ($retryAttempts = 1; $retryAttempts -le $maxAttempts; $retryAttempts++) {
            try {
                Write-Verbose -Message "Downloading Azure Stack Marketplace Item Generator Attempt $retryAttempts" -Verbose
                Invoke-WebRequest -Uri http://www.aka.ms/azurestackmarketplaceitem -OutFile "$workdir\MarketplaceItem.zip"
                break
            }
            catch {
                if ($retryAttempts -ge $maxAttempts) {
                    Write-Error "Failed to download Azure Stack Marketplace Item Generator" -ErrorAction Stop
                }
    

    755a768,786

    else
    {
        # Copy the provided file into the working directory
        if ( Test-Path -Path "$MarketPlaceZipPath" )
        {
            try {
                Write-Verbose -Message "Copying Market Place Item Generator zip file into working directory" -Verbose
                copy-item -Path "$MarketPlaceZipPath" -Destination "$workdir\MarketplaceItem.zip"
            }
            catch
            {
                Write-Error "Failed to copy Market Place Item Generator zip into working directory: $_" -ErrorAction Stop
            }
        }
        else
        {
            Write-Error "Provided Market Place Item Generator zip file does not exist" -ErrorAction Stop
        }
    }
    
  3. dfencegit commented on Apr 7, 2018

    @dfencegit

    Sorry, there was an error in that update, new diff attached this time.

    AzureStack.ComputeAdmin.psm1.diff.txt

  4. marcvaneijk commented on Apr 12, 2018

    @marcvaneijk
    Contributor

    Anthony Clack (@dfencegit), thanks! Since you have the diff, can you open a PR?

  5. dfencegit commented on Apr 13, 2018

    @dfencegit

    Marc van Eijk (@marcvaneijk) I would happily do that but I dont have access to raise a PR.

  6. marcvaneijk commented on Apr 26, 2018

    @marcvaneijk
    Contributor

    Thanks Anthony Clack (@dfencegit). The AzureStack-Tools repo is a public repo. Anyone with a GitHub account has access to submit a pull request. It would be great if you can do so. Once you have submitted the PR, we'll evaluate it and if approved, we'll merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions