none
Service Provider Foundation API - POST Create Virtual Machine RRS feed

  • Question

  • I'm tring to use SPF APIs to build a custom webapp to build and manage vms.
    I'm able to start,stop,list VMs.
    But when I try to create a new VM, SPF return always with this error:
    <?xml version="1.0" encoding="utf-8"?>
    <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <m:code />
        <m:message xml:lang="en-US">Error Message: Cannot bind argument to parameter 'VMMServer' because it is an empty string.</m:message>
        <m:innererror>
            <m:message>Cannot bind argument to parameter 'VMMServer' because it is an empty string.</m:message>
            <m:type>Microsoft.SystemCenter.Foundation.Psws.Spf.PowerShellException</m:type>
            <m:stacktrace>   at Microsoft.SystemCenter.Foundation.Psws.HandleExceptionDecorator.HandleException(Exception exception)</m:stacktrace>
            <m:internalexception>
                <m:message>Cannot bind argument to parameter 'VMMServer' because it is an empty string.</m:message>
                <m:type>System.Management.Automation.ParameterBindingValidationException</m:type>
                <m:stacktrace>   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)&#xD;
       at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)&#xD;
       at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)&#xD;
       at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)&#xD;
       at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)&#xD;
       at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)&#xD;
       at Microsoft.ManagementServices.Diagnostics.Activity.ActivityMonitorExtensions.TryCatchRethrow[TResult](IActivityMonitor monitor, Func`1 instrumentedAction)&#xD;
       at Microsoft.SystemCenter.Foundation.Psws.PowerShellRequestInvoker.InvokeCmdlet(String operationName, PowerShell ps, String resourceTypeName, IEnumerable`1 properties)&#xD;
       at Microsoft.SystemCenter.Foundation.Psws.PowerShellRequestInvoker.&lt;&gt;c__DisplayClassd.&lt;Create&gt;b__c()&#xD;
       at Microsoft.ManagementServices.Diagnostics.Activity.ActivityMonitorExtensions.TryCatchRethrow[TResult](IActivityMonitor monitor, Func`1 instrumentedAction)&#xD;
       at Microsoft.SystemCenter.Foundation.Psws.OsInstanceDecorator.Create(ISpfOperationManagerContext context, String resourceTypeName, PropertyManager propertyManager)&#xD;
       at Microsoft.ManagementServices.Diagnostics.Activity.ActivityMonitorExtensions.TryCatchRethrow[TResult](IActivityMonitor monitor, Func`1 instrumentedAction)&#xD;
       at Microsoft.SystemCenter.Foundation.Psws.OrchestratorExtensibilityDecorator.Create(ISpfOperationManagerContext context, String resourceTypeName, PropertyManager propertyManager)&#xD;
       at Microsoft.SystemCenter.Foundation.Psws.HandleExceptionDecorator.Create(ISpfOperationManagerContext context, String resourceTypeName, PropertyManager propertyManager)</m:stacktrace>
            </m:internalexception>
        </m:innererror>
    </m:error>

    Url that I'm using is: https://hv-stvmm-2016.hyperv.local:8090/SC2012R2/VMM/Microsoft.Management.Odata.svc
    Body:

    {  
       "CloudId": "38927f9e-864e-4368-bcc6-4ce032189472",  
       "ComputerName": "TESTSPF",  
       "LocalAdminPassword": "!!123abc",  
       "LocalAdminUserName": "Administrator",  
       "Name": "Temp Machine Name",  
       "StampId": "ba4146fa-fb41-4f59-a193-ad00c52a138c",  
       "StartVM": true,  
       "VMTemplateId": "6cd4de31-19ea-4af3-b8cd-4c7c1fb135d9",  
       "odata.type": "VMM.VirtualMachine"
    }

    headers:
    [{"key":"Content-Type","value":"application/json","description":"","type":"text","enabled":true}]

    SPF is installed in the same server of VMM.

    thanks for possible help and support.

    Alessandro Melani

    Friday, May 31, 2019 10:22 AM

All replies

  • to continue with this issue, please open a support request. If you do not have a support plan, please Email me at AzCommunity@microsoft.com with your SubscriptionID and a link to this post, and I will create a one-time free support request for you to continue troubleshooting this issue. 
    Wednesday, June 5, 2019 6:41 PM