Examples of DeviceId


Examples of com.vmware.aurora.vc.DeviceId

    * "ClonedVM3" should have the same disk layout as "ClonedVM1".
    *
    */
   @Test
   public void testTransaction() throws Exception {
      DeviceId slot1 = new DeviceId("VirtualLsiLogicController", 0, 1);
      DeviceId slot2 = new DeviceId("VirtualLsiLogicController", 0, 2);
      DeviceId slot3 = new DeviceId("VirtualLsiLogicController", 0, 3);

      DeviceId[] removeDisks = { slot1 };

      DiskCreateSpec[] addDisks =
            { new DiskCreateSpec(slot2, ds, "data",
View Full Code Here

Examples of com.vmware.aurora.vc.DeviceId

         System.out.println(vm);
         vm.dumpDevices();
         System.out.println(VcFileManager.getDsPath(vm, ""));

         /* test device identification */
         DeviceId diskId = new DeviceId("VirtualLsiLogicController:0:0");
         VirtualDevice scsi1 = vm.getVirtualController(diskId);
         VirtualDevice disk1 = vm.getVirtualDevice(diskId);
         DeviceId genDiskId = new DeviceId(scsi1, disk1);
         if (!diskId.equals(genDiskId)) {
            throw new Exception("unmatched disk id " + diskId + " " + genDiskId);
         }

         VirtualDevice.BackingInfo disk1Bk = vm.getVirtualDevice(diskId).getBacking();
         System.out.println("Remove a disk");
         vm.detachVirtualDisk(diskId, false);
         vm.dumpDevices();

         System.out.println("Attach a new disk");
         vm.attachVirtualDisk(new DeviceId("VirtualLsiLogicController", 0, 2),
               VmConfigUtil.createVmdkBackingInfo(vm, "data.vmdk", DiskMode.persistent),
               true, DiskSize.sizeFromGB(8));
         vm.dumpDevices();

         /* test setting extra config */
         Map<String, String> map = new HashMap<String, String>();
         map.put("vmid", "junit-test-vm");
         vm.setDbvmConfig(map);
         map = vm.getDbvmConfig();
         System.out.println(map);

         if(VmConfigUtil.isDetachDiskEnabled()) {
            System.out.println("Attach a disk");
            vm.attachVirtualDisk(diskId, disk1Bk, false, null);
            vm.dumpDevices();
         }

         // create a snapshot so that we can do linked clone
         vm.createSnapshot("snap1", "snap1");
         // test finding snapshots
         vm.createSnapshot("snap2", "snap2");
         VcSnapshot snap1 = vm.getSnapshotByName("snap1");
         AuAssert.check(snap1 != null);
         VcSnapshot snap2 = vm.getSnapshotByName("snap2");
         AuAssert.check(snap2 != null);
         System.out.println("snap1: " + snap1 + " snap2: " + snap2);

         System.out.println("Mark the VM as template");
         vm.markAsTemplate();
         System.out.println(dc.getVirtualMachine(vmName).getInfo());

         /*
          * Test file operations using data.vmdk
          */
         System.out.println("data.vmdk uuid=" +
               VcFileManager.queryVirtualDiskUuid(
                     VcFileManager.getDsPath(vm, "data.vmdk"), dc));
         testFileOp(VcFileManager.getDsPath(vm, "data.vmdk"));

         /*
          * Clone the template VM.
          */
         System.out.println("clone the template VM to a VM");
         ConfigSpec spec = new ConfigSpecImpl();
         vm1 = vm.cloneTemplate(vm1Name, myRP, d1, spec);
         System.out.println(vm1.getInfo());
         vm1.dumpDevices();
         map = vm1.getDbvmConfig();
         System.out.println(map);

         System.out.println("Attach a new disk");
         DeviceId archiveDiskId = new DeviceId("VirtualLsiLogicController:0:3");
         DeviceId tempDiskId = new DeviceId("VirtualLsiLogicController:0:4");
         vm1.attachVirtualDisk(archiveDiskId,
               VmConfigUtil.createVmdkBackingInfo(vm1, d1, "archive.vmdk", DiskMode.persistent, true),
               true, DiskSize.sizeFromGB(2));
         // test copying and attaching a new disk
         System.out.println("Copy and attach a new disk");
View Full Code Here

Examples of com.vmware.aurora.vc.DeviceId

            diskMap.put(disk.externalAddress, Disk.Operation.PROMOTE);
         } else {
            // Make sure we don't already have an existing disk of the same address
            AuAssert.check(diskMap.get(disk.externalAddress) == null);
            DiskCreateSpec createSpec =
                  new DiskCreateSpec(new DeviceId(disk.externalAddress),
                        diskDs, disk.name, disk.mode,
                        DiskSize.sizeFromMB(disk.initialSizeMB),
                        disk.allocationType);
            result.add(createSpec);
         }
View Full Code Here

Examples of com.vmware.aurora.vc.DeviceId

         VirtualDisk.FlatVer2BackingInfo backing =
               new VirtualDiskImpl.FlatVer2BackingInfoImpl();
         backing.setFileName(disk.vmdkPath);
         backing.setDiskMode(disk.mode.toString());

         deviceChange.add(vcVm.attachVirtualDiskSpec(new DeviceId(
               disk.externalAddress), backing, false, DiskSize
               .sizeFromMB(disk.initialSizeMB)));
      }

      if (!deviceChange.isEmpty()) {
         vcVm.reconfigure(VmConfigUtil.createConfigSpec(deviceChange));
      }

      if (linkedClone) {
         // Promote necessary disks
         ArrayList<DeviceId> disksToPromote = new ArrayList<DeviceId>();
         for (Entry<String, Disk.Operation> entry : diskMap.entrySet()) {
            if (entry.getValue() == Disk.Operation.PROMOTE) {
               disksToPromote.add(new DeviceId(entry.getKey()));
            }
         }
         if (disksToPromote.size() >= 1) {
            vcVm.promoteDisks(disksToPromote.toArray(new DeviceId[0]));
         }
View Full Code Here

Examples of com.vmware.aurora.vc.DeviceId

   }

   public static VirtualDisk findVirtualDisk(String vmMobId, String externalAddr) {
      VcVirtualMachine vm = VcCache.getIgnoreMissing(vmMobId);

      DeviceId diskId = new DeviceId(externalAddr);
      VirtualDevice device = vm.getVirtualDevice(diskId);
      if (device == null)
         return null;

      AuAssert.check(device instanceof VirtualDisk);
View Full Code Here

Examples of com.vmware.aurora.vc.DeviceId

                  logger.info("current ds swap disk placed: "
                        + swapDisk.getDatastoreName());
                  logger.info("target ds to place swap disk: "
                        + targetDs.getName());
                  vcVm.detachVirtualDisk(
                        new DeviceId(swapDisk.getExternalAddress()), true);
                  AllocationType allocType =
                        swapDisk.getAllocType() == null ? null : AllocationType
                              .valueOf(swapDisk.getAllocType());
                  DiskCreateSpec[] addDisks =
                        { new DiskCreateSpec(new DeviceId(swapDisk
                              .getExternalAddress()), targetDs, swapDisk
                              .getName(), DiskMode.independent_persistent,
                              DiskSize.sizeFromMB(newSwapSizeInMB), allocType) };
                  // changeDisks() will run vcVm.reconfigure() itself
                  vcVm.changeDisks(null, addDisks);
View Full Code Here

Examples of uk.nhs.interoperability.payloads.commontypes.DeviceID

  }
 
  public static AuthorDeviceUniversal createFull() {
    AuthorDeviceUniversal template = new AuthorDeviceUniversal();
   
     template.addDeviceId(new DeviceID().setID("123456"));
    template.setManufacturerModelName(new CodedValue("OMRON-M2", "BASIC BP DEVICE"));
    template.setSoftwareName(new CodedValue("B003CYK6FA", "OMRON M2 BP MONITOR"));
    template.setOrgId(new OrgID()
                .setID("SITE1234")
                .setType(OrgIDType.ODSOrgID.code));
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.