none
Failed to load virtual machine templates RRS feed

  • Question

  • Having an issue with the vm templates in Azure Pack, when I let the tenant portal time out and asks me to log back in I get a error "Failed to load virtual machine templates for subscription d3987e45-f524-46ce-b8bb-b9d854454e01"

    If i login to the admin portal, change the VM templates and let it sync then the vm templates will load.

    Is there any timeout settings I can change for this?


    If this post answered your question, Mark As Answer If this post was helpful, Vote as Helpful ---------------------------------------------------------- http://lyncme.blogspot.com

    Wednesday, October 23, 2013 12:24 PM

Answers

  • Something like this


    $passwdz = "$(get-location)\password.txt"

    if(!(Test-Path -Path $passwdz))
    {
    $pass = Read-Host -AsSecureString -Prompt "Please enter YourDomainAdminUser password"
    ConvertFrom-SecureString $pass > $passwdz
    }

    # Establish the connection.
    $pass = ConvertTo-SecureString (Get-Content $passwdz) 
    $mycreds = New-Object System.Management.Automation.PSCredential ("YoudomainUser", $pass)


    Write-Host "Retreiving authentication token"
    $Token = Get-MgmtSvcToken -Type 'Windows' -AuthenticationSite "https://wapa:30072" -ClientRealm "http://azureservices/AdminSite"  -DisableCertificateValidation -User $mycreds

    Sync-MgmtSvcPlan -AdminUri "https://wapa:30004" -Token $Token -PlanId "You dummyPlanID"


    • Marked as answer by Tim_MCP Monday, April 28, 2014 4:32 PM
    Thursday, January 30, 2014 2:10 PM
  • Hello Everyone,

    I started this post months ago and have been just logging into the admin portal, and loading the plan which seems to fix the unable to load issue, but is a pain when your external and don't have access to the admin portal. SO, I have created a scheduled task to run every 30 min which runs a PowerShell script I have created, and since have not had to do anything. Below is what the script looks like.

    First, you will need to generate your admin password into a local file on the WAP server (don't worry its not visible in the txt file - this is to remove the requirement of entering your password to sync the plan

    PS C:\> read-host -assecurestring | convertfrom-securestring | out-file C:\cred.txt

    Next, take the below and paste it into a new .ps1 file

    $password = get-content C:\cred.txt | convertto-securestring
    $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "domain\admin_account",$password
    $Token = Get-MgmtSvcToken -Type Windows –AuthenticationSite "https://WAPSERVER:30072" -ClientRealm "http://azureservices/AdminSite" -User $credentials -DisableCertificateValidation
    Sync-MgmtSvcPlan -AdminUri "https://WAPSERVER:30004" -Token $token -PlanId "ENTER-PLAN-ID -DisableCertificateValidation

    then create a scheduled task in windows to load PowerShell.exe, and in the "add arguments" add the path to your .ps1 script.

    Hope this helps!


    If this post answered your question, Mark As Answer If this post was helpful, Vote as Helpful ---------------------------------------------------------- http://lyncme.blogspot.com

    • Marked as answer by Tim_MCP Monday, April 28, 2014 4:32 PM
    Monday, April 28, 2014 4:31 PM

All replies

  • This just started for me too, just out of the blue.

    --Dave

    Wednesday, October 23, 2013 11:52 PM
  • Hi guys,

    you are running RTM?

    Thanks,

    Wei

    Friday, October 25, 2013 7:49 AM
    Moderator
  • I am running RTM

    If this post answered your question, Mark As Answer If this post was helpful, Vote as Helpful ---------------------------------------------------------- http://lyncme.blogspot.com

    Friday, October 25, 2013 12:33 PM
  • Me too :)
    Friday, October 25, 2013 4:33 PM
  • HI All

    Could you please check a couple of Things:

    Is the SPF server running low on memory?

    Did you do a local install using WEB PI or did you use a scripted install?

    In the Admin POrtal do you see any errors under subscriptions?

    AndersR

    Saturday, November 2, 2013 9:13 AM
  • Same problem here. Rebooting the SPF server is resolving the problem but after a couple of hours the problem is back. Server is not using a lot of memory. No errors in the Admin portal.

    In the eventlog on the Tenant Portal server i am getting event ID 224

    Failed to load list of VM Templates for SubscriptionId: '468e7761-44ae-43b0-baf9-b4afc6c4b98e', Exception: 'DataServiceQueryException: An error occurred while processing this request.
    <Exception>
      <Type>DataServiceQueryException</Type>
      <Message>An error occurred while processing this request.</Message>
      <StackTrace><![CDATA[
       at System.Data.Services.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)
       at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, String method, IAsyncResult asyncResult)
       at System.Data.Services.Client.DataServiceQuery`1.EndExecute(IAsyncResult asyncResult)
       at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Server.VM.TenantExtension.Controllers.VMController.<GetVMTemplatesBySubscriptionId>d__a3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Server.VM.TenantExtension.Controllers.VMController.<>c__DisplayClass8f.<<GetVMTemplates>b__89>d__94.MoveNext()]]></StackTrace>
      <InnerException>
        <Type>DataServiceClientException</Type>
        <Message>InternalServerError</Message>
        <StackTrace><![CDATA[
       at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)
       at System.Data.Services.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)]]></StackTrace>
      </InnerException>
      <HttpContext>
        <User IsAuthenticated="true" Name="XXXX@XXXX" />
        <Request>
          <RawUrl>/VM/GetVMTemplates?ts=1385536669506</RawUrl>
          <UserHostAddress>10.10.11.18</UserHostAddress>
          <Headers>
            <Header Key="Connection" Value="keep-alive" />
            <Header Key="Content-Length" Value="277" />
            <Header Key="Content-Type" Value="application/json" />
            <Header Key="Accept" Value="application/json, text/javascript, */*; q=0.01" />
            <Header Key="Accept-Encoding" Value="gzip,deflate,sdch" />
            <Header Key="Accept-Language" Value="en-US,en;q=0.8,nl;q=0.6" />
            <Header Key="Host" Value="azure.XXXXXX.nl" />
            <Header Key="Referer" Value="https://azure.XXXXXX.nl/" />
            <Header Key="User-Agent" Value="Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36" />
            <Header Key="x-ms-client-session-id" Value="a4208c11-80a7-4e5e-824c-50aec3aa8557" />
            <Header Key="Origin" Value="https://azure.XXXXXX.nl" />
            <Header Key="x-ms-client-antiforgery-id" Value="Qo7SCCGUjeW7nCy8AkyNF4NaG8x3ojHzUfGCyhcjR4TEmYP8aan9HJpRlJ40NxXAI36kQT/dfh5qyPCgudlhVVL57siZkPs6mNwwlKlgnED0LCe/bgsaJZw1sjm2xeV2mXilDG3GFQp/1tcFMTgRBw==" />
            <Header Key="ETag" Value="" />
            <Header Key="X-Requested-With" Value="XMLHttpRequest" />
            <Header Key="x-ms-client-request-id" Value="ed97ca6f-f4f5-44b4-92b1-2c1adf14c0cb-2013-11-27 07:17:49Z" />
            <Cookies>
              <Cookie Name="_ga" Secure="false" Expires="0001-01-01T00:00:00Z" Domain="" Path="/" Value="Redacted (27 characters)" />
              <Cookie Name="__RequestVerificationToken_MemebershipAuthentication" Secure="false" Expires="0001-01-01T00:00:00Z" Domain="" Path="/" Value="Redacted (128 characters)" />
              <Cookie Name="__RequestVerificationToken_Tenant" Secure="false" Expires="0001-01-01T00:00:00Z" Domain="" Path="/" Value="Redacted (128 characters)" />
              <Cookie Name="MembershipSiteFedAuth" Secure="false" Expires="0001-01-01T00:00:00Z" Domain="" Path="/" Value="Redacted (1688 characters)" />
              <Cookie Name="TenantSiteFedAuth" Secure="false" Expires="0001-01-01T00:00:00Z" Domain="" Path="/" Value="Redacted (1400 characters)" />
              <Cookie Name="__aux" Secure="false" Expires="0001-01-01T00:00:00Z" Domain="" Path="/" Value="Redacted (152 characters)" />
              <Cookie Name="sub" Secure="false" Expires="0001-01-01T00:00:00Z" Domain="" Path="/" Value="Redacted (4 characters)" />
            </Cookies>
          </Headers>
        </Request>
      </HttpContext>

    • Edited by MaartenMJ Wednesday, November 27, 2013 7:55 AM
    Tuesday, November 26, 2013 8:17 PM
  • I've been experiencing the same problems. Eventually i updated the plans by adding a virtual machine template. After the Sync of the Subscriptions the problem was resolved. (A reboot did not resolve the problem)

    Let me know if this works for you.


    Wednesday, November 27, 2013 1:23 PM
  • Rebooting the SPF server or updating the plan is fixing the problem temporary. The big problem is that after a couple of hours or sometimes days the problem is back again.


    • Edited by MaartenMJ Friday, November 29, 2013 1:28 PM
    Friday, November 29, 2013 1:28 PM
  • I'm having the exact same problem? Did anyone managed to get this resolved?

    "Re-saving" the plan  or rebooting the spf server fixes it only for a few hours.


    http://www.winblogs.net windows geek blog support, patches, fixes


    • Edited by Slepix Thursday, December 12, 2013 11:54 PM
    Thursday, December 12, 2013 11:53 PM
  • Got the same issue. Opening the plan and clicking the "Virtual Machine Clouds" in the admin portal fixes the problem in the tenant portal (after refresh).

    Recycling the VMM application pool on the SPF server re-introduces the issue. So it must be something in VMM Application pool that does not start after recycling. :S

    Tuur

    Monday, January 13, 2014 11:30 AM
  • Hi MaartenMJ Did you find a permanent fix for this error?  I got exactly the same.
    Wednesday, January 22, 2014 5:50 PM
  • hi did you do something do fix it in production?  I got the same exact problem... very annoying.
    Saturday, January 25, 2014 2:31 AM
  • It seems like this issue only affects the Management Portal GUI.

    If you try this exact same method not with the Management Portal, but with the Tenant Public API (which by the way, the PowerShell cmdlets for Windows Azure Pack uses) it works as expected.


    All posted advice may not be all that accurate. As always, test it in a lab before you try my advice! Best of all, the documentation is your friend.

    Wednesday, January 29, 2014 1:13 AM
  • I confirm it work using the API.   I have a call opened for this with Microsoft.  Will see if they will be able to fix...  I wrote a little script to force @sync@ of a dummy plan every hour and it seem to help.
    Wednesday, January 29, 2014 2:40 PM
  • Emmanuel, could you post the script so we can atleast implement that as a quick fix until this issue gets resolved?

    Thank you very much. 


    http://www.winblogs.net windows geek blog support, patches, fixes

    Wednesday, January 29, 2014 3:35 PM
  • The Sync-MgmtSvcPlan cmdlet is your hint right there. Refer to the Get-Help cmdlet for instructions on using that said cmdlet.

    All posted advice may not be all that accurate. As always, test it in a lab before you try my advice! Best of all, the documentation is your friend.

    Wednesday, January 29, 2014 7:14 PM
  • Awesome, thank you. 

    http://www.winblogs.net windows geek blog support, patches, fixes

    Wednesday, January 29, 2014 7:25 PM
  • Something like this


    $passwdz = "$(get-location)\password.txt"

    if(!(Test-Path -Path $passwdz))
    {
    $pass = Read-Host -AsSecureString -Prompt "Please enter YourDomainAdminUser password"
    ConvertFrom-SecureString $pass > $passwdz
    }

    # Establish the connection.
    $pass = ConvertTo-SecureString (Get-Content $passwdz) 
    $mycreds = New-Object System.Management.Automation.PSCredential ("YoudomainUser", $pass)


    Write-Host "Retreiving authentication token"
    $Token = Get-MgmtSvcToken -Type 'Windows' -AuthenticationSite "https://wapa:30072" -ClientRealm "http://azureservices/AdminSite"  -DisableCertificateValidation -User $mycreds

    Sync-MgmtSvcPlan -AdminUri "https://wapa:30004" -Token $Token -PlanId "You dummyPlanID"


    • Marked as answer by Tim_MCP Monday, April 28, 2014 4:32 PM
    Thursday, January 30, 2014 2:10 PM
  • I can reproduce the problem "on demand" by doing a stop/start of SCVMM is it the case for you guys?  Syncing a dummy plan fix the issue otherwise I got the "Failed to load virtual template"...


    Sunday, February 2, 2014 4:55 PM
  • It would be useful to switch the debug tracing on the VMM machine.

    To do this need to follow the steps below:

    1. You can run the script to enable debug tracing:
      <Start script>
      logman stop VMMDebug
      logman delete VMMDebug
      logman create trace VMMDebug -v mmddhhmm -o %SystemDrive%\VMMlogs\DebugTrace_%computername%.ETL -cnf 01:00:00 -p Microsoft-VirtualMachineManager-Debug -nb 16 256 -bs 64
      logman start VMMDebug
      schtasks /create /F /RU "Administrator" /RP "!!123abc" /SC ONSTART /TN StartEngineTrace /TR "logman start VMMDebug"
      <End script>
    2. Once you are done with the log, type logman Stop VMMDebug. This will stop the trace session.
    3. Now you can copy the etl file from C:\VMMLogs and convert it for further use.
    4. To open ETL file you can follow the topic like this:
    http://social.technet.microsoft.com/Forums/windows/en-US/bbd398bd-aab4-4719-bc2a-9aa05c0057f3/how-do-i-read-the-windows-7-backup-log-file-etl?forum=w7itprogeneral
    Monday, February 3, 2014 7:32 PM
  • Hi,

    At some point did you guys renamed the spf URL server in WAP admin?  In my case I changed the URL when I putted the WAP behind a load balancer.... I think problem started happening after that.  Also I noticed when you change the URL the WAP all fields in database were not updated correctly ( I found some fields with previous URL value..).  I had to modify the value directly into the database.  I dont know if it will solve my problem...


    Monday, February 3, 2014 11:44 PM
  • I have an update. You don't actually have to sync the plan, you just have to read the plan quotas for any virtual machine cloud form any plan. Reading them is enough to fix the problem.

    Tuesday, February 4, 2014 6:15 PM
  • I Agree. Same here.

    Though i cannot find a powershell command for it. Do you have one?
    As a workaround we could schedule a job to read the plans every X hours.

    Wednesday, April 23, 2014 3:23 PM
  • Hi

    The problem is probably caused by an invalid SPF URL entry in the database..  (Ex: you decided to load balance SPF and changed URL..).  In my case I opened the WAP database and I corrected every value related to the SPF URL that were wrong.  Its look like the GUI isnt updating all table correctly...and that will cause you authentication problem...

    Wednesday, April 23, 2014 7:14 PM
  • Hi,

    I cannot find any SPF URL entry's in the database. I can find them of the Auth Site, ADFS, Admin and Tenant portal. I also just updated my WAP installation to CU2.

    Which tables should i look at?


    Thursday, April 24, 2014 9:45 AM
  • Look into Microsoft.MgmtSvc.Store DB --> mp.ResourceProviders   (setting for systemcenter)

    you will see several SPF Url be careful to check all columns...  you will probably see where the error is.


    Thursday, April 24, 2014 12:15 PM
  • Hello Everyone,

    I started this post months ago and have been just logging into the admin portal, and loading the plan which seems to fix the unable to load issue, but is a pain when your external and don't have access to the admin portal. SO, I have created a scheduled task to run every 30 min which runs a PowerShell script I have created, and since have not had to do anything. Below is what the script looks like.

    First, you will need to generate your admin password into a local file on the WAP server (don't worry its not visible in the txt file - this is to remove the requirement of entering your password to sync the plan

    PS C:\> read-host -assecurestring | convertfrom-securestring | out-file C:\cred.txt

    Next, take the below and paste it into a new .ps1 file

    $password = get-content C:\cred.txt | convertto-securestring
    $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "domain\admin_account",$password
    $Token = Get-MgmtSvcToken -Type Windows –AuthenticationSite "https://WAPSERVER:30072" -ClientRealm "http://azureservices/AdminSite" -User $credentials -DisableCertificateValidation
    Sync-MgmtSvcPlan -AdminUri "https://WAPSERVER:30004" -Token $token -PlanId "ENTER-PLAN-ID -DisableCertificateValidation

    then create a scheduled task in windows to load PowerShell.exe, and in the "add arguments" add the path to your .ps1 script.

    Hope this helps!


    If this post answered your question, Mark As Answer If this post was helpful, Vote as Helpful ---------------------------------------------------------- http://lyncme.blogspot.com

    • Marked as answer by Tim_MCP Monday, April 28, 2014 4:32 PM
    Monday, April 28, 2014 4:31 PM
  • Hi Everyone,

    I spent some time today on this issue..
    It seems it has to do with the VirtualHardDisk dependend on the VM Template added to a plan.
    In VMM you can change 2 settings on the VirtualHardDisk, OperatingSystem and VirtualizationPlatform:



    After choosing the right values the error went away, and haven't seen it since.

    I have put all the info on my blog:
    http://www.darrylvanderpeijl.nl/failed-to-load-virtual-machine-templates-for-subscription/

    Hope it helps!

    Tuesday, May 27, 2014 12:56 PM
  • An quick update:

    I know MSFT is working on this bug.
    They say it is a VMM issue, so its with the VMM Team.



    Tuesday, July 15, 2014 9:33 AM
  • Just got confirmation this bug will be addressed in UR4, coming around October time frame.
    Monday, August 4, 2014 10:06 AM
  • Hi ,

    We are facing the same issue , while getting vm templates from scvmm 2012 r2 , But we are not using WAP . We directly call SPF VMM service.

    So In this case what will be the solution,

    Is it something to do with VHD or VM template property means , this error must be consistent  but this error is inconsistent ...

    can anyone suggest a way to resolve it ????

    Wednesday, August 20, 2014 4:29 AM
  • I'd be interested to hear if the latest UR4 has fixed this issue for anyone who has installed this?

    I don't see any mention in their documentation for it about templates/SPF/VMM at all.  :-(

    Thursday, October 30, 2014 5:08 PM
  • Please can anyone confirm if this has been fixed with UR4?

    Thanks

    Monday, December 1, 2014 9:49 AM
  • Hi John,

    I can only confirm it has been fixed from testing in my lab.
    No official confirmation from MSFT so far...

    Monday, December 1, 2014 9:52 AM
  • Hi Darryl

    Thanks for the update - been banging my head off a brick wall with this one

    How long have you had it in testing for and is there anything which is going to kill my WAP setup?

    Now just the straight forward exercise of installing UR4 ;)

    Thanks

    John.

    Monday, December 1, 2014 10:02 AM
  • Hi John,

    I've not been able to test it very much, few days.

    To be clear, I've updated VMM and WAP to UR4.
    As said before in this topic, MSFT confirmed it is a bug in VMM and not in WAP.

    Update to UR4 is pretty straight forward, didn't experienced any problems. 
    Dont forget to run any update scripts.





    Monday, December 1, 2014 10:31 AM
  • Just updated my VMM / WAP setup - I will report back if the error has been resolved or not. 
    Monday, December 1, 2014 4:08 PM
  • Hi all,

    I just got confirmation from a Program Manager of Windows Azure Pack this is fixed in UR4.
    All components should be updated, VMM, SPF, WAP.

    Please report if your still experiencing any kind of issues.
    Monday, December 1, 2014 8:37 PM
  • Hi all

    After logging into WAP this morning I can confirm UR4 has fixed the issue!

    Thanks

    John.

    Tuesday, December 2, 2014 8:02 AM