Package org.jclouds.virtualbox.domain

Examples of org.jclouds.virtualbox.domain.StorageController


   public void setupContext() {
      super.setupContext();
      instanceName = VIRTUALBOX_IMAGE_PREFIX
               + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, getClass().getSimpleName());

      StorageController ideController = StorageController
               .builder()
               .name("IDE Controller")
               .bus(StorageBus.IDE)
               .attachISO(0, 0, operatingSystemIso)
               .attachHardDisk(
View Full Code Here


   @Test
   public void testCreateNewMachine() throws Exception {
      vmName = "jclouds-test-create-1-node";
      String vmId = UUID.randomUUID().toString();

      StorageController ideController = StorageController.builder().name(ideControllerName).bus(StorageBus.IDE)
               .attachISO(0, 0, operatingSystemIso)
               .attachHardDisk(HardDisk.builder().diskpath(adminDisk(vmName)).controllerPort(0).deviceSlot(1).build())
               .attachISO(1, 1, guestAdditionsIso).build();

      VmSpec vmSpec = VmSpec.builder().id(vmId).name(vmName).memoryMB(512).controller(ideController).cleanUpMode(mode)
View Full Code Here

   @Test
   public void testCreateNewMachineWithBadOsType() throws Exception {
      vmName = "jclouds-test-create-2-node";
      String vmId = UUID.randomUUID().toString();

      StorageController ideController = StorageController.builder().name(ideControllerName).bus(StorageBus.IDE)
               .attachISO(0, 0, operatingSystemIso)
               .attachHardDisk(HardDisk.builder().diskpath(adminDisk(vmName)).controllerPort(0).deviceSlot(1).build())
               .attachISO(1, 1, guestAdditionsIso).build();

      VmSpec vmSpec = VmSpec.builder().id(vmId).name(vmName).memoryMB(512).controller(ideController).cleanUpMode(mode)
View Full Code Here

      MachineUtils machineUtils = createMock(MachineUtils.class);
      VirtualBoxManager manager = createMock(VirtualBoxManager.class);
      IVirtualBox vBox = createMock(IVirtualBox.class);
      String vmName = "jclouds-image-my-ubuntu-image";
      StorageController ideController = StorageController.builder().name("IDE Controller").bus(StorageBus.IDE).build();
      VmSpec vmSpec = VmSpec.builder().id(vmName).name(vmName).osTypeId("").memoryMB(1024).controller(ideController)
            .cleanUpMode(CleanupMode.Full).build();
      MasterSpec machineSpec = MasterSpec.builder()
            .iso(IsoSpec.builder().sourcePath("some.iso").installationScript("").build()).vm(vmSpec)
            .network(NetworkSpec.builder().build()).build();
View Full Code Here

      IMachine registeredMachine = createMock(IMachine.class);
      IProgress progress = createNiceMock(IProgress.class);
      List<IMedium> media = Lists.newArrayList();
      List<IMedium> mediums = Collections.unmodifiableList(media);

      StorageController ideController = StorageController.builder().name(ideControllerName).bus(StorageBus.IDE)
            .attachISO(0, 0, "/tmp/ubuntu-11.04-server-i386.iso")
            .attachHardDisk(HardDisk.builder().diskpath("/tmp/testadmin.vdi").controllerPort(0).deviceSlot(1).build())
            .attachISO(1, 1, "/tmp/VBoxGuestAdditions_4.1.2.iso").build();
      VmSpec vmSpecification = VmSpec.builder().id(vmId).name(vmName).memoryMB(512).osTypeId(osTypeId)
            .controller(ideController).forceOverwrite(true).cleanUpMode(CleanupMode.Full).build();
View Full Code Here

   @Test
   public void testFine() throws Exception {
      IMachine vm = createMock(IMachine.class);

      String controllerName = "IDE Controller";
      StorageController storageController = StorageController.builder().bus(StorageBus.IDE).name(controllerName).build();

      expect(vm.addStorageController(controllerName, StorageBus.IDE)).andReturn(
              createNiceMock(IStorageController.class));
      vm.saveSettings();
View Full Code Here

   @Test
   public void testAcceptableException() throws Exception {
      IMachine vm = createMock(IMachine.class);

      String controllerName = "IDE Controller";
      StorageController storageController = StorageController.builder().bus(StorageBus.IDE).name(controllerName).build();

      expect(vm.addStorageController(controllerName, StorageBus.IDE)).andThrow(
              new VBoxException(createNiceMock(Throwable.class),
                      "VirtualBox error: Storage controller named 'IDE Controller' already exists (0x80BB000C)"));
View Full Code Here

   @Test(expectedExceptions = VBoxException.class)
   public void testUnacceptableException() throws Exception {
      IMachine vm = createMock(IMachine.class);

      String controllerName = "IDE Controller";
      StorageController storageController = StorageController.builder().bus(StorageBus.IDE).name(controllerName).build();

      expect(vm.addStorageController(controllerName, StorageBus.IDE)).andThrow(
              new VBoxException(createNiceMock(Throwable.class), "VirtualBox error: General Error"));

      replay(vm);
View Full Code Here

   public void setupContext() {
      super.setupContext();
      instanceName = VIRTUALBOX_IMAGE_PREFIX
               + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, getClass().getSimpleName());

      StorageController ideController = StorageController.builder()
                                                         .name("IDE Controller")
                                                         .bus(StorageBus.IDE)
                                                         .attachISO(0, 0, operatingSystemIso)
                                                         .attachHardDisk(HardDisk.builder()
                                                                                 .diskpath(adminDisk(instanceName))
View Full Code Here

      String localIsoUrl = checkNotNull(getFilePathOrDownload(currentImage.iso, currentImage.iso_md5), "distro iso");
      String adminDisk = workingDir + File.separator + vmName + ".vdi";
      HardDisk hardDisk = HardDisk.builder().diskpath(adminDisk).autoDelete(true).controllerPort(0).deviceSlot(1)
            .build();

      StorageController ideController = StorageController.builder().name("IDE Controller").bus(StorageBus.IDE)
            .attachISO(0, 0, localIsoUrl).attachHardDisk(hardDisk).build();

      VmSpec vmSpecification = VmSpec.builder().id(currentImage.id).name(vmName).memoryMB(512)
            .osTypeId(getOsTypeId(currentImage.os_family, currentImage.os_64bit)).controller(ideController)
            .forceOverwrite(true).guestUser(currentImage.username).guestPassword(currentImage.credential)
View Full Code Here

TOP

Related Classes of org.jclouds.virtualbox.domain.StorageController

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.