Examples of BlockDeviceMapping


Examples of com.amazonaws.services.ec2.model.BlockDeviceMapping

        if ("i386".equals(architecture))
        {
            registerImageRequest = registerImageRequest.
                    withBlockDeviceMappings(
                            new BlockDeviceMapping().
                                    withDeviceName(rootDeviceName.get()).
                                    withEbs(new EbsBlockDevice().
                                            withSnapshotId(testSnapshot.get().getSnapshotId())),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sda2").
                                    withVirtualName("ephemeral0"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sda3").
                                    withVirtualName("ephemeral1"));
        }
        else
        {
            registerImageRequest = registerImageRequest.
                    withBlockDeviceMappings(
                            new BlockDeviceMapping().
                                    withDeviceName(rootDeviceName.get()).
                                    withEbs(new EbsBlockDevice().
                                            withSnapshotId(testSnapshot.get().getSnapshotId())),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sdb").
                                    withVirtualName("ephemeral0"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sdc").
                                    withVirtualName("ephemeral1"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sdd").
                                    withVirtualName("ephemeral2"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sde").
                                    withVirtualName("ephemeral3"));
        }

        RegisterImageResult registerImageResult = ec2Client.registerImage(registerImageRequest);
View Full Code Here

Examples of com.amazonaws.services.ec2.model.BlockDeviceMapping

        // Goal: Setup block device mappings to ensure that we will not delete
        // the root partition on termination.

        // Create the block device mapping to describe the root partition.
        BlockDeviceMapping blockDeviceMapping = new BlockDeviceMapping();
        blockDeviceMapping.setDeviceName("/dev/sda1");

        // Set the delete on termination flag to false.
        EbsBlockDevice ebs = new EbsBlockDevice();
        ebs.setDeleteOnTermination(Boolean.FALSE);
        blockDeviceMapping.setEbs(ebs);

        // Add the block device mapping to the block list.
        ArrayList<BlockDeviceMapping> blockList = new ArrayList<BlockDeviceMapping>();
        blockList.add(blockDeviceMapping);
View Full Code Here

Examples of com.amazonaws.services.ec2.model.BlockDeviceMapping


        // If we should delete the EBS boot partition on termination.
        if (!deleteOnTermination) {
            // Create the block device mapping to describe the root partition.
            BlockDeviceMapping blockDeviceMapping = new BlockDeviceMapping();
            blockDeviceMapping.setDeviceName("/dev/sda1");

            // Set the delete on termination flag to false.
            EbsBlockDevice ebs = new EbsBlockDevice();
            ebs.setDeleteOnTermination(Boolean.FALSE);
            blockDeviceMapping.setEbs(ebs);

            // Add the block device mapping to the block list.
            ArrayList<BlockDeviceMapping> blockList = new ArrayList<BlockDeviceMapping>();
            blockList.add(blockDeviceMapping);
View Full Code Here

Examples of com.amazonaws.services.ec2.model.BlockDeviceMapping

        List<BlockDevice> blockDevices = pool.getHardware().getBlockDevices();
        List<BlockDeviceMapping> blockDeviceMappings = Lists.newArrayList();
        if (blockDevices != null && blockDevices.size() > 0) {
            for (BlockDevice device : blockDevices) {
                blockDeviceMappings.add(new BlockDeviceMapping()
                    .withDeviceName(device.getName())
                    .withEbs(new EbsBlockDevice()
                        .withVolumeSize(device.getSize())
                        .withDeleteOnTermination(true)
                    ));
View Full Code Here

Examples of com.amazonaws.services.ec2.model.BlockDeviceMapping

        if ("i386".equals(architecture))
        {
            registerImageRequest = registerImageRequest.
                    withBlockDeviceMappings(
                            new BlockDeviceMapping().
                                    withDeviceName(rootDeviceName.get()).
                                    withEbs(new EbsBlockDevice().
                                            withSnapshotId(testSnapshot.get().getSnapshotId())),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sda2").
                                    withVirtualName("ephemeral0"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sda3").
                                    withVirtualName("ephemeral1"));
        }
        else
        {
            registerImageRequest = registerImageRequest.
                    withBlockDeviceMappings(
                            new BlockDeviceMapping().
                                    withDeviceName(rootDeviceName.get()).
                                    withEbs(new EbsBlockDevice().
                                            withSnapshotId(testSnapshot.get().getSnapshotId())),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sdb").
                                    withVirtualName("ephemeral0"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sdc").
                                    withVirtualName("ephemeral1"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sdd").
                                    withVirtualName("ephemeral2"),
                            new BlockDeviceMapping().
                                    withDeviceName("/dev/sde").
                                    withVirtualName("ephemeral3"));
        }

        RegisterImageResult registerImageResult = ec2Client.registerImage(registerImageRequest);
View Full Code Here

Examples of com.amazonaws.services.ec2.model.BlockDeviceMapping

        List<BlockDevice> blockDevices = pool.getHardware().getBlockDevices();
        List<BlockDeviceMapping> blockDeviceMappings = Lists.newArrayList();
        if (blockDevices != null && blockDevices.size() > 0) {
            for (BlockDevice device : blockDevices) {
                blockDeviceMappings.add(new BlockDeviceMapping()
                        .withDeviceName(device.getName())
                        .withEbs(new EbsBlockDevice()
                            .withVolumeSize(device.getSize())
                            .withDeleteOnTermination(true)
                         ));
View Full Code Here

Examples of org.jclouds.ec2.domain.BlockDeviceMapping

      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.VirtualName"), ImmutableList.of());
   }

   @Test
   public void testWithBlockDeviceMapping() {
      BlockDeviceMapping mapping = new BlockDeviceMapping.MapNewVolumeToDevice("/dev/sda1", 120, true);
      RunInstancesOptions options = new RunInstancesOptions().withBlockDeviceMappings(ImmutableSet
               .<BlockDeviceMapping> of(mapping));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.DeviceName"),
               ImmutableList.of("/dev/sda1"));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.Ebs.VolumeSize"),
View Full Code Here

Examples of org.jclouds.ec2.domain.BlockDeviceMapping

      assertEquals(options.buildFormParameters().get("BlockDeviceMapping"), ImmutableList.of());
   }

   @Test
   public void testWithBlockDeviceMappingStatic() {
      BlockDeviceMapping mapping = new BlockDeviceMapping.MapNewVolumeToDevice("/dev/sda1", 120, true);
      RunInstancesOptions options = withBlockDeviceMappings(ImmutableSet
               .<BlockDeviceMapping> of(mapping));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.DeviceName"),
               ImmutableList.of("/dev/sda1"));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.Ebs.VolumeSize"),
View Full Code Here

Examples of org.jclouds.ec2.domain.BlockDeviceMapping

      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.VirtualName"), ImmutableList.of());
   }

   @Test
   public void testWithBlockDeviceMapping() {
      BlockDeviceMapping mapping = new BlockDeviceMapping.MapNewVolumeToDevice("/dev/sda1", 120, true);
      AWSRunInstancesOptions options = new AWSRunInstancesOptions().withBlockDeviceMappings(ImmutableSet
               .<BlockDeviceMapping> of(mapping));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.DeviceName"),
               ImmutableList.of("/dev/sda1"));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.Ebs.VolumeSize"),
View Full Code Here

Examples of org.jclouds.ec2.domain.BlockDeviceMapping

      assertEquals(options.buildFormParameters().get("BlockDeviceMapping"), ImmutableList.of());
   }

   @Test
   public void testWithBlockDeviceMappingStatic() {
      BlockDeviceMapping mapping = new BlockDeviceMapping.MapNewVolumeToDevice("/dev/sda1", 120, true);
      AWSRunInstancesOptions options = withBlockDeviceMappings(ImmutableSet.<BlockDeviceMapping> of(mapping));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.DeviceName"),
               ImmutableList.of("/dev/sda1"));
      assertEquals(options.buildFormParameters().get("BlockDeviceMapping.1.Ebs.VolumeSize"),
               ImmutableList.of("120"));
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.