Examples of NodeMetadata


Examples of org.jclouds.compute.domain.NodeMetadata

      final String folder = "redHatAndDerivatives";
      if (osTypeId.contains("RedHat")) {
         File scriptFile = copyScriptToWorkingDir(folder, scriptName);
         copyToNodeAndExecScript(guestOsUser, guestOsPassword, clone.getName(), scriptFile);
      } else if (osTypeId.contains("Ubuntu") || osTypeId.contains("Debian")) {
         NodeMetadata partialNodeMetadata = buildPartialNodeMetadata(clone, guestOsUser, guestOsPassword);

         Optional<NetworkInterfaceCard> optionalNatIfaceCard = Iterables.tryFind(
                 networkSpec.getNetworkInterfaceCards(),
                 new Predicate<NetworkInterfaceCard>() {
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      String hostOnlyIfIpAddress = iHostNetworkInterfaceWithHostOnlyIfName.getIPAddress();
      String dhcpIpAddress = hostOnlyIfIpAddress.substring(0, hostOnlyIfIpAddress.lastIndexOf(".")) + ".254";
      String dhcpNetmask = "255.255.255.0";
      String dhcpLowerIp = hostOnlyIfIpAddress.substring(0, hostOnlyIfIpAddress.lastIndexOf(".")) + ".2";
      String dhcpUpperIp = hostOnlyIfIpAddress.substring(0, hostOnlyIfIpAddress.lastIndexOf(".")) + ".253";
      NodeMetadata hostNodeMetadata = getHostNodeMetadata();

      ExecResponse response = scriptRunnerFactory
            .create(
                  hostNodeMetadata,
                  Statements.exec(String
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

                  runAsRoot(false).wrapInInitScript(false)).init().call();
      checkState(response.getExitStatus() == 0);
   }

   private String createHostOnlyIf() {
      NodeMetadata hostNodeMetadata = getHostNodeMetadata();
      ExecResponse createHostOnlyResponse = scriptRunnerFactory
            .create(hostNodeMetadata, Statements.exec("VBoxManage hostonlyif create"),
                  runAsRoot(false).wrapInInitScript(false)).init().call();
      String output = createHostOnlyResponse.getOutput();
      checkState(createHostOnlyResponse.getExitStatus() == 0, "cannot create hostonly interface ");
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      }
      File file = new File(isosDir, fileName);
      List<Statement> statements = new ImmutableList.Builder<Statement>().add(
            Statements.saveHttpResponseTo(URI.create(httpUrl), isosDir, fileName)).build();
      StatementList statementList = new StatementList(statements);
      NodeMetadata hostNode = checkNotNull(hardcodedHostToHostNodeMetadata.apply(host.get()), "hostNode");
      ListenableFuture<ExecResponse> future = runScriptOnNodeFactory.submit(hostNode, statementList,
            runAsRoot(false));
      Futures.getUnchecked(future);

      if (expectedMd5 != null) {
         String filePath = isosDir + File.separator + fileName;
         ListenableFuture<ExecResponse> md5future = runScriptOnNodeFactory.submit(hostNode, new Md5(filePath),
               runAsRoot(false));

         ExecResponse responseMd5 = Futures.getUnchecked(md5future);
         assert responseMd5.getExitStatus() == 0 : hostNode.getId() + ": " + responseMd5;
         checkNotNull(responseMd5.getOutput(), "iso_md5 missing");
         String actualMd5 = responseMd5.getOutput().trim();
         checkState(actualMd5.equals(expectedMd5), "md5 of %s is %s but expected %s", filePath, actualMd5, expectedMd5);
      }
      return file.getAbsolutePath();
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      Stopwatch stopwatch = new Stopwatch();
      stopwatch.start();
      checkState(sshResponds.apply(client), "timed out waiting for guest %s to be accessible via ssh", masterName);
      stopwatch.stop();
      logger.debug(String.format("Elapsed time for the OS installation: %d minutes", TimeUnit.SECONDS.convert(stopwatch.elapsed(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS)));
      NodeMetadata nodeMetadata = imachineToNodeMetadata.apply(masterMachine);

      logger.debug(">> awaiting post-installation actions on vm: %s", masterName);
      ListenableFuture<ExecResponse> execCleanup = machineUtils.runScriptOnNode(nodeMetadata,
               call("cleanupUdevIfNeeded"), RunScriptOptions.NONE);
      ExecResponse cleanupResponse = Futures.getUnchecked(execCleanup);
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      INetworkAdapter hostOnly = createNiceMock(INetworkAdapter.class);
      NetworkUtils networkUtils = createNiceMock(NetworkUtils.class);

      replay(vm, vBox, iGuestOSType, nat, natEng, hostOnly, networkUtils);

      NodeMetadata node = new IMachineToNodeMetadata(Suppliers
              .ofInstance(vbm), VirtualBoxComputeServiceContextModule.toPortableNodeStatus,
            networkUtils, map).apply(vm);

      assertEquals(MASTER_NAME, node.getName());
      assertEquals(1, node.getPrivateAddresses().size());
      assertEquals(1, node.getPublicAddresses().size());
      assertEquals("127.0.0.1", Iterables.get(node.getPublicAddresses(), 0));
      assertEquals(NetworkUtils.MASTER_PORT, node.getLoginPort());
      assertEquals("", node.getGroup());
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

      expect(natEng.getRedirects()).andReturn(ImmutableList.of("0,1,127.0.0.1,3000,,22"));
      NetworkUtils networkUtils = createNiceMock(NetworkUtils.class);

      replay(vm, nat, natEng, hostOnly, networkUtils);

      NodeMetadata node = new IMachineToNodeMetadata(Suppliers
              .ofInstance(vbm), VirtualBoxComputeServiceContextModule.toPortableNodeStatus,
            networkUtils, map).apply(vm);

      assertEquals(name, node.getName());
      assertEquals(group, node.getGroup());
      assertEquals(1, node.getPublicAddresses().size());
   }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

     * destroy the node, given its id. If it is the only node in a tag set, the dependent resources
     * will also be destroyed.
     */
    @Override
    public void destroyNode(String id) {
        NodeMetadata node = null;
        try {
            node = computeService.getNodeMetadata(id);
        } catch (Exception ex) {
            LOGGER.error("Error while retrieving node metadata.", ex);
        }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

   public void updateOnAdded(ComputeService computeService) {
      if (computeService != null) {
         Set<? extends ComputeMetadata> computeMetadatas = computeService.listNodes();
         if (computeMetadatas != null) {
            for (ComputeMetadata compute : computeMetadatas) {
               NodeMetadata node = (NodeMetadata) compute;
               if (apply(node)) {
                 for (String cacheKey : ServiceHelper.findCacheKeysForService(computeService)) {
                   cache.put(cacheKey, node.getGroup());
                 }
               }
            }
         }
      }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeMetadata

   public void updateOnAdded(ComputeService computeService) {
      if (computeService != null) {
         Set<? extends ComputeMetadata> computeMetadatas = computeService.listNodes();
         if (computeMetadatas != null) {
            for (ComputeMetadata compute : computeMetadatas) {
               NodeMetadata node = (NodeMetadata) compute;
               if (apply(node)) {
                 for (String cacheKey : ServiceHelper.findCacheKeysForService(computeService)) {
                   cache.put(cacheKey, node.getId());
                 }
               }
            }
         }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.