简体   繁体   中英

Azure The deployment name '' does not exist Java Create VM

I'm trying to deploy a VM using the Azure Java SDK. I am able to retrieve listings from my Azure portal through Java.

When trying to deploy the VM it asks for a Deployment Name in the function:

computeManagementClient.getVirtualMachinesOperations().create(String, String, VirtualMachineCreateParameters);

The second string is supposed to be Deployment Name, where can I find what this should be in the Azure portal or how do I create the deployment name container?

I've tried several names I thought might be correct and get the exception:

    Exception in thread "main" java.util.concurrent.ExecutionException: com.microsoft.windowsazure.exception.ServiceException: ResourceNotFound: The deployment name 'thundertest' does not exist.
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsImpl.create(VirtualMachineOperationsImpl.java:5359)
    at com.thunderhead.cloudlib.azure.RequestBuilder.createVirtualMachines(RequestBuilder.java:344)
    at com.thunderhead.cloudlib.azure.RequestBuilder.main(RequestBuilder.java:365)
Caused by: com.microsoft.windowsazure.exception.ServiceException: ResourceNotFound: The deployment name '<deploymentName?>' does not exist.
    at com.microsoft.windowsazure.exception.ServiceException.createFromXml(ServiceException.java:216)
    at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsImpl.beginCreating(VirtualMachineOperationsImpl.java:1884)
    at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsImpl$3.call(VirtualMachineOperationsImpl.java:1038)
    at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsImpl$3.call(VirtualMachineOperationsImpl.java:1035)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

首先调用computeManagementClient.getVirtualMachinesOperations().createDeployment()应该为您提供一个可以传递给computeManagementClient.getVirtualMachinesOperations().create的名称的部署对象。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM