Esempio n. 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;
    }
 public int getSizeInGigabytes() {
   return (size == null ? 0 : size.getQuantity().intValue());
 }
 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);
 }