Package org.jclouds.compute.domain

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


      }
      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

      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

      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

      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

     * 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

   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

   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

     ShellTable table = shellTableFactory.build("node");
     table.setDisplayData(nodes);
     table.display(out, true, true);

      for (ComputeMetadata metadata : nodes) {
         NodeMetadata node = (NodeMetadata) metadata;
        for (String cacheKey : ServiceHelper.findCacheKeysForService(service)) {
          cacheProvider.getProviderCacheForType(Constants.GROUP).put(cacheKey, node.getGroup());
        }
      }
   }
View Full Code Here

      } catch (Throwable t) {
         System.err.println(t.getMessage());
         return null;
      }

      NodeMetadata node = service.getNodeMetadata(id);
      printNodeInfo(service, Sets.newHashSet(node), true, System.out);
      return null;
   }
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.NodeMetadata

Copyright © 2018 www.massapicom. 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.