Examples of IVcTaskBody


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

    */
   @Override
   public VcTask promoteDisk(final VirtualDisk disk, final boolean unlink,
         final IVcTaskCallback callback) throws Exception {
      final VirtualDisk[] diskArray = { disk };
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.PromoteDisks, vm.promoteDisks(unlink,
                  diskArray), callback);
         }
View Full Code Here

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

      final VirtualDisk[] diskArray = new VirtualDisk[diskIds.length];
      for (int i = 0; i < diskIds.length; i++) {
         diskArray[i] = (VirtualDisk)getVirtualDevice(diskIds[i]);
         AuAssert.check(diskArray[i] != null);
      }
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.PromoteDisks, vm.promoteDisks(true,
                              diskArray), callback);
         }
View Full Code Here

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

    * @see com.vmware.aurora.vc.VcVirtualmachine#migrate(java.lang.String, com.vmware.aurora.vc.IVcTaskCallback)
    */
   @Override
   public VcTask migrate(final VcResourcePool rp, final IVcTaskCallback callback)
   throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.MigrateVm,
                  vm.migrate(rp.getMoRef(), null, VirtualMachine.MovePriority.defaultPriority, null),
                  callback);
View Full Code Here

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

    * @see com.vmware.aurora.vc.VcVirtualmachine#migrate(java.lang.String, com.vmware.aurora.vc.IVcTaskCallback)
    */
   @Override
   public VcTask migrate(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.MigrateVm,
                  vm.migrate(null, host.getMoRef(), VirtualMachine.MovePriority.defaultPriority, null),
                  callback);
View Full Code Here

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

      getResourcePool().getVcCluster().reconfigure(configSpec);
   }

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

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

      task.waitForCompletion();
   }

   @Override
   public VcTask turnOffFT(final IVcTaskCallback callback) throws Exception {
      return VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            VirtualMachine vm = getManagedObject();
            return new VcTask(TaskType.TurnOffFT,
                  vm.turnOffFaultTolerance(),
                  callback);
View Full Code Here

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

      task.waitForCompletion();
   }

   private VcTask toggleFT(final boolean enable, final IVcTaskCallback callback,
         final VirtualMachine primaryVm, final ManagedObjectReference secondaryVMRef) throws Exception {
      return VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            return new VcTask(enable ? TaskType.EnableFT : TaskType.DisableFT,
                  enable ? primaryVm.enableSecondary(secondaryVMRef, null) : primaryVm.disableSecondary(secondaryVMRef),
                  callback);
         }
View Full Code Here

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

    */
   @Override
   public VcTask createVm(final ConfigSpec config, final IVcTaskCallback callback, final Folder folder)
   throws Exception {
      final VcDatacenter dc = getVcCluster().getDatacenter();
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            Folder vmFolder = folder;
            if (vmFolder == null)
               vmFolder = dc.getVmFolder();
            return new VcTask(TaskType.CreateVm,
View Full Code Here

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

    * Remove this resource pool.
    * @param callback (optional) task callback
    * @throws Exception
    */
   private VcTask destroy(final IVcTaskCallback callback) throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            final ResourcePool rp = getManagedObject();
            return new VcTask(TaskType.DestroyRp, rp.destroy(), callback);
         }
      });
View Full Code Here

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

   }

   public static VcVirtualMachine createVm(final Folder parentFolder,
         final ConfigSpec spec, final VcResourcePool rp, final HostSystem host,
         final IVcTaskCallback callback) throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            ManagedObjectReference hostRef =
                  host != null ? host._getRef() : null;
            ManagedObjectReference taskRef =
                  parentFolder.createVm(spec, rp.getMoRef(), hostRef);
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.