Package com.vmware.aurora.vc.VcTaskMgr

Examples of com.vmware.aurora.vc.VcTaskMgr.IVcTaskBody


   }

   @Override
   public VcTask remove(final IVcTaskCallback callback) throws Exception {
      // remove child snaps=false, consolidate=true
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         @Override
         public VcTask body() throws Exception {
            Snapshot snap = getManagedObject();
            return new VcTask(TaskType.RemoveSnap, snap.remove(false, true), callback);
         }
View Full Code Here


   }

   @Override
   public VcTask revert(final IVcTaskCallback callback) throws Exception {
      // revert to snapshot: host=null, suppressPowerOn=false
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         @Override
         public VcTask body() throws Exception {
            final Snapshot snap = getManagedObject();
            return new VcTask(TaskType.RevertSanp, snap.revert(null, false), callback);
         }
View Full Code Here

      return powerOn((VcHost)null);
   }

   @Override
   public VcTask powerOn(final VcHost host, final IVcTaskCallback callback) throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.PowerOn, vm.powerOn(host == null ? null : host.getMoRef()), callback);
         }
      });
View Full Code Here

   /* (non-Javadoc)
    * @see com.vmware.aurora.vc.VcVirtualmachine#powerOff(com.vmware.aurora.vc.IVcTaskCallback)
    */
   @Override
   public VcTask powerOff(final IVcTaskCallback callback) throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.PowerOff, vm.powerOff(), callback);
         }
      });
View Full Code Here

      }
      return true;
   }

   private VcTask destroy(final IVcTaskCallback callback) throws Exception {
      return VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.DestroyVm, vm.destroy(), callback);
         }
      });
View Full Code Here

         disk.setDiskId(device.getKey());
         diskList.add(disk);
      }

      relocSpec.setDisk(diskList.toArray(new RelocateSpec.DiskLocator[diskList.size()]));
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.RelocateVm,
                  vm.relocate(relocSpec, VirtualMachine.MovePriority.defaultPriority), callback);
         }
View Full Code Here

      spec.setLocation(relocSpec);
      spec.setSnapshot(snapMoRef);
      spec.setTemplate(false);
      spec.setConfig(config);

      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.CloneVm,
                  vm.clone(folderMoRef == null ? dc.getVmFolderMoRef() : folderMoRef, name, spec), callback);
         }
View Full Code Here

    * @see com.vmware.aurora.vc.VcVirtualmachine#createSnapshot(java.lang.String, java.lang.String, com.vmware.aurora.vc.IVcTaskCallback)
    */
   @Override
   public VcTask createSnapshot(final String name, final String description,
         final IVcTaskCallback callback) throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.Snapshot,
                  vm.createSnapshot(name, description, false, false),
                  VcVirtualMachineImpl.this, callback);
View Full Code Here

   /* (non-Javadoc)
    * @see com.vmware.aurora.vc.VcVirtualmachine#createSnapshot(com.vmware.aurora.vc.IVcTaskCallback)
    */
   @Override
   public VcTask removeAllSnapshots(final IVcTaskCallback callback) throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.RemoveSnap,
                  vm.removeAllSnapshots(true),
                  callback);
View Full Code Here

    * @see com.vmware.aurora.vc.VcVirtualmachine#reconfigure(com.vmware.vim.binding.vim.vm.ConfigSpec, com.vmware.aurora.vc.IVcTaskCallback)
    */
   @Override
   public VcTask reconfigure(final ConfigSpec spec, final IVcTaskCallback callback)
   throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            spec.setName(MoUtil.toURLString(spec.getName()));
            return new VcTask(TaskType.ReconfigVm, vm.reconfigure(spec), callback);
         }
View Full Code Here

TOP

Related Classes of com.vmware.aurora.vc.VcTaskMgr.IVcTaskBody

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.