Пример #1
0
 public void deployVM(
     final VirtualMachine vm, final ResourceAllocation ra, final Repository vaSource)
     throws VMManagementException, NetworkNode.NetworkException {
   if (checkAllocationsPresence(ra)) {
     final VirtualAppliance va = vm.getVa();
     final StorageObject foundLocal = localDisk.lookup(va.id);
     final StorageObject foundRemote = vaSource == null ? null : vaSource.lookup(va.id);
     if (foundLocal != null || foundRemote != null) {
       vm.switchOn(ra, vaSource);
     } else {
       throw new VMManagementException("No VA available!");
     }
   } else {
     throw new VMManagementException("Tried to deploy VM with an expired resource allocation");
   }
 }
Пример #2
0
 @Override
 public String toString() {
   return "Machine(S:"
       + currentState
       + " C:"
       + internalReallyFreeCaps.getRequiredCPUs()
       + " M:"
       + internalReallyFreeCaps.getRequiredMemory()
       + " "
       + localDisk.toString()
       + " "
       + super.toString()
       + ")";
 }