W2K12R2+WIN8.1 VM + RDS - Create new collection fails with "A virtual disk is not attached to the virtual desktop" RRS feed

  • Question

  • W2K12R2 and WIN8.1 media are the "developer preview" releases.
    WIN8.1 is being used as a template for VDI instances. GoS has been put through sysprep etc.

    RDS>Create Collection>..>Specify Virtual Desktop Template>
    This fails with error in UI "The virtual hard disk is not connected to the virtual desktop"

    I ended up getting the "real" error backtrace from sysinternals DebugView.
    The actual failure was constrained to a specific check on the VM from RDS.
    00000001 0.00000000 [5524] ServerManager.exe Warning: 0 :
    00000002 0.00002018 [5524] 23/08/2013 22:31:20.44: RdmsUI: Exception occurred in IsMasterVMPrerequisiteSatisfied for VM WIN81_ENT, VMHost DPLHP380G8-6 Exception details: System.Runtime.InteropServices.COMException (0x88130213)
    00000003 0.00002018 [5524] at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
    00000004 0.00002018 [5524] at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
    00000005 0.00002018 [5524] at Microsoft.RemoteDesktopServices.Common.TsVm.QueryOfflineInformation(String& Build, String& CurrentVersion, String& EditionId, Boolean& fIsRdvIcInstalled, Boolean& fIsVmbusCapable, String& InstallationType, Int32& ProcArch, String& SysPrepImageState, String& SysPrepMode)
    00000006 0.00002018 [5524] at Microsoft.RemoteDesktopServices.RDManagement.Model.ExternalApiProvider.GetOfflineVmInformation(String vmName, String hostName)
    00000007 0.00002018 [5524] at Microsoft.RemoteDesktopServices.RDManagement.ViewModel.Collections.MasterVirtualMachineViewModel.IsMasterVMPrerequisiteSatisfied(VMDescriptor masterVM) 

    A posh script to perform the same actions also fails
    PS C:\> .\rdsprov.ps1
    VERBOSE: Verifying input...
    VERBOSE: Testing OU permissions
    Test-MasterVm : Failed to validate the virtual desktop template. Error: -2012020205.
    Verify that the virtual desktop template is sysprep generalized, in stopped state, and connected to the network, and
    that it has at least 1 GB of RAM.
    At C:\windows\system32\windowspowershell\v1.0\Modules\RemoteDesktop\VirtualDesktopCollection.psm1:3715 char:13
    +     if(-not(Test-MasterVm   -VirtualDesktopTemplateName $VirtualDesktopTemplateN ...
    +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-MasterVm

    Stepping through the module "VirtualDesktopCollection.psm1" and trying to enum the object "QueryOfflineInformation" shows its empty.
    PS C:\> $masterVm = Get-WmiObject Win32_TsVm -Namespace root\cimv2\TerminalServices -ComputerName $VirtualDesktopTemplat
    eHostServer -Authentication PacketPrivacy -Impersonation Impersonate -ErrorAction Stop -Filter "VmName='$VirtualDesktopT
    PS C:\> $outParams =$masterVm.QueryOfflineInformation()
    Exception calling "QueryOfflineInformation" : ""
    At line:1 char:1
    + $outParams =$masterVm.QueryOfflineInformation()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : WMIMethodException

    Just on a hunch I went back to WIN 8.0 and WIN7 as the GoS and only WIN7 works, as QueryOfflineInformation returns the values.
    PS C:\> $outParams
    __GENUS           : 2
    __CLASS           : __PARAMETERS
    __SUPERCLASS      :
    __DYNASTY         : __PARAMETERS
    __RELPATH         :
    __PROPERTY_COUNT  : 10
    __DERIVATION      : {}
    __SERVER          :
    __NAMESPACE       :
    __PATH            :
    Build             : 7601
    CurrentVersion    : 6.1
    EditionId         : Enterprise
    fIsRdvIcInstalled : True
    fIsVmbusCapable   : True
    InstallationType  : Client
    ProcArch          : 1
    ReturnValue       : 0
    SysPrepMode       :
    PSComputerName    :

    I am not sure if it is the VM OS version of the VM Generation type 1 or 2.  Ill use WIN7 for now as the GoS template but I really want to use WIN 8.1.
    The UI should have been bleating about the VHD metadata and not the VHD attach state, posh should have dumped out the variable with the null value.

    Thursday, August 29, 2013 8:23 PM