diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java index a1c943c447..391459d41d 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java @@ -86,6 +86,12 @@ public class NetworkSettings { return networkAdapterSettings; } + /** + * DnsSettings is optional. + * If not included, defaults to DNS for the data center. + * PrimaryDns is required if DnsSettings is included. + * @return + */ public DnsSettings getDnsSettings() { return dnsSettings; } diff --git a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java index 8cafda17ba..84999dd58f 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java @@ -108,7 +108,7 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl public void testCreateVirtualMachineFromTemplate() throws Exception { CreateVirtualMachine.Builder builder = CreateVirtualMachine.builder(); - builder.name("VirtualMachine2") + builder.name("vmDMZ1") .processorCount(2) .memory(ResourceCapacity.builder().value(1024).unit("MB").build()); @@ -119,18 +119,21 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl AnonymousResource sshKey = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/admin/sshkeys/77")).type("application/vnd.tmrk.cloud.admin.sshKey").build(); NamedResource network = NamedResource.builder() - .href(URI.create("/cloudapi/ecloud/networks/3936")) - .name("10.146.204.64/28") + .href(URI.create("/cloudapi/ecloud/networks/3933")) + .name("10.146.205.128/27") .type("application/vnd.tmrk.cloud.network") .build(); NetworkAdapterSetting adapterSetting = NetworkAdapterSetting.builder() .network(network) - .ipAddress("10.146.204.68") + .ipAddress("10.146.205.131") .build(); NetworkAdapterSettings adapterSettings = NetworkAdapterSettings.builder() .addNetworkAdapterSetting(adapterSetting).build(); + + //DNS Settings are optional - and default to the data center dns settings if custom values are not provided. + //DnsSettings dnsSettings = DnsSettings.builder().primaryDns("10.1.1.1").secondaryDns("10.1.1.2").build(); NetworkSettings networkSettings = NetworkSettings.builder().networkAdapterSettings(adapterSettings).build(); LinuxCustomization linuxCustomization = LinuxCustomization.builder() @@ -145,8 +148,11 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl VirtualMachine vm = client.createVirtualMachineFromTemplate(URI.create("/cloudapi/ecloud/virtualMachines/computePools/89/action/createVirtualMachine"), builder.build()); assertNotNull(vm); + // For ssh login - next steps are: + // - Create an internet service for ssh (TCP port 22) on a public ip address + // - Create a node service to bind the port to the vm itself // TODO: Check that the VM is created OK. - // TODO: DNSSettings are missing + System.out.println(vm); //client.remove(vm.getHref()); //remove once verified - there needs to be no running tasks. } }