Package org.jclouds.openstack.nova.v2_0.domain

Examples of org.jclouds.openstack.nova.v2_0.domain.ServerCreated


      String zoneId = template.getLocation().getId();
      String imageId = template.getImage().getProviderId();
      String flavorId = template.getHardware().getProviderId();

      logger.debug(">> creating new server zone(%s) name(%s) image(%s) flavor(%s) options(%s)", zoneId, name, imageId, flavorId, options);
      ServerCreated lightweightServer = novaApi.getServerApiForZone(zoneId).create(name, imageId, flavorId, options);
      Server server = novaApi.getServerApiForZone(zoneId).get(lightweightServer.getId());

      logger.trace("<< server(%s)", server.getId());

      ServerInZone serverInZone = new ServerInZone(server, zoneId);
      if (!privateKey.isPresent() && lightweightServer.getAdminPass().isPresent())
         credentialsBuilder.password(lightweightServer.getAdminPass().get());
      return new NodeAndInitialCredentials<ServerInZone>(serverInZone, serverInZone.slashEncode(), credentialsBuilder
               .build());
   }
View Full Code Here


         try {
            CreateServerOptions options = CreateServerOptions.Builder.novaNetworks(
                  // This network UUID must match an existing network.
                  ImmutableSet.of(Network.builder().networkUuid("bc4cfa2b-2b27-4671-8e8f-73009623def0").fixedIp("192.168.55.56").build())
                  );
            ServerCreated server = serverApi.create(hostName, imageIdForZone(zoneId), "1", options);
            serverId = server.getId();

            blockUntilServerInState(server.getId(), serverApi, Server.Status.ACTIVE);
            Server serverCheck = serverApi.get(serverId);
            assertEquals(serverCheck.getStatus(), Server.Status.ACTIVE);
         } finally {
            if (serverId != null) {
               serverApi.delete(serverId);
View Full Code Here

   }

   private Server createServer(String regionId, Server.Status serverStatus) {
      ServerApi serverApi = api.getServerApiForZone(regionId);
      CreateServerOptions options = new CreateServerOptions();
      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);

      blockUntilServerInState(server.getId(), serverApi, serverStatus);

      return serverApi.get(server.getId());
   }
View Full Code Here

   private Server createServer(String regionId, String availabilityZoneId, Server.Status serverStatus) {
      ServerApi serverApi = api.getServerApiForZone(regionId);
      CreateServerOptions options = new CreateServerOptions();
      options = options.availabilityZone(availabilityZoneId);
      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
      blockUntilServerInState(server.getId(), serverApi, serverStatus);
      return serverApi.get(server.getId());
   }
View Full Code Here

      String zoneId = template.getLocation().getId();
      String imageId = template.getImage().getProviderId();
      String flavorId = template.getHardware().getProviderId();

      logger.debug(">> creating new server zone(%s) name(%s) image(%s) flavor(%s) options(%s)", zoneId, name, imageId, flavorId, options);
      ServerCreated lightweightServer = novaApi.getServerApiForZone(zoneId).create(name, imageId, flavorId, options);
      Server server = novaApi.getServerApiForZone(zoneId).get(lightweightServer.getId());

      logger.trace("<< server(%s)", server.getId());

      ServerInZone serverInZone = new ServerInZone(server, zoneId);
      if (!privateKey.isPresent() && lightweightServer.getAdminPass().isPresent())
         credentialsBuilder.password(lightweightServer.getAdminPass().get());
      return new NodeAndInitialCredentials<ServerInZone>(serverInZone, serverInZone.slashEncode(), credentialsBuilder
               .build());
   }
View Full Code Here

      serverOptions.userData(this.userData.get().getBytes());
    }

    // create server
    ServerApi serverApi = api.getServerApiForZone(getAccount().getRegion());
    ServerCreated serverCreated = serverApi.create(this.serverName,
        getImageId(), getFlavorId(), serverOptions);
    return serverApi.get(serverCreated.getId());
  }
View Full Code Here

      return props;
   }
  
   protected Server createServerInZone(String zoneId) {
      ServerApi serverApi = api.getServerApiForZone(zoneId);
      ServerCreated server = serverApi.create(hostName, imageIdForZone(zoneId), flavorRefForZone(zoneId));
      blockUntilServerInState(server.getId(), serverApi, Status.ACTIVE);
      return serverApi.get(server.getId());
   }
View Full Code Here

    }

    private Server createServer(String regionId, Server.Status serverStatus) {
        ServerApi serverApi = api.getServerApiForZone(regionId);
        CreateServerOptions options = new CreateServerOptions();
        ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);

        blockUntilServerInState(server.getId(), serverApi, serverStatus);

        return serverApi.get(server.getId());
    }
View Full Code Here

    private Server createServer(String regionId, String availabilityZoneId, Server.Status serverStatus) {
        ServerApi serverApi = api.getServerApiForZone(regionId);
        CreateServerOptions options = new CreateServerOptions();
        options = options.availabilityZone(availabilityZoneId);
        ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
        blockUntilServerInState(server.getId(), serverApi, serverStatus);
        return serverApi.get(server.getId());
    }
View Full Code Here

      String zoneId = template.getLocation().getId();
      String imageId = template.getImage().getProviderId();
      String flavorId = template.getHardware().getProviderId();

      logger.debug(">> creating new server zone(%s) name(%s) image(%s) flavor(%s) options(%s)", zoneId, name, imageId, flavorId, options);
      ServerCreated lightweightServer = novaApi.getServerApiForZone(zoneId).create(name, imageId, flavorId, options);
      Server server = novaApi.getServerApiForZone(zoneId).get(lightweightServer.getId());

      logger.trace("<< server(%s)", server.getId());

      ServerInZone serverInZone = new ServerInZone(server, zoneId);
      if (!privateKey.isPresent() && lightweightServer.getAdminPass().isPresent())
         credentialsBuilder.password(lightweightServer.getAdminPass().get());
      return new NodeAndInitialCredentials<ServerInZone>(serverInZone, serverInZone.slashEncode(), credentialsBuilder
               .build());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.nova.v2_0.domain.ServerCreated

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.