Package org.jclouds.abiquo.domain.cloud

Examples of org.jclouds.abiquo.domain.cloud.VirtualMachine


      }

      Integer overrideCores = options.getOverrideCores();
      Integer overrideRam = options.getOverrideRam();

      VirtualMachine vm = VirtualMachine.builder(context, vapp, virtualMachineTemplate) //
            .nameLabel(name) //
            .cpu(overrideCores != null ? overrideCores : totalCores(template.getHardware())) //
            .ram(overrideRam != null ? overrideRam : template.getHardware().getRam()) //
            .password(options.getVncPassword()) // Can be null
            .build();

      vm.save();

      // Once the virtual machine is created, override the default network
      // settings if needed
      // If no public ip is available in the virtual datacenter, the virtual
      // machine will be assigned by default an ip address in the default
      // private VLAN for the virtual datacenter
      PublicIp publicIp = vdc.findPurchasedPublicIp(IpPredicates.<PublicIp> notUsed());
      if (publicIp != null) {
         List<PublicIp> ips = Lists.newArrayList();
         ips.add(publicIp);
         vm.setNics(ips);
      }

      // This is an async operation, but jclouds already waits until the node is
      // RUNNING, so there is no need to block here
      vm.deploy();

      return new NodeAndInitialCredentials<VirtualMachine>(vm, vm.getId().toString(), null);
   }
View Full Code Here


      return cloudService.findVirtualMachine(vmId(id));
   }

   @Override
   public void destroyNode(final String id) {
      VirtualMachine vm = getNode(id);
      vm.delete();
   }
View Full Code Here

   }

   @Override
   public void rebootNode(final String id) {
      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
      VirtualMachine vm = getNode(id);
      vm.reboot();
      monitor.awaitState(VirtualMachineState.ON, vm);
   }
View Full Code Here

   }

   @Override
   public void resumeNode(final String id) {
      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
      VirtualMachine vm = getNode(id);
      vm.changeState(VirtualMachineState.ON);
      monitor.awaitState(VirtualMachineState.ON, vm);
   }
View Full Code Here

   }

   @Override
   public void suspendNode(final String id) {
      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
      VirtualMachine vm = getNode(id);
      vm.changeState(VirtualMachineState.PAUSED);
      monitor.awaitState(VirtualMachineState.PAUSED, vm);
   }
View Full Code Here

            Integer.valueOf(template.getImage().getId()));

      Integer overrideCores = options.getOverrideCores();
      Integer overrideRam = options.getOverrideRam();

      VirtualMachine vm = VirtualMachine.builder(context, template.getVirtualAppliance(), virtualMachineTemplate) //
            .nameLabel(name) //
            .cpu(overrideCores != null ? overrideCores : totalCores(template.getHardware())) //
            .ram(overrideRam != null ? overrideRam : template.getHardware().getRam()) //
            .password(options.getVncPassword()) // Can be null
            .build();

      vm.save();

      configureNetworking(vm, template, datacenter, options);

      // This is an async operation, but jclouds already waits until the node is
      // RUNNING, so there is no need to block here
      vm.deploy();

      return new NodeAndInitialCredentials<VirtualMachine>(vm, vm.getId().toString(), null);
   }
View Full Code Here

   }

   @Override
   public void destroyNode(final String id) {
      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
      VirtualMachine vm = getNode(id);
      vm.undeploy(true);
      monitor.awaitCompletionUndeploy(timeouts.nodeTerminated, TimeUnit.MILLISECONDS, vm);
      vm.delete();
   }
View Full Code Here

   }

   @Override
   public void rebootNode(final String id) {
      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
      VirtualMachine vm = getNode(id);
      vm.reboot();
      monitor.awaitState(timeouts.nodeRunning, TimeUnit.MILLISECONDS, VirtualMachineState.ON, vm);
   }
View Full Code Here

   }

   @Override
   public void resumeNode(final String id) {
      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
      VirtualMachine vm = getNode(id);
      vm.changeState(VirtualMachineState.ON);
      monitor.awaitState(timeouts.nodeRunning, TimeUnit.MILLISECONDS, VirtualMachineState.ON, vm);
   }
View Full Code Here

   }

   @Override
   public void suspendNode(final String id) {
      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
      VirtualMachine vm = getNode(id);
      vm.changeState(VirtualMachineState.PAUSED);
      monitor.awaitState(timeouts.nodeSuspended, TimeUnit.MILLISECONDS, VirtualMachineState.PAUSED, vm);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.abiquo.domain.cloud.VirtualMachine

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.