private static VM fromCloudmlToModaMP(VMInstance toTranslate) { VM toReturn = new VM(); //KB entity field String id = toTranslate.getName(); toReturn.setId(id); toReturn.setType(String.valueOf(toTranslate.getType().getName())); toReturn.setCloudProvider(toTranslate.getType().getProvider().getName()); toReturn.setLocation(toTranslate.getType().getLocation()); toReturn.setNumberOfCPUs(toTranslate.getCore()); return toReturn; } //Translate an internal component from cloudML to Monitoring Platform QoS-model
createHostedService(a.getName(),vm.getLocation(),vm.getSshKey()); } catch (SAXException e) { e.printStackTrace();
if (!vm.getLocation().equals("")) templateBuilder.locationId(region+vm.getLocation()); if (!vm.getOs().equals("")) templateBuilder.imageDescriptionMatches(vm.getOs());
@Override public String toString() { return "VMInstance: " + getName() + " Type:" + getType().getName() + "{\n" + "minRam:" + (getType()).getMinRam() + "\n" + "minCore" + (getType()).getMinCores() + "\n" + "minDisk" + (getType()).getMinStorage() + "\n" + "OS" + (getType()).getOs() + "\n" + "location" + (getType()).getLocation() + "\n" + "publicAdress" + getPublicAddress() + "\n" + "groupName" + (getType()).getGroupName(); }
private static Model getModelUpdates(ComponentInstanceGroup instances, ProviderGroup providers) { Model model = new Model(); //go top down to remove the synched ones //prepare the VMs list VMInstanceGroup VMs = instances.onlyVMs(); for (VMInstance i : VMs) { String location = i.getType().getLocation(); if(!location.isEmpty()) { model.add(fromCloudmlToModaMP(location)); } model.add(fromCloudmlToModaMP(i)); instances.remove(i); } //prepare the InternalComponents list InternalComponentInstanceGroup internalComponents = instances.onlyInternals(); for (InternalComponentInstance i : internalComponents) { model.add(fromCloudmlToModaMP(i)); instances.remove(i); } //prepare for providers list if(providers!=null){ for (Provider i : providers) { model.add(fromCloudmlToModaMP(i)); instances.remove(i); } } return model; }
templateBuilder.hardwareId(vm.getProviderSpecificTypeName()); if (!vm.getLocation().equals("")) templateBuilder.locationId(vm.getLocation()); if (!vm.getOs().equals("")) templateBuilder.imageDescriptionMatches(vm.getOs());
v.setRegion(existingVM.getRegion()); v.setImageId(existingVM.getImageId()); v.setLocation(existingVM.getLocation()); v.setMinRam(existingVM.getMinRam()); v.setMinCores(existingVM.getMinCores());
v.setRegion(existingVM.getRegion()); v.setImageId("tempID"); v.setLocation(existingVM.getLocation()); v.setMinRam(existingVM.getMinRam()); v.setMinCores(existingVM.getMinCores());
v.setRegion(existingVM.getRegion()); v.setImageId("tempID"); v.setLocation(existingVM.getLocation()); v.setMinRam(existingVM.getMinRam()); v.setMinCores(existingVM.getMinCores());
kNode.setIs64os(vm.getIs64os()); if(ec.getLocation() != null) kNode.setLocation(vm.getLocation()); kNode.setMinCores(vm.getMinCores()); kNode.setMinStorage(vm.getMinStorage());