Package org.jclouds.openstack.nova.v2_0.options

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions


      BlockDeviceMapping blockDeviceMapping = BlockDeviceMapping.builder()
            .uuid("f0c907a5-a26b-48ba-b803-83f6b7450ba5").sourceType("image").destinationType("volume")
            .volumeSize(100).build();

      assertEquals(apiWithNewServer.getServerApi("az-1.region-a.geo-1").create("test-e92", "",
               "12345", new CreateServerOptions().blockDeviceMappings(ImmutableSet.of(blockDeviceMapping))).toString(),
              new ParseCreatedServerTest().expected().toString());
   }
View Full Code Here


      BlockDeviceMapping blockDeviceMapping = BlockDeviceMapping.builder()
            .uuid("f0c907a5-a26b-48ba-b803-83f6b7450ba5").sourceType("image")
            .destinationType("volume").volumeSize(100).build();

      try {
         apiWithNewServer.getServerApi("az-1.region-a.geo-1").create("test-e92", "", "12345", new CreateServerOptions().blockDeviceMappings(ImmutableSet.of(blockDeviceMapping)));
         fail("Expected an exception.");
      } catch (Exception e) {
         // expected
      }
   }
View Full Code Here

      NovaApi apiWithNewServer = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            createServer, createServerResponse);

      assertEquals(apiWithNewServer.getServerApi("az-1.region-a.geo-1").create("test-e92", "1241",
               "100", new CreateServerOptions().diskConfig(Server.DISK_CONFIG_AUTO)).toString(),
              new ParseCreatedServerTest().expectedWithDiskConfig(Server.DISK_CONFIG_AUTO).toString());
   }
View Full Code Here

      NovaApi apiWithNewServer = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            createServer, createServerResponse);

      assertEquals(apiWithNewServer.getServerApi("az-1.region-a.geo-1").create("test-e92", "1241",
               "100", new CreateServerOptions().diskConfig(Server.DISK_CONFIG_MANUAL)).toString(),
              new ParseCreatedServerTest().expectedWithDiskConfig(Server.DISK_CONFIG_MANUAL).toString());
   }
View Full Code Here

   public void testCreateWithNetworkOptions() {
      String serverId = null;
      for (String regionId : regions) {
         ServerApi serverApi = api.getServerApi(regionId);
         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, imageIdForRegion(regionId), "1", options);
            serverId = server.getId();
View Full Code Here

            try {
               BlockDeviceMapping blockDeviceMappings = BlockDeviceMapping.builder()
                     .uuid(imageRef).sourceType("image").destinationType("volume")
                     .volumeSize(100).bootIndex(0).build();

               CreateServerOptions options = CreateServerOptions.Builder
                     .blockDeviceMappings(ImmutableSet.of(blockDeviceMappings));

               ServerCreated server = serverApi.create(hostName, "", flavorRef, options);
               serverId = server.getId();
View Full Code Here

   }

   private Server createServer(String regionId, String availabilityZoneId) {
      ServerApi serverApi = api.getServerApi(regionId);

      CreateServerOptions options = new CreateServerOptions();
      if (availabilityZoneId != null) {
          options = options.availabilityZone(availabilityZoneId);
      }

      ServerCreated server = serverApi.create(hostName, imageIdForRegion(regionId), flavorRefForRegion(regionId), options);

      awaitActive(serverApi).apply(server.getId());
View Full Code Here

      setIfTestSystemPropertyPresent(props, NovaProperties.AUTO_ALLOCATE_FLOATING_IPS);
      return props;
   }

   protected Server createServerInRegion(String regionId) {
      return createServerInRegion(regionId, new CreateServerOptions());
   }
View Full Code Here

               listResponse);

      assertEquals(apiWhenSecurityGroupsExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1"));

      assertEquals(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
               .list().toString(), new ParseSecurityGroupListTest().expected().toString());
   }
View Full Code Here

            responseWithKeystoneAccess, listServers, listServersResponse);

      assertEquals(apiWhenServersExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1"));

      assertEquals(apiWhenServersExist.getServerApiForZone("az-1.region-a.geo-1").list().concat().toString(),
            new ParseServerListTest().expected().toString());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

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.