locked
Unable to Add Default VM Image to Azure Stack Dev Kit in disconnected mode RRS feed

  • Question

  • With Azure Stack Dev Kit(v1.0.180103.2) in disconnected mode, I'm unable to add the first default VM image ( as per https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-add-default-image). Hitting the error

    PS C:\AzureStack-Tools-master> New-AzsServer2016VMImage -ISOPath E:\temp\WS2016_SERVER_EVAL_X64FRE_EN-US.ISO
    VERBOSE: Checking ISO path for a valid ISO.
    addvmimagestorageaccount
    New-AzureStorageContainer : The remote server returned an error: (504) Gateway Timeout. HTTP Status Code: 504 - HTTP 
    Error Message: Unknown Host
    At C:\AzureStack-Tools-master\ComputeAdmin\AzureStack.ComputeAdmin.psm1:176 char:22
    + ... container = New-AzureStorageContainer -Name $containerName -Permissio ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [New-AzureStorageContainer], StorageException
        + FullyQualifiedErrorId : StorageException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.NewAzureStorageCo 
       ntainerCommand

    Any help, pointers?

    Wednesday, February 21, 2018 10:38 AM

All replies

  • Raghu,

    Can you please confirm that you have properly connected to Azure Stack prior to running the New-AzSServer2016VMImage command?  You will need to have run the following for an ADFS scenario:

    # For Azure Stack Development Kit, this value is set to https://adminmanagement.local.azurestack.external. To get this value for Azure Stack integrated systems, contact your service provider.
    $ArmEndpoint = "<Resource Manager endpoint for your environment>"
    
    # For Azure Stack Development Kit, this value is set to https://graph.local.azurestack.external/. To get this value for Azure Stack integrated systems, contact your service provider.
    $GraphAudience = "<GraphAuidence endpoint for your environment>"
    
    # Create the Azure Stack operator's Azure Resource Manager environment by using the following cmdlet:
    Add-AzureRMEnvironment `
     -Name "AzureStackAdmin" `
     -ArmEndpoint $ArmEndpoint
    
    Set-AzureRmEnvironment `
     -Name "AzureStackAdmin" `
     -GraphAudience $GraphAudience `
     -EnableAdfsAuthentication:$true
    
    $TenantID = Get-AzsDirectoryTenantId `
    -ADFS `
    -EnvironmentName "AzureStackAdmin" 
    
    Login-AzureRmAccount `
     -EnvironmentName "AzureStackAdmin" `
     -TenantId $TenantID

    The error seems to indicate that it cannot check to a remote endpoint to create the temporary storage container for the uploaded image.

    Wednesday, February 21, 2018 6:42 PM
  • Ned,

    Appreciate your response. Yes, I did execute the above, and here's the output

    PS C:\AzureStack-Tools-master> $ArmEndpoint = "https://adminmanagement.local.azurestack.external"
    $GraphAudience = "https://graph.local.azurestack.external/"
    Add-AzureRMEnvironment -Name "AzureStackAdmin" -ArmEndpoint $ArmEndpoint
    Set-AzureRmEnvironment -Name "AzureStackAdmin" -GraphAudience $GraphAudience -EnableAdfsAuthentication:$true
    $TenantID = Get-AzsDirectoryTenantId -ADFS -EnvironmentName "AzureStackAdmin" 
    Login-AzureRmAccount -EnvironmentName "AzureStackAdmin" -TenantId $TenantID


    Name                                              : AzureStackAdmin
    EnableAdfsAuthentication                          : True
    OnPremise                                         : True
    ActiveDirectoryServiceEndpointResourceId          : https://adminmanagement.adfs.azurestack.local/e6b76804-0d70-4c73-
                                                        b969-89c711849aee
    AdTenant                                          : 
    GalleryUrl                                        : https://adminportal.local.azurestack.external:30015/
    ManagementPortalUrl                               : 
    ServiceManagementUrl                              : 
    PublishSettingsFileUrl                            : 
    ResourceManagerUrl                                : https://adminmanagement.local.azurestack.external
    SqlDatabaseDnsSuffix                              : 
    StorageEndpointSuffix                             : local.azurestack.external
    ActiveDirectoryAuthority                          : https://adfs.local.azurestack.external/adfs/
    GraphUrl                                          : https://graph.local.azurestack.external/
    GraphEndpointResourceId                           : https://graph.local.azurestack.external/
    TrafficManagerDnsSuffix                           : 
    AzureKeyVaultDnsSuffix                            : vault.local.azurestack.external
    DataLakeEndpointResourceId                        : 
    AzureDataLakeStoreFileSystemEndpointSuffix        : 
    AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : 
    AzureKeyVaultServiceEndpointResourceId            : https://vault.local.azurestack.external
    VersionProfiles                                   : {}
    ExtendedProperties                                : {}

    Name                                              : AzureStackAdmin
    EnableAdfsAuthentication                          : True
    OnPremise                                         : True
    ActiveDirectoryServiceEndpointResourceId          : https://adminmanagement.adfs.azurestack.local/e6b76804-0d70-4c73-
                                                        b969-89c711849aee
    AdTenant                                          : 
    GalleryUrl                                        : https://adminportal.local.azurestack.external:30015/
    ManagementPortalUrl                               : 
    ServiceManagementUrl                              : 
    PublishSettingsFileUrl                            : 
    ResourceManagerUrl                                : https://adminmanagement.local.azurestack.external
    SqlDatabaseDnsSuffix                              : 
    StorageEndpointSuffix                             : local.azurestack.external
    ActiveDirectoryAuthority                          : https://adfs.local.azurestack.external/adfs/
    GraphUrl                                          : https://graph.local.azurestack.external/
    GraphEndpointResourceId                           : https://graph.local.azurestack.external/
    TrafficManagerDnsSuffix                           : 
    AzureKeyVaultDnsSuffix                            : vault.local.azurestack.external
    DataLakeEndpointResourceId                        : 
    AzureDataLakeStoreFileSystemEndpointSuffix        : 
    AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : 
    AzureKeyVaultServiceEndpointResourceId            : https://vault.local.azurestack.external
    VersionProfiles                                   : {}
    ExtendedProperties                                : {}

    Environments : {[AzureGermanCloud, AzureGermanCloud], [AzureCloud, AzureCloud], [AzureUSGovernment, 
                   AzureUSGovernment], [AzureChinaCloud, AzureChinaCloud]...}
    Context      : Microsoft.Azure.Commands.Profile.Models.PSAzureContext

    Thursday, February 22, 2018 11:55 AM
  • Update : I did get pass through the initial 504 error. Unchecked 'Proxy' in browser and the process of adding ISO went through. So, the Add ISO process was unable to reach https://addvmimagestorageaccount.blob.local.azurestack.external/ through proxy, though I've set to bypass proxy for local addresses. But still failing at last stage...

    PS C:\AzureStack-Tools-master> New-AzsServer2016VMImage -ISOPath E:\temp\WS2016_SERVER_EVAL_X64FRE_EN_US.ISO
    VERBOSE: Checking ISO path for a valid ISO.
    addvmimagestorageaccount


    AbsolutePath   : /
    AbsoluteUri    : https://addvmimagestorageaccount.blob.local.azurestack.external/
    LocalPath      : /
    Authority      : addvmimagestorageaccount.blob.local.azurestack.external
    HostNameType   : Dns
    IsDefaultPort  : True
    IsFile         : False
    IsLoopback     : False
    PathAndQuery   : /
    Segments       : {/}
    IsUnc          : False
    Host           : addvmimagestorageaccount.blob.local.azurestack.external
    Port           : 443
    Query          : 
    Fragment       : 
    Scheme         : https
    OriginalString : https://addvmimagestorageaccount.blob.local.azurestack.external/
    DnsSafeHost    : addvmimagestorageaccount.blob.local.azurestack.external
    IdnHost        : addvmimagestorageaccount.blob.local.azurestack.external
    IsAbsoluteUri  : True
    UserEscaped    : False
    UserInfo       : 

    MD5 hash is being calculated for the file  C:\AzureStack-Tools-master\ComputeAdmin\Server2016DatacenterFullEval.vhd.
    MD5 hash calculation is completed.
    Elapsed time for the operation: 00:03:24
    Creating new page blob of size 42949673472...
    Elapsed time for upload: 00:03:20
    LocalFilePath  : C:\AzureStack-Tools-master\ComputeAdmin\Server2016DatacenterFullEval.vhd
    DestinationUri : https://addvmimagestorageaccount.blob.local.azurestack.external/addvmimagecontainer/Server2016Datace
                     nterFullEval.vhd

    New-AzsServer2016VMImage : The operation failed because resource is in the: 'Failed' state. Please check the logs 
    for more details.
    At line:1 char:1
    + New-AzsServer2016VMImage -ISOPath E:\temp\WS2016_SERVER_EVAL_X64FRE_E ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Write-Error], InvalidOperationException
        + FullyQualifiedErrorId : New-AzsServer2016VMImage

    Thursday, February 22, 2018 12:36 PM
  • It sounds as if some resource didn't clean up properly after the first attempted run.  During the process, a resource group called "addvmimageresourcegroup" is created.  Before running the command again, try deleting that resource group to make sure that any items left over from previous runs are removed.  Second, make sure that the namespace *.azurestack.external is considered a local site.  

    Then go ahead and try to run the command again.  If that doesn't work, you can manually upload the VHD to a storage container on Azure Stack, and then use the Add-AzSVMImage command with the -OSDiskBlobURI parameter pointing to the already uploaded VHD.

    Let me know if that helps.

    Friday, February 23, 2018 1:30 PM