protected override void Run() { Description = string.Format(typeof(T) == typeof(VMPP) ? Messages.CREATING_VMPP : Messages.CREATING_VMSS, _record.Name); RelatedTask = _record.async_task_create(Session); PollToCompletion(); var vmppref = new XenRef <T>(Result); Connection.WaitForCache(vmppref); foreach (var selectedVM in _vms) { _record.set_policy(Session, selectedVM.opaque_ref, vmppref.opaque_ref); } Description = string.Format(typeof(T) == typeof(VMPP) ? Messages.CREATED_VMPP : Messages.CREATED_VMSS, _record.Name); PercentComplete = 60; if (_runNow) { _record.run_now(Session, vmppref); } PercentComplete = 100; }
protected override void Run() { Result = _policy.run_now(Session, _policy.opaque_ref); Description = string.Format(Messages.RUN_POLICY_STARTED, _policy.Name); }