Hi,

I am trying to deploy a Windows Server using *azurecompute*.

I was actually expecting to be able to create a Windows server using the
standard ComputeService

Template template = computeService.templateBuilder()
        .locationId("Australia East")
        
.imageId("ad072bd3082149369c449ba5832401ae__Windows-Server-Remote-Desktop-Session-Host-on-Windows-Server-2012-R2-20150828-0350")
        .hardwareId("BASIC_A0")
        .build();

but this code fails because it is expecting admin user name and password

POST
https://management.core.windows.net/32a55cff-e1c5-435f-9343-MYSUBSCRIPTION/services/hostedservices/inttest-f75/deployments
HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [<Error
xmlns="http://schemas.microsoft.com/windowsazure"; xmlns:i="
http://www.w3.org/2001/XMLSchema-instance";><Code>BadRequest</Code><Message>*The
value for parameter 'AdminUsername' is null or empty*.</Message></Error>

Is there any chance to send this parameter to the template ? I have tried
several options with no luck.

I saw that the Integration Tests of azurecompute is actually using
AzureComputeApi directly, in a code that looks like this:

public void createServer() throws Exception {
    AzureComputeApi azureAPI = this.getAzureComputeApi();
    DeploymentApi api = azureAPI.getDeploymentApiForService("mac1234service");
    DeploymentParams params = DeploymentParams.builder()
            .name("mydeployment")
            .size(RoleSize.Type.A0)
            
.sourceImageName("MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd")
            
.mediaLink(URI.create("http://blobs/disks/mydeployment/MSFT__Win2K8R2SP1-120612-1520-121206-01-en-us-30GB.vhd";))
            .os(OSImage.Type.WINDOWS)
            .username("username").password("testpwd")
            .virtualNetworkName("my-virtualNetworkName")
            .externalEndpoint(inboundTcpToLocalPort(80, 8080))
            .externalEndpoint(inboundUdpToLocalPort(53, 53))
            .build();
    String output = api.create(params);
    System.out.println("OPUTPUT: " + output);
}

However no matter what I try my-virtualNetworkName does not exists (even
when I create it using the Portal). However this code is create a new
CloudService when I just want to create a VM.

How can I create a new Windows VM ? Ideally, I would like to use
computeService.templateBuilder(), but any options would be considered.

Regards,
Ruben

Reply via email to