Package com.vmware.vim.binding.vmodl

Examples of com.vmware.vim.binding.vmodl.ManagedObjectReference


      });
   }

   void destroyInt() throws Exception {
      try {
         final ManagedObjectReference oldRp = resourcePool;
         final ManagedObjectReference oldVm = getMoRef();
         VcTask task = destroy(new IVcTaskCallback() {
            @Override
            public final void completeCB(VcTask task) {
               VcCache.purge(oldVm);
               if (oldRp != null) {
View Full Code Here


      }
   }

   @Override
   public void unregister() throws Exception {
      final ManagedObjectReference oldRp = resourcePool;
      final ManagedObjectReference oldVm = getMoRef();
      VirtualMachine vm = getManagedObject();
      vm.unregister();
      VcCache.purge(oldVm);
      VcCache.removeVmRpPair(oldVm);
      if (oldRp != null) {
View Full Code Here

    */
   @Override
   public VcTask cloneVm(String name, VcResourcePool rp, VcDatastore ds, Folder folder,
         boolean linked, IVcTaskCallback callback) throws Exception {
      VcDatacenter dc = rp.getVcCluster().getDatacenter();
      ManagedObjectReference snapMoRef = null;
      if (linked) {
         // To support link-clone, a snapshot of the VM must have been taken.
         // We use the current snapshot to clone.
         snapMoRef = currentSnapshot;
      }
View Full Code Here

         VcHost host, boolean linked, ConfigSpec config, IVcTaskCallback callback) throws Exception {
      // no change to ds
      AuAssert.check(!isTemplate());
      AuAssert.check(snap != null);
      final VcDatacenter dc = getDatacenter();
      ManagedObjectReference dsMoRef = null;
      if (ds != null) {
         dsMoRef = ds.getMoRef();
      }
      return cloneWork(dc, rp.getMoRef(), dsMoRef, snap.getMoRef(),
            folder == null ? null : folder._getRef(), host == null ? null : host.getMoRef(), linked, name, config, callback);
View Full Code Here

   private void updateSnapshotTree(Map<ManagedObjectReference, VcSnapshotImpl> newMap,
                                   Map<ManagedObjectReference, VcSnapshotImpl> oldMap,
                                   final SnapshotTree[] list) throws Exception {
      if (list != null) {
         for (SnapshotTree snap : list) {
            ManagedObjectReference mo = snap.getSnapshot();
            String name = snap.getName();
            VcSnapshotImpl snapObj = oldMap.get(mo);
            if (snapObj == null) {
               snapObj = VcObjectImpl.loadSnapshotFromMoRef(mo, this, name);
            } else {
View Full Code Here

   /* (non-Javadoc)
    * @see com.vmware.aurora.vc.VcVirtualmachine#migrate(java.lang.String)
    */
   @Override
   public void migrate(final VcResourcePool rp) throws Exception {
      final ManagedObjectReference oldRp = resourcePool;
      final ManagedObjectReference newRp = rp.getMoRef();
      VcTask task = migrate(rp, new IVcTaskCallback() {
         @Override
         public void completeCB(VcTask task) {
            VcCache.refresh(moRef);
            VcCache.refresh(oldRp);
View Full Code Here

      });
      task.waitForCompletion();
   }

   private VcTask toggleFT(final boolean enable, final IVcTaskCallback callback) throws Exception {
      ManagedObjectReference secondaryVMRef = null;
      VirtualMachine vm = getManagedObject();
      FaultToleranceConfigInfo ftConfigInfo = vm.getConfig().getFtInfo();
      if (ftConfigInfo instanceof FaultTolerancePrimaryConfigInfo) {
         FaultTolerancePrimaryConfigInfo primaryFtConfigInfo = (FaultTolerancePrimaryConfigInfo)ftConfigInfo;
         AuAssert.check(primaryFtConfigInfo.getSecondaries().length == 1);
View Full Code Here

      reconfigure(configSpec);
   }

   public Folder getParentFolder() {
      VirtualMachine vm = this.getManagedObject();
      ManagedObjectReference mo = vm.getParent();
      if (mo != null) {
         return MoUtil.getManagedObject(mo);
      } else {
         return null;
      }
View Full Code Here

      }
   }

   public void dumpCounters() throws Exception {
      VcService vcService = VcContext.getService();
      ManagedObjectReference pmRef= vcService.getServiceInstanceContent().getPerfManager();
      PerformanceManager perfMgr = MoUtil.getManagedObject(pmRef);
      CounterInfo[] allCounters = perfMgr.getPerfCounter();
      for (CounterInfo c: allCounters) {
         int key = c.getKey();
         String group = formatElementInfo(c.getGroupInfo());
View Full Code Here

   /**
    * Returns the first datacenter in the root folder.
    */
   private static Datacenter getDatacenter(VcService service) throws Exception {
      ManagedObjectReference rootFolderRef = service.getServiceInstanceContent().getRootFolder();
     
      Folder rootFolder = service.getManagedObject(rootFolderRef);
      ManagedObjectReference[] childEntities = rootFolder.getChildEntity();
      for (ManagedObjectReference child : childEntities) {
         ManagedObject mo = service.getManagedObject(child);
View Full Code Here

TOP

Related Classes of com.vmware.vim.binding.vmodl.ManagedObjectReference

Copyright © 2018 www.massapicom. 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.