Examples of VirtualDatacenter


Examples of com.emc.vipr.client.core.VirtualDataCenter

    public Workflows workflows() {
        return new Workflows(this, client);
    }

    public VirtualDataCenter vdc() {
        return new VirtualDataCenter(client);
    }
View Full Code Here

Examples of com.emc.vipr.client.core.VirtualDataCenter

    public Workflows workflows() {
        return new Workflows(this, client);
    }

    public VirtualDataCenter vdc() {
        return new VirtualDataCenter(client);
    }
View Full Code Here

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

      // Load the template
      VirtualMachineTemplate virtualMachineTemplate = enterprise.getTemplateInRepository(datacenter,
            Integer.valueOf(template.getImage().getId()));

      // Get the zone where the template will be deployed
      VirtualDatacenter vdc = cloudService.getVirtualDatacenter(Integer.valueOf(template.getHardware().getLocation()
            .getId()));

      // Load the virtual appliance or create it if it does not exist
      VirtualAppliance vapp = vdc.findVirtualAppliance(VirtualAppliancePredicates.name(tag));
      if (vapp == null) {
         vapp = VirtualAppliance.builder(context, vdc).name(tag).build();
         vapp.save();
      }

      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);
      }
View Full Code Here

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

      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);

      Hardware hardware = function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));

      verify(vdcToLocation);

      assertEquals(hardware.getProviderId(), template.getId().toString());
      assertEquals(hardware.getId(), template.getId() + "/" + vdc.getId());
      assertEquals(hardware.getName(), template.getName());
      assertEquals(hardware.getUri(), URI.create("http://foo/bar"));

      assertEquals(hardware.getRam(), template.getRamRequired().intValue());
      assertEquals(hardware.getProcessors().size(), 1);
View Full Code Here

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

      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);

      Hardware hardware = function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));

      verify(vdcToLocation);
View Full Code Here

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

      Function<VirtualDatacenter, Location> vdcToLocation = mockVirtualDatacenterToLocation();
      VirtualMachineTemplateInVirtualDatacenterToHardware function = new VirtualMachineTemplateInVirtualDatacenterToHardware(
            vdcToLocation);

      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, new VirtualMachineTemplateDto());
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, new VirtualDatacenterDto());

      function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));
   }
View Full Code Here

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

   }

   @Override
   public Hardware apply(final VirtualMachineTemplateInVirtualDatacenter templateInVirtualDatacenter) {
      VirtualMachineTemplate template = templateInVirtualDatacenter.getTemplate();
      VirtualDatacenter virtualDatacenter = templateInVirtualDatacenter.getZone();

      HardwareBuilder builder = new HardwareBuilder();
      builder.providerId(template.getId().toString());
      builder.id(template.getId().toString() + "/" + virtualDatacenter.getId());
      builder.uri(template.getURI());

      builder.name(template.getName());
      builder.processor(new Processor(template.getCpuRequired(), DEFAULT_CORE_SPEED));
      builder.ram(template.getRamRequired());

      // Location information
      builder.location(virtualDatacenterToLocation.apply(virtualDatacenter));
      builder.hypervisor(virtualDatacenter.getHypervisorType().name());
      builder.supportsImage(ImagePredicates.idEquals(template.getId().toString()));

      VolumeBuilder volumeBuilder = new VolumeBuilder();
      volumeBuilder.bootDevice(true);
      volumeBuilder.size(toGb(template.getHdRequired()));
View Full Code Here

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

   public Map<?, ListenableFuture<Void>> execute(final String group, int count, Template template,
         Set<NodeMetadata> goodNodes, Map<NodeMetadata, Exception> badNodes,
         Multimap<NodeMetadata, CustomizationResponse> customizationResponses) {
      // Get the zone where the template will be deployed
      Integer locationId = Integer.valueOf(template.getHardware().getLocation().getId());
      VirtualDatacenter vdc = cloudService.getVirtualDatacenter(locationId);

      // Check if it already exists a group with the given name
      Iterable<VirtualAppliance> existingGroups = vdc.listVirtualAppliances();
      Optional<VirtualAppliance> vapp = tryFind(existingGroups, new Predicate<VirtualAppliance>() {
         @Override
         public boolean apply(VirtualAppliance input) {
            return input.getName().equals(group);
         }
View Full Code Here

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

   public void testVirtualDatacenterToLocation() {
      Function<Datacenter, Location> dcToLocation = mockDatacenterToLocation();
      Supplier<Map<Integer, Datacenter>> regionMap = mockRegionMap();
      VirtualDatacenterToLocation function = new VirtualDatacenterToLocation(dcToLocation, regionMap);

      VirtualDatacenter vdc = mockVirtualDatacenter();

      Location location = function.apply(vdc);

      verify(regionMap);
      verify(dcToLocation);
View Full Code Here

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

      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
      Datacenter datacenter = EasyMock.createMock(Datacenter.class);
      Enterprise enterprise = EasyMock.createMock(Enterprise.class);
      PrivateNetwork network = EasyMock.createMock(PrivateNetwork.class);

      VirtualDatacenter vdc = VirtualDatacenter.builder(context, datacenter, enterprise) //
            .network(network) //
            .name("mock").build();
      vdc.unwrap().setId(5);

      return vdc;
   }
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.