private void conditionallyCheckSSH() { if (vm.getPassword() != null && loginCredentials.getOptionalPassword() == null) loginCredentials = loginCredentials.toBuilder().password(vm.getPassword()).build(); assert HostSpecifier.isValid(vm.getIPAddress()); if (!InetAddresses2.isPrivateIPAddress(vm.getIPAddress())) { // not sure if the network is public or not, so we have to test HostAndPort socket = HostAndPort.fromParts(vm.getIPAddress(), 22); System.err.printf("testing socket %s%n", socket); System.err.printf("testing ssh %s%n", socket); checkSSH(socket); } else { System.err.printf("skipping ssh %s, as private%n", vm.getIPAddress()); } }
private void conditionallyCheckSSH() { if (vm.getPassword() != null && !loginCredentials.getOptionalPassword().isPresent()) loginCredentials = loginCredentials.toBuilder().password(vm.getPassword()).build(); assert HostSpecifier.isValid(vm.getIPAddress()); if (!InetAddresses2.isPrivateIPAddress(vm.getIPAddress())) { // not sure if the network is public or not, so we have to test HostAndPort socket = HostAndPort.fromParts(vm.getIPAddress(), 22); System.err.printf("testing socket %s%n", socket); System.err.printf("testing ssh %s%n", socket); checkSSH(socket); } else { System.err.printf("skipping ssh %s, as private%n", vm.getIPAddress()); } }
if (from.getIPAddress() != null) { boolean isPrivate = isPrivateIPAddress(from.getIPAddress()); if (isPrivate) { privateAddresses.add(from.getIPAddress()); } else { publicAddresses.add(from.getIPAddress());
if (from.getIPAddress() != null) { boolean isPrivate = isPrivateIPAddress(from.getIPAddress()); if (isPrivate) { privateAddresses.add(from.getIPAddress()); } else { publicAddresses.add(from.getIPAddress());
if (from.getIPAddress() != null) { boolean isPrivate = isPrivateIPAddress(from.getIPAddress()); if (isPrivate) { privateAddresses.add(from.getIPAddress()); } else { publicAddresses.add(from.getIPAddress());
@Test(dependsOnMethods = "testCreateIngress") public void testCreateVMInSecurityGroup() throws Exception { skipIfSecurityGroupsNotSupported(); String defaultTemplate = templateBuilderSpec != null ? templateBuilderSpec.getImageId() : null; vm = VirtualMachineApiLiveTest.createVirtualMachineWithSecurityGroupInZone(zone.getId(), defaultTemplateOrPreferredInZone(defaultTemplate, client, zone.getId()), group.getId(), client, jobComplete, virtualMachineRunning); if (vm.getPassword() != null && !loginCredentials.getOptionalPassword().isPresent()) loginCredentials = loginCredentials.toBuilder().password(vm.getPassword()).build(); // ingress port 22 checkSSH(HostAndPort.fromParts(vm.getIPAddress(), 22)); // ingress icmp disabled as this is platform dependent and may actually // just try tcp port 7 // assert InetAddress.getByName(vm.getIPAddress()).isReachable(1000) : vm; }
@Test(dependsOnMethods = "testCreateIngress") public void testCreateVMInSecurityGroup() throws Exception { skipIfSecurityGroupsNotSupported(); String defaultTemplate = template != null ? template.getImageId() : null; vm = VirtualMachineClientLiveTest.createVirtualMachineWithSecurityGroupInZone(zone.getId(), defaultTemplateOrPreferredInZone(defaultTemplate, client, zone.getId()), group.getId(), client, jobComplete, virtualMachineRunning); if (vm.getPassword() != null && loginCredentials.getOptionalPassword() == null) loginCredentials = loginCredentials.toBuilder().password(vm.getPassword()).build(); // ingress port 22 checkSSH(HostAndPort.fromParts(vm.getIPAddress(), 22)); // ingress icmp disabled as this is platform dependent and may actually // just try tcp port 7 // assert InetAddress.getByName(vm.getIPAddress()).isReachable(1000) : vm; }
@Test public void testCreateNodeWithGroupEncodedIntoName() { String group = prefix + "-foo"; String name = group + "-node-" + new Random().nextInt(); Template template = view.getComputeService().templateBuilder().build(); if (!client .getTemplateClient() .getTemplateInZone(template.getImage().getId(), template.getLocation().getId()).isPasswordEnabled()) { // TODO: look at SecurityGroupClientLiveTest for how to do this template.getOptions().as(CloudStackTemplateOptions.class).keyPair(keyPairName); } vm = adapter.createNodeWithGroupEncodedIntoName(group, name, template); assertEquals(vm.getNode().getDisplayName(), name); // check to see if we setup a NAT rule (conceding we could check this from // cache) IPForwardingRule rule = getFirst( client.getNATClient().getIPForwardingRulesForVirtualMachine(vm.getNode().getId()), null); String address = rule != null ? rule.getIPAddress() : vm.getNode().getIPAddress(); loginCredentials = prioritizeCredentialsFromTemplate.apply(template, vm.getCredentials()); assert InetAddresses.isInetAddress(address) : vm; HostAndPort socket = HostAndPort.fromParts(address, 22); checkSSH(socket); }
@Test public void testCreateNodeWithGroupEncodedIntoName() { String group = prefix + "-foo"; String name = group + "-node-" + new Random().nextInt(); Template template = view.getComputeService().templateBuilder().build(); if (!client .getTemplateApi() .getTemplateInZone(template.getImage().getId(), template.getLocation().getId()).isPasswordEnabled()) { // TODO: look at SecurityGroupApiLiveTest for how to do this template.getOptions().as(CloudStackTemplateOptions.class).keyPair(keyPairName); } vm = adapter.createNodeWithGroupEncodedIntoName(group, name, template); assertEquals(vm.getNode().getDisplayName(), name); // check to see if we setup a NAT rule (conceding we could check this from // cache) IPForwardingRule rule = getFirst( client.getNATApi().getIPForwardingRulesForVirtualMachine(vm.getNode().getId()), null); String address = rule != null ? rule.getIPAddress() : vm.getNode().getIPAddress(); loginCredentials = prioritizeCredentialsFromTemplate.apply(template, vm.getCredentials()); assert InetAddresses.isInetAddress(address) : vm; HostAndPort socket = HostAndPort.fromParts(address, 22); checkSSH(socket); }
.hostId(in.getHostId()) .hostname(in.getHostname()) .IPAddress(in.getIPAddress()) .ISODisplayText(in.getISODisplayText()) .ISOId(in.getISOId())
.hostId(in.getHostId()) .hostname(in.getHostname()) .IPAddress(in.getIPAddress()) .ISODisplayText(in.getISODisplayText()) .ISOId(in.getISOId())
.hostId(in.getHostId()) .hostname(in.getHostname()) .IPAddress(in.getIPAddress()) .ISODisplayText(in.getISODisplayText()) .ISOId(in.getISOId())