예제 #1
0
    public static VMDevice getInstance(
        @Nonnull String deviceId,
        @Nonnull String name,
        int cpuCount,
        Storage<?> memory,
        String... interfaces) {
      VMDevice d = new VMDevice();

      d.deviceId = deviceId;
      d.capacity = 1;
      d.platform = Platform.UNKNOWN;
      d.architecture = Architecture.I64;
      d.name = name;
      d.cpuCount = cpuCount;
      d.memory = (Storage<Megabyte>) memory.convertTo(Storage.MEGABYTE);
      d.interfaces = interfaces;
      return d;
    }
예제 #2
0
 public int getSizeInGigabytes() {
   return (size == null ? 0 : size.getQuantity().intValue());
 }
예제 #3
0
 public void setSize(Storage<?> size) {
   this.size = (Storage<Gigabyte>) size.convertTo(Storage.GIGABYTE);
 }
 public void setRamSize(Storage<?> ramSize) {
   this.ramSize = (Storage<Megabyte>) ramSize.convertTo(Storage.MEGABYTE);
 }
 public void setRootVolumeSize(Storage<?> rootVolumeSize) {
   this.rootVolumeSize = (Storage<Gigabyte>) rootVolumeSize.convertTo(Storage.GIGABYTE);
 }